Re: [PATCH 1/7] Use 'printf %s $x' notation in t5401

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

 



"Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes:

> Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> ...
>> Do you really mean this? "printf %s 1 2 3" writes "123" without
>> terminating LF.  You seem to check only for size but to be
>> reusable you might want to use something like:
> 
> The only thing we care about is was there args or not to the hook.
> I probably could do that test differently, like say:
>
> 	echo $# >$GIT_DIR/pre-receive.args
>
> and then test that the file contains "0" instead of looking for it to
> be empty.  Not sure why I didn't write it that way in the beginning.
>
>> 	printf '%s\n' "$@"
>
> Eh.  Since all we care is that the argument count is 0 we probably
> should be looking at $# and calling it a day.

I'll apply as-is, but once you break the code that calls
pre-receive hook in such a way that it sends unexpected
arguments, you'd thank me for suggesting to print the arguments
separately while debugging the problem with the test script.
-
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]

  Powered by Linux