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

Re: [PATCH] git show <tree>: show mode and hash, and handle -r

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 31, 2008, 21:40 UTC
Message-ID
<alpine.DEB.1.00.0810312236490.22125@pacific.mpi-cbg.de.mpi-cbg.de>
In-Reply-To
<7vk5bo8y3m.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 31 Oct 2008, Junio C Hamano wrote:
Show 17 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Thu, 30 Oct 2008, Junio C Hamano wrote:
> >
> >> I wonder if it would help breaking down cmd_log_init() a bit like this.
> >
> > Sorry, I am quite busy (this is the first time I am able to check my 
> > mail since the GitTogether), so I cannot look at that in detail.
> >
> > However, I strongly expect your suggestion not to help: for showing 
> > commits, we _want_ recursive to be the default.  And switching that on 
> > devoids us from being able to DIFF_OPT_TST(.., RECURSIVE) to detect if 
> > the user said '-r' _explicitely_.
> 
> You can turn on recursive unconditionally for the normal "show 
> committish" case, and check for explicit "-r" for "show treeish" that 
> was bolted-on much later, can't you?

No, I can't, because cmd_show() uses setup_revisions() (actually, this is called by cmd_log_init()) not only to parse the command line arguments, but also the objects to show.

The only way I could imagine this working is to turn _off_ FORMAT_PATCH, do the parsing, then check if RECURSIVE was set, then turn _on_ FORMAT_PATCH and call diff_setup_done().

But that feels just as awful.

Ciao, Dscho

Previous: Junio C Hamano
Message 7 of 7 in “git show <tree>: show mode and hash, and handle -r”
  1. git show <tree>: show mode and hash, and handle -rJohannes Schindelin, Oct 29, 2008
  2. Johannes SixtOct 29, 2008
  3. Johannes SchindelinOct 29, 2008
  4. Junio C HamanoOct 30, 2008
  5. Johannes SchindelinOct 31, 2008
  6. Junio C HamanoOct 31, 2008
  7. Johannes SchindelinOct 31, 2008

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.