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

Re: [WRONG/PATCH 1/3] revisions: clarify handling of --no-walk and --do-walk

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 26, 2011, 08:19 UTC
Message-ID
<4DB67FFF.1060709@drmicha.warpmail.net>
In-Reply-To
<20110425002124.GB31168@elie>
Jonathan Nieder venit, vidit, dixit 25.04.2011 02:21:
Show 26 quoted lines
> Michael J Gruber wrote:
> 
>> We don't do the systematic approach now. In some situations, some
>> commands switch on the walker automatically (I think "show A..B") to
>> make things more useful (to most users) but less systematic, even less
>> predictable if you don't know these deviations/exceptions. I've
>> suggested such a "usefulness exception" myself (don't prune commits by
>> path for "show").
> 
> Ah.  To be clearer about the present state:
> 
>  - cmd_show reimplements much of get_revision, to work around the
>    revision walking machinery's lack of callbacks to print tags,
>    blobs, and so on.
> 
>  - ^A means "--do-walk ^A", and A..B means "--do-walk ^A B".  This
>    holds in rev-list, log, show, etc --- they all share the code that
>    does this.
> 
>  - Similarly, -5 means "--do-walk -5".
> 
>  - rev-parse shares a revision parser (get_sha1) with rev-list, but it
>    doesn't share an option parser (alas).
> 
> I personally kind of like the "don't prune commits by path with
> --no-walk" idea.  Not sure what happened to that.

It got dropped after the switch to the new cycle. The question/problem was whether some people used "git show A B C -- path" as a kind of commit filter, selecting only commits which touch path (i.e. prune commits by path). I would claim it's the wrong command to do that and was never documented anyways...

So, my choice would be "do not prune commits unless --do-walk was given" (where "was given" may include "was switched on by our range=>walk logic").

Another choice would be "do not prune if there is only one rev argument and no --do-walk".

Show 6 quoted lines
> Ah.  To be clearer about the present state:
> 
>  - cmd_show reimplements much of get_revision, to work around the
>    revision walking machinery's lack of callbacks to print tags,
>    blobs, and so on.
> 

You mean, other than pretty formats... I think our code does a couple of things by hand which could be done with a pretty format. Though a callback may be more efficient, unless our formats are pre-parsed.

Michael
Previous: Jonathan NiederNext: Jonathan Nieder
Message 7 of 11 in “teaching log's --glob=<glob> and friends to git shortlog”
  1. 0/3 teaching log's --glob=<glob> and friends to git shortlogJonathan Nieder, Apr 21, 2011
  2. 1/3 revisions: clarify handling of --no-walk and --do-walkJonathan Nieder, Apr 21, 2011
  3. Michael J GruberApr 21, 2011
  4. Jonathan NiederApr 21, 2011
  5. Michael J GruberApr 24, 2011
  6. Jonathan NiederApr 25, 2011
  7. Michael J GruberApr 26, 2011
  8. 2/3 revisions: split out handle_revision_pseudo_opt functionJonathan Nieder, Apr 21, 2011
  9. 3/3 revisions: allow --glob and friends in parse_options-enabled commandsJonathan Nieder, Apr 21, 2011
  10. Junio C HamanoApr 21, 2011
  11. Jonathan NiederApr 21, 2011

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.