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

Re: [PATCH 2/4] revision: add rev_input_given flag

From
Jeff King <peff@peff.net>
Date
Aug 2, 2017, 23:11 UTC
Message-ID
<20170802231114.oqf5ms47mccpjwhp@sigill.intra.peff.net>
In-Reply-To
<xmqqd18dr3rj.fsf@gitster.mtv.corp.google.com>
On Wed, Aug 02, 2017 at 03:41:52PM -0700, Junio C Hamano wrote:
Show 22 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Normally a caller that invokes setup_revisions() has to
> > check rev.pending to see if anything was actually queued for
> > the traversal. But they can't tell the difference between
> > two cases:
> >
> >   1. The user gave us no tip from which to start a
> >      traversal.
> >
> >   2. The user tried to give us tips via --glob, --all, etc,
> >      but their patterns ended up being empty.
> >
> > Let's set a flag in the rev_info struct that callers can use
> > to tell the difference.  We can set this from the
> > init_all_refs_cb() function.  That's a little funny because
> > it's not exactly about initializing the "cb" struct itself.
> > But that function is the common setup place for doing
> > pattern traversals that is used by --glob, --all, etc.
> 
> ...and "--bisect", which is an oddball so we probably do not have to
> care.  I didn't check if there is a fallout on that codepath.

Yeah, I saw that one and figured it should probably as "input given". There's also "--reflog" and "--indexed-objects", which aren't covered here. I'm not sure if anybody really cares (you'd generally use them with "--all" anyway), so I left them out for now.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 5 of 13 in “handling empty inputs in the revision machinery”
  1. 0/4 handling empty inputs in the revision machineryJeff King, Aug 2, 2017
  2. 1/4 t6018: flesh out empty input/output rev-list testsJeff King, Aug 2, 2017
  3. 2/4 revision: add rev_input_given flagJeff King, Aug 2, 2017
  4. Junio C HamanoAug 2, 2017
  5. Jeff KingAug 2, 2017
  6. 3/4 rev-list: don't show usage when we see empty ref patternsJeff King, Aug 2, 2017
  7. 4/4 revision: do not fallback to default when rev_input_given is setJeff King, Aug 2, 2017
  8. Junio C HamanoAug 2, 2017
  9. Stefan BellerAug 2, 2017
  10. 5/4 revision: let --stdin set rev_input_givenJeff King, Aug 2, 2017
  11. Junio C HamanoAug 3, 2017
  12. Jeff KingAug 3, 2017
  13. Junio C HamanoAug 2, 2017

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.