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

Re: git log fails to show all changes for a file

From
Jeff King <peff@peff.net>
Date
Jul 15, 2015, 18:57 UTC
Message-ID
<20150715185717.GA11146@peff.net>
In-Reply-To
<xmqqtwt5wai9.fsf@gitster.dls.corp.google.com>
On Wed, Jul 15, 2015 at 11:17:50AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> > So this is a suggested change to "-p -m" behavior?
> 
> Not really.  This is a suggested behaviour for "git log -p"; I
> wasn't very enthused by the idea to turn --cc when user said -p
> without telling them what we are doing.  In other words, if the
> users want combined, they should say --cc (and they will get a
> single-parent patch for non-merges with --cc) so there is no reason
> not to do this, as long as we fix --cc so that "git log --cc"
> implies "git log --cc -p".

Like you, I frequently use "--first-parent -m". If I understand your proposal, a regular "git log" would have the first-parent-diff behavior of those options, but still traverse other parents.

One oddity of that proposal is that the user ends up seeing any given change on a side-branch _twice_. Once in the original commit that introduced it, and once in the merge of the branch. And commit-selection tools like "git log -Ssome_code" will select both, too, and they'll see the merge commit along with the original. I can't decide if that's a good thing or not.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 13 in “git log fails to show all changes for a file”
  1. Olaf HeringJul 14, 2015
  2. John KeepingJul 14, 2015
  3. Olaf HeringJul 14, 2015
  4. Andreas SchwabJul 14, 2015
  5. Linus TorvaldsJul 14, 2015
  6. Junio C HamanoJul 15, 2015
  7. Linus TorvaldsJul 15, 2015
  8. Junio C HamanoJul 15, 2015
  9. Linus TorvaldsJul 15, 2015
  10. Junio C HamanoJul 15, 2015
  11. Jeff KingJul 15, 2015
  12. Junio C HamanoJul 15, 2015
  13. Linus TorvaldsJul 15, 2015

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.