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

Re: git-log combining different detail levels

From
Jeff King <peff@peff.net>
Date
Aug 22, 2012, 20:04 UTC
Message-ID
<20120822200444.GA27462@sigill.intra.peff.net>
In-Reply-To
<50353212.7060109@seznam.cz>
On Wed, Aug 22, 2012 at 09:25:06PM +0200, Maaartin-1 wrote:
Show 17 quoted lines
> Quite often I need to see some changes in more detail and others only
> briefly, so I get some idea about the context. For example I'd like
> something like merging the outputs of
> 
> git log -p -S Bandersnatch
> and
> git log --name-status --oneline
> 
> together, so I know better what happened.
> 
> A simpler (and maybe more important) example is merging
> 
> git log -p some/dir
> and
> git log --name-status
> 
> so I could see all the changes, and the chosen ones with all details.

No, I don't think this is possible. We have "--full-diff", which disconnects the path-limiting from the diff generation, so that:

  git log --full-diff --name-status some/dir

would choose only commits for some/dir, but show the full diff of each commit.

However, what you are asking is to disconnect the two diff options: one verbose option only for interesting parts of the diff, and then a more sparse option for the rest. I'm pretty sure the diff machinery does not currently understand such an option.

It would not be impossible to implement, I think, but I suspect it would involve refactoring the format selection in the diff code quite a bit. In the meantime, one thing you can do is generate the full diff output and then post-process it to collapse the uninteresting bits. I haven't tried, but you can probably do something like this using "folds" in your editor (e.g., shrink all of the diff content for a file to a single line, but then expand it on demand).

-Peff
Previous: Maaartin-1
Message 2 of 2 in “git-log combining different detail levels”
  1. Maaartin-1Aug 22, 2012
  2. Jeff KingAug 22, 2012

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.