Thread (8 messages) flat view 8 messages, 4 authors, 2016-06-15

Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again

From: martin f krafft <hidden>
Date: 2016-06-15 22:46:28

also sprach Bert Wesarg [off-list ref] [2009.03.25.1243 +0100]:
First I think the '#' is a leftover, second this is now a bashism.
I think this can be rewritten as POSIX as follows:
-			git rev-parse -q --verify "${head_/#refs\/heads/refs\/top-bases}" >/dev/null || exit 0;;
+			git rev-parse -q --verify "${head_/refs\/heads/refs\/top-bases}" >/dev/null || exit 0;;
  git rev-parse -q --verify "refs/top-bases/${head_##refs/heads/}" >/dev/null || exit 0;;

This turns e.g. refs/heads/foo into foo and prepends
refs/top-bases/, which should be the same effect, assuming that the
variable's value contains nothing else but the ref's path.

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
logik ist analsadismus: gedanken werden gewaltsam
durch einen engen gang gepreßt.
                                                    -- frei nach lacan

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help