Re: [PATCH v5 2/2] send-email: expose header information to git-send-email's sendemail-validate hook

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> "Strawbridge, Michael" <Michael.Strawbridge@xxxxxxx> writes:
>
>> +test_expect_success $PREREQ "--validate hook supports header argument" '
>> +	test_when_finished "rm my-hooks.ran" &&
>> +	write_script my-hooks/sendemail-validate <<-\EOF &&
>> +	filesize=$(stat -c%s "$2")
>
> That "stat -c" is a GNU-ism, I think.  macOS CI jobs at GitHub do
> not seem to like it.
>
>> +	if [ "$filesize" != "0" ]; then
>
> Also, please see Documentation/CodingGuidelines to learn the subset
> of shell script syntax and style we adopted for this project.

Sorry, forgot to say that if you are merely interested to react to
the fact that a file has non-empty contents,

	if test -s "$2"
	then
		... file $2 is not empty ...
	fi &&
	...

should be a way to do so.

Thanks.







[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