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

Re: [PATCH] Re: Make 'git show' more useful

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 14, 2009, 00:00 UTC
Message-ID
<alpine.LFD.2.01.0907131652120.13838@localhost.localdomain>
In-Reply-To
<1247528614-24590-1-git-send-email-bonzini@gnu.org>
On Tue, 14 Jul 2009, Paolo Bonzini wrote:
> 
> So, what about squashing this with Linus's patch?  (This is meant to be
> squashed, which is why this text is not in a cover letter).
I wouldn't squash it.

That said, in the original commit that introduced "no_walk" (ba1d4505), I said

    I was going to add "--no-walk" as a real argument flag to git-rev-list
    too, but I'm not sure anybody actually needs it. Although it might be
    useful for porcelain, so I left the door open.
and I never actually did it. That was Apr 15, 2006.

The actual "--no-walk" flag was then added over a year later by Dsco, in commit 8e64006eee ("Teach revision machinery about --no-walk").

Doing a "git log -p -S--no-walk", I have to admit that I don't find a single actual _use_ of --no-walk. And it obviously wasn't even exported until a year after it was internally implemented.

So I have to agree with the fact that "--no-walk" and "--do-walk" seem to be pretty worthless as command line switches. Removing them might be a good thing.

However, doing some googling, I do actually find examples of it on the web. And some of them even appear valid:

	second_parent=$(git rev-list --no-walk --parents $newrev | sed 's/ /\n/g' | grep -v $newrev | tail --lines=1)

because you can't use "git rev-parse" with --parents (of course, I'm not at all clear on why it doesn't do

	second_parent=$(git rev-parse "$newrev"^2)

but that's really immaterial - the point is that "git rev-parse" is _not_ a replacement for "git rev-list --no-walk").

So I dunno. I think we might as well leave --no-walk and --do-walk around, even though they are of dubious value. They do mirror the internal revision walking logic very directly.

			Linus
Previous: Paolo BonziniNext: Johannes Schindelin
Message 4 of 17 in “Make 'git show' more useful”
  1. Linus TorvaldsJul 13, 2009
  2. Junio C HamanoJul 13, 2009
  3. Re: Make 'git show' more usefulPaolo Bonzini, Jul 13, 2009
  4. Linus TorvaldsJul 14, 2009
  5. Johannes SchindelinJul 14, 2009
  6. Linus TorvaldsJul 14, 2009
  7. Paolo BonziniJul 14, 2009
  8. Johannes SchindelinJul 14, 2009
  9. t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 14, 2009
  10. Johannes SixtJul 14, 2009
  11. Michael J GruberJul 14, 2009
  12. [PATCHv2] t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 14, 2009
  13. Johannes SchindelinJul 14, 2009
  14. Michael J GruberJul 14, 2009
  15. t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 17, 2009
  16. Johannes SchindelinJul 17, 2009
  17. Johannes SchindelinJul 13, 2009

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.