Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again
- From
- martin f krafft <madduck@debian.org>
- Date
- Mar 25, 2009, 12:17 UTC
- Message-ID
- <20090325121721.GB13065@lapse.rw.madduck.net>
- In-Reply-To
- <1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com>
also sprach Bert Wesarg <bert.wesarg@googlemail.com> [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