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

Re: confused git diff -G

From
APAlexei Podtelezhnikov <apodtele@gmail.com>
Date
Aug 25, 2023, 03:43 UTC
Message-ID
<CAJU=AjW24gHCv-K97z=9KZJ4eqOEPvOR_6egFWZtnrZ21c3n8w@mail.gmail.com>
In-Reply-To
<CAJU=AjU6cggm+P3d_Ke4uyks79j7uYipbp0xPq7jJ+nCgNSUZg@mail.gmail.com>
Show 12 quoted lines
> > given to `-G`, like so:
> >
> >     $ git -C repo diff --stat HEAD^
> >      a | 1 +
> >      b | 1 +
> >      2 files changed, 2 insertions(+)
> >     $ git -C repo diff --stat HEAD^ -G a
> >      a | 1 +
> >      1 file changed, 1 insertion(+)
> >     $ git -C repo diff --stat HEAD^ -G b
> >      b | 1 +
> >      1 file changed, 1 insertion(+)
Never mind my last blurp, thank you for the explanation.

This is how I thought it works but the docs *^^$@%&$ for either git-log or git-diff: the example from diff but the text is from log. It could not be more confusing than this, not just might. If you want to share the text, it should be generic.

Previous: Alexei PodtelezhnikovNext: Junio C Hamano
Message 4 of 5 in “confused git diff -G”
  1. Alexei PodtelezhnikovAug 24, 2023
  2. Taylor BlauAug 24, 2023
  3. Alexei PodtelezhnikovAug 25, 2023
  4. Alexei PodtelezhnikovAug 25, 2023
  5. Junio C HamanoAug 25, 2023

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.