Re: [PATCH] Make verify-tag a builtin.
- From
- Carlos Rica <jasampler@gmail.com>
- Date
- Jul 27, 2007, 19:51 UTC
- Message-ID
- <1b46aba20707271251g7cf968a6o3840739dec548408@mail.gmail.com>
- In-Reply-To
- <7vr6mu2uo0.fsf@assigned-by-dhcp.cox.net>
2007/7/27, Junio C Hamano <gitster@pobox.com>:
Show 18 quoted lines
> Carlos Rica <jasampler@gmail.com> writes: > > Signal SIGPIPE is ignored because the program sometimes was > > terminated because that signal when writing the input for gpg. > > This "sometimes" does not give confidence to readers, I am > afraid. > > What is happening is perfectly normal, not "sometimes it gets > the signal mysteriously, so we need to paper it over by ignoring > it". > > You invoke gpg, giving it a file that is supposed to contain a > detached signature, and start feeding the payload that ought to > verify Ok with the signature. If the tag is not signed, after > gpg has read the detached signature, it already knows that the > signature will not verify and it can exit without reading the > payload from its standard input. When you try to write the > payload to the pipe, you would get SIGPIPE.
By using "sometimes" I was requesting an answer to this strange behaviour (for me) to you and the mailing list. Now I could reproduce it removing the call to signal and running this:
#!/bin/sh
echo "creating vtag1..."
git tag -s -m "a signed tag" vtag1
echo "creating vtag2..."
git tag -m "an annotated non-signed tag" vtag2
echo "creating vtag3..."
git tag -m "another annotated non-signed tag is " vtag3
# 141 returned sometimes when gpg got
# a non-signed file as detached signature:
# (it refuses to read from the input when
# no signature is given, sometimes)
for i in 1 2 3 4 5 6 7 8 9 10
do
./git verify-tag vtag1 vtag2 vtag3
echo "git verify-tag vtag1 vtag2 vtag3 exit code: $?"
echo
done
git tag -d vtag1
git tag -d vtag2
git tag -d vtag3In my system, some of the tests give 141 and others give 1 as exit code. Dscho said that it could depend on the CPU current load of the computer, since he got always 141 as you said, so perhaps it's me.