Re: [PATCH] commit-tree: add missing --gpg-sign flag

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

 



Hi Martin,

Thanks again for your comments and patience, I appreciate it :-)

> > -               if (skip_prefix(arg, "-S", &sign_commit))
> > +               if(!strcmp(arg, "--gpg-sign")) {
> > +                   skip_prefix(arg, "--gpg-sign", &sign_commit);
>
> I personally find this a bit convoluted, compared to just assigning "".
> Maybe there are reasons for doing it this way that I don't see?

You're right, it is a bit convoluted. The reason I opted to do it this way is
because I wanted to reuse part of "arg" by simply advancing the pointer,
but this is silly and wastes cycles, and after thinking about it a bit more
I realized how silly it was.

> All of the commands above are suffixed with "&&" which means that the
> shell only keeps executing as long as the commands succeed. If any of
> those 20-30 commands fails, the shell will jump out of the &&-chain and
> land ... at this line you're adding. If that one succeeds, the test will
> be reported as succeeding. So please add a "&&" to the "10" line.

Woops, I can't believe I missed that.

> All of that said ... if I add the missing "&&" and run your test on the
> *old* implementation, it still succeeds. The reason is that I grepped
> for the "best" place to put this, and directed you to a part of the test
> suite where it might be a bit too easy to copy existing code and end
> up with something non-ideal. Sorry about that. :-(
>
> What happens is that git commit-tree reports "fatal: Not a valid object
> name --gpg-sign", then we go on to happily execute `git tag
> eleventh-signed` where we've just substituted the empty string produced
> by git commit-tree. The verifications will succeed, because there's
> already a signature there... (BTW, the verifications happen further
> down, so you'll want to add "eleventh-signed" to the list of tags
> there.)

No need to apologize, I jumped the gun. I'm going to look into putting
together a more robust test for this change.

Brandon



[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