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

Re: BUG? git log --no-merges shows grafted merges in shallow clones

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2016, 20:13 UTC
Message-ID
<xmqqbn73jklt.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<vpqwpprqlt4.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 23 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> I do not think this is limited to shallow but for grafts in
>> general.  
>
> Probably yes. I happen to only use grafts in shallow clones ;-).
>
>> cat-file is low-level to show the bare metal, but by using these
>> facility you asked Git to give you an imaginary history where that
>> commit is the root commit--and that is why it is shown, I think.
>>
>> What does it do if you say "git -c log.showRoot=false log -p"?
>
> I get the commit without the patch:
>
> commit c3c1cc25b27d448e9ef67b265a11be8735ff2df4 (grafted)
> Author: Matthieu Moy <Matthieu.Moy@imag.fr>
> Date:   Mon Aug 31 16:32:20 2015 +0200
>
>     Merge remote-tracking branch 'edward/utf-8-email-support4'
>
> Without "-c log.showRoot=false" I get a big patch (diff of the commit
> against the empty tree).

... which shows that Git is consistently pretending as if that commit is the root commit, which in turn means that it is correct for "log --no-merges" to not peek into the information at "cat-file commit" level.

Previous: Matthieu Moy
Message 4 of 4 in “BUG? git log --no-merges shows grafted merges in shallow clones”
  1. Matthieu MoyFeb 26, 2016
  2. Junio C HamanoFeb 26, 2016
  3. Matthieu MoyFeb 26, 2016
  4. Junio C HamanoFeb 26, 2016

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.