From: Brandon Richardson <brandon1024.br@gmail.com>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] commit-tree: add missing --gpg-sign flag
Date: Fri, 18 Jan 2019 11:06:36 -0400 [thread overview]
Message-ID: <CAETBDP7BcENA3Cjbj6y_5L3WGHx1wmMwkagx_CuRr5gAz9wYVA@mail.gmail.com> (raw)
In-Reply-To: <CAN0heSrE3mOnjyrzw76Gp6wBuq62wgM6jBV1u+vn3b6ySm0EDQ@mail.gmail.com>
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
next prev parent reply other threads:[~2019-01-18 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 1:09 [PATCH] commit-tree: add missing --gpg-sign flag Brandon Richardson
2019-01-18 7:11 ` Martin Ågren
2019-01-18 15:06 ` Brandon Richardson [this message]
2019-01-18 21:02 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAETBDP7BcENA3Cjbj6y_5L3WGHx1wmMwkagx_CuRr5gAz9wYVA@mail.gmail.com \
--to=brandon1024.br@gmail.com \
--cc=git@vger.kernel.org \
--cc=martin.agren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).