Re: [PATCH] pre-commit.sample: don't use [...] around a tr range

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

 



On Mon, Sep 21, 2009 at 01:00:34PM +0200, Jim Meyering wrote:

> > We have (had?) people trying to support Git on HP-UX and SunOS.
> > Do these count?
> 
> I had my doubts, but have just confirmed that Solaris 10's
> /usr/bin/tr is still doing it the SYSV way:
> 
>     $ echo foo | LC_ALL=C /usr/bin/tr a-z A-Z
>     foo
> 
> There, you have to use /usr/xpg4/bin/tr to get the expected behavior:
> 
>     $ echo foo | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z
>     FOO
> 
> So you're right.  Thanks!

See:

  http://article.gmane.org/gmane.comp.version-control.git/76991

> +	# Note that the use of brackets around a tr range is ok here, (it's
> +	# even required, for portability to Solaris 10's /usr/bin/tr), since
> +	# the square bracket bytes happen to fall in the designated range.
>  	test "$(git diff --cached --name-only --diff-filter=A -z |
>  	  LC_ALL=C tr -d '[ -~]\0')"

Does this work on non-bracket systems? I would think that enumerating
the sequence would be the most portable thing.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]