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

Re: [PATCH] diff-options: add --stat

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 13, 2006, 08:29 UTC
Message-ID
<Pine.LNX.4.63.0604131023250.13970@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vek02ynif.fsf@assigned-by-dhcp.cox.net>
Hi,
On Wed, 12 Apr 2006, Junio C Hamano wrote:
Show 28 quoted lines
> Junio C Hamano <junkio@cox.net> writes:
> 
> > I wonder if you can also make this an independent option that
> > prepends diffstat in front of the patch, just like the way the
> > new flag --patch-with-raw flag prepends raw output in front of
> > the patch.
> 
> Clarification.
> 
> Traditionally, we had diff-raw and diff-patch formats.
> We can think of --name-status and --name-only variants of
> diff-raw (just like different --abbrev settings give different
> visuals for diff-raw).  Until very recently, these were either-or
> output formats, but for Cogito we added an option to show both.
> 
> We could reorganize the output format options to:
> 
> 	- diff-raw and its name variants
> 	- diff-stat
>         - diff-patch
> 
> and have (internally) three bools to specify which ones to
> output, in the above order.  The recent --patch-with-raw would
> flip bit #0 (show raw) and bit #2 (show patch) on.  It is very
> likely that diff-stat followed by diff-patch would be a popular
> format (that is what git-format-patch does), and it also is
> conceivable that diff-raw with diff-stat but without diff-patch
> might turn out to be useful for some people.

That sounds plausible. Note that if diff-stat and diff-patch are turned on, the patch generating code will be called twice. I do not think it is sensible (or robust, for that matter) to cache the patch for this case.

> Also, I forgot to mention, but would it be useful to have a
> diffstat to show --cc?  It is unclear, without much thinking,
> what the numbers would mean, though...

I thought long and hard about that. But how would you display it? You can have lines starting with "+ ", " +", "--", etc. The only half-way reasonable approach I found was to display the diffstat against each parent individually. Since it would be a bit involved to implement that, I wanted to think about it a bit longer, if it really makes sense.

Ciao, Dscho

Previous: Junio C HamanoNext: Marco Costalba
Message 6 of 13 in “diff-options: add --stat”
  1. diff-options: add --statJohannes Schindelin, Apr 13, 2006
  2. Johannes SchindelinApr 13, 2006
  3. Johannes SchindelinApr 13, 2006
  4. Junio C HamanoApr 13, 2006
  5. Junio C HamanoApr 13, 2006
  6. Johannes SchindelinApr 13, 2006
  7. Marco CostalbaApr 13, 2006
  8. Johannes SchindelinApr 13, 2006
  9. Junio C HamanoApr 13, 2006
  10. Linus TorvaldsApr 13, 2006
  11. Junio C HamanoApr 13, 2006
  12. Linus TorvaldsApr 13, 2006
  13. Johannes SchindelinApr 13, 2006

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.