git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/2] de-confuse git cherry-pick --author

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 11, 2018, 08:58 UTC
Message-ID
<nycvar.QRO.7.76.6.1807111057500.75@tvgsbejvaqbjf.bet>
In-Reply-To
<20180710043120.GA1330@sigill.intra.peff.net>
Hi Peff,
On Tue, 10 Jul 2018, Jeff King wrote:
Show 40 quoted lines
> On Mon, Jul 09, 2018 at 10:15:05PM -0400, Jeff King wrote:
> 
> > > Should this not rather be
> > > 
> > > -		if (!cmit || get_revision(opts->revs))
> > > -			return error("BUG: expected exactly one commit from walk");
> > > +		if (!cmit)
> > > +			return error(_("empty commit set passed"));
> > > +		if (get_revision(opts->revs))
> > > +			return error(_("unexpected extra commit from walk"));
> > 
> > Yeah, you're right. I'm not sure how a single rev with no-walk would
> > ever turn up more than one commit, though. So I think we should probably
> > go with:
> > 
> >   if (!cmit)
> > 	return error(_("empty commit set passed"));
> >   if (get_revision(opts->revs))
> > 	BUG("unexpected extra commit from walk");
> > 
> > And then if we ever see that case, we can decide from there what the
> > right action is (though _probably_ it's just to emit an error like you
> > have above, it might be a sign that our single-pick logic is wrong).
> > 
> > I'll re-roll in that direction, and discuss further in the commit
> > message.
> 
> After poking at it a bit more, I've convinced myself that this is the
> right thing, as options like "--branches" which expand into multiple
> tips already push us into the other code path.
> 
> So here's a re-roll. The first one is identical except for the typo-fix
> in the commit message.
> 
>   [1/2]: sequencer: handle empty-set cases consistently
>   [2/2]: sequencer: don't say BUG on bogus input
> 
>  sequencer.c                     | 12 ++++++++----
>  t/t3510-cherry-pick-sequence.sh |  7 ++++++-
>  2 files changed, 14 insertions(+), 5 deletions(-)

ACK, Dscho

Previous: Jeff KingNext: Junio C Hamano
Message 14 of 15 in “[BUG] git cherry-pick does not complain about unknown options”
  1. Andrei RybakJul 9, 2018
  2. Jeff KingJul 9, 2018
  3. 0/2 de-confuse git cherry-pick --author behaviorJeff King, Jul 9, 2018
  4. 1/2 sequencer: handle empty-set cases consistentlyJeff King, Jul 9, 2018
  5. Junio C HamanoJul 9, 2018
  6. Johannes SchindelinJul 9, 2018
  7. 2/2 sequencer: don't say BUG on bogus inputJeff King, Jul 9, 2018
  8. Johannes SchindelinJul 9, 2018
  9. Junio C HamanoJul 9, 2018
  10. Jeff KingJul 10, 2018
  11. 0/2 de-confuse git cherry-pick --authorJeff King, Jul 10, 2018
  12. 1/2 sequencer: handle empty-set cases consistentlyJeff King, Jul 10, 2018
  13. 2/2 sequencer: don't say BUG on bogus inputJeff King, Jul 10, 2018
  14. Johannes SchindelinJul 11, 2018
  15. Junio C HamanoJul 11, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.