Re: [PATCH w/signoff] pre-push.sample: Remove unwanted `IFS=' '`.

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

 



Jim Hill <gjthill@xxxxxxxxx> writes:

> Signed-off-by: Jim Hill <gjthill@xxxxxxxxx>
> ---

Please clarify "unwanted" in the proposed commit log message.

It looks to me that the assignment very much deliberate.  We know
refnames and 40-hex object names do not contain SP, and the hook is
fed (quoting from Documentation/githooks.txt) like this:

    Information about what is to be pushed is provided on the hook's standard
    input with lines of the form:

      <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF

so setting IFS to SP alone smells as an attempt to ensure that the
"read" in each loop iteration would split at SP and nothing else;
Aaron Schrab CC'ed who did the original in 87c86dd1 (Add sample
pre-push hook script, 2013-01-13).

Also you would notice by reading "git shortlog" of our history that
s/Remove/remove/ on the subject line would avoid this entry stand out
among others unnecessarily, but that is minor.

>  templates/hooks--pre-push.sample | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
> index 69e3c67..6187dbf 100755
> --- a/templates/hooks--pre-push.sample
> +++ b/templates/hooks--pre-push.sample
> @@ -24,7 +24,6 @@ url="$2"
>  
>  z40=0000000000000000000000000000000000000000
>  
> -IFS=' '
>  while read local_ref local_sha remote_ref remote_sha
>  do
>  	if [ "$local_sha" = $z40 ]
--
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]