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
Junio C Hamano <gitster@pobox.com>
Date
Jul 15, 2015, 19:22 UTC
Message-ID
<xmqqpp3tw7if.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150715185717.GA11146@peff.net>
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> On Wed, Jul 15, 2015 at 11:17:50AM -0700, Junio C Hamano wrote:
>
>> > 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.

Hmm, you are right. That may be a problem, and Linus's makes tons of practical sense (especially for us experienced Git users).

It just is that '-p', that clearly stands for 'patch' but does more than 'patch' to produce something that cannot be fed to 'apply' by defaulting to '--cc', makes me hesitate. By making it a lot more convenient for experienced people who understand these issues, I have this suspicion that it would make the options less orthgonal and harder to explain to new people.

Previous: Jeff KingNext: Linus Torvalds
Message 12 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.