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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



also sprach Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> [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@xxx>      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

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux