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

Re: Diffing submodule does not yield complete logs for merge commits

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
May 4, 2015, 15:05 UTC
Message-ID
<CAHd499B=EcgYiTMFt9VYhj45bRkP8h9TBk1B0cr8fYFuXNe_mQ@mail.gmail.com>
In-Reply-To
<20150501175757.GA10569@book.hvoigt.net>
On Fri, May 1, 2015 at 12:57 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
Show 44 quoted lines
> Hi,
>
> On Wed, Apr 29, 2015 at 03:53:11PM -0500, Robert Dailey wrote:
>> I am attempting to diff a submodule modified in my working copy and
>> the only difference is a merge commit. However, I do not get the
>> "full" range of commits introduced by the merge commit when I diff it:
>>
>> $ git diff --submodule=log Core
>> Submodule Core 8b4ec60..def2f3b:
>>   > Merge remote-tracking branch 'origin/master-ah3k'
>>
>> However if I go inside my submodule and run `git log` by hand, I get
>> more information about the TRUE commits introduced:
>>
>> $ git log --oneline 8b4ec60..def2f3b
>> def2f3b Merge remote-tracking branch 'origin/master-ah3k'
>> 015c961 Remove log spam in FontManager
>> 7713ba1 Update third party submodule to latest
>> 10aac78 Merge pull request #9 in FE/core from
>> feature/FE-1348-selecting-continue-on-zero-balance to master-ah3k
>> 287882f FE-1376 Nedd to remain in check detail screen when selecting
>> donation after SBI
>> a5a6bed Do not overwrite the current check# within loop
>> dfb8547 Adding list of checks to CRspChecks before saving
>> 1be280a FE-1354: Guest logged out in specific multiple check scenario
>> de06d5a [FE-1348] Fix PATT exit while checks still open
>>
>> It's almost as if the `git diff --submodule=log` approach is passing
>> in --first-parent to git log, which would exclude commits in the range
>> that I'm seeing when I run git log manually.
>
> That is exactly the case. In prepare_submodule_summary() that option is
> set before doing the revision walk.
>
>> Is this by design? Is there a way to enable the full log history with
>> `git diff` on a submodule?
>
> This stems from the first implementation for showing submodule diffs in
> commit 752c0c24. I guess this was done deliberately to limit the amount
> of output you get for a submodule. At the moment this is hardcoded but I
> think there is nothing wrong with adding another option to include the
> full log.
>
> Cheers Heiko
I will go ahead and work on this feature. Here is what I'd like to see:
1. `git diff --submodule` should have the ability to display full logs
vs current logs (i.e. without --first-parent)
2. `git submodule summary` should have an option to display full logs
or "first-parent" logs.

For #1, do you recommend adding a 3rd setting for `diff.submodule` config? Something like "full-log" or something? Or an entirely new config? I noticed that in diff.h, the DIFF_OPT flags already consume 31 bits. If this is a 32-bit flag, there is only 1 bit left. If we go with a 3rd setting for `diff.submodule` I think this might consume the last bit.

We could also make `git diff --submodule` default to the "full log" type, and if users want only first parent logs in submodule summary, they'd have to execute `git submodule summary` instead.

There are a few options. What do you recommend? Thanks.
Previous: Heiko VoigtNext: Jens Lehmann
Message 3 of 24 in “Diffing submodule does not yield complete logs for merge commits”
  1. Robert DaileyApr 29, 2015
  2. Heiko VoigtMay 1, 2015
  3. Robert DaileyMay 4, 2015
  4. Jens LehmannMay 4, 2015
  5. Robert DaileyMay 4, 2015
  6. Heiko VoigtMay 4, 2015
  7. Johannes SchindelinMay 5, 2015
  8. Robert DaileyMay 15, 2015
  9. Heiko VoigtMay 18, 2015
  10. Robert DaileyMay 18, 2015
  11. Heiko VoigtMay 19, 2015
  12. Robert DaileyMay 19, 2015
  13. Stefan BellerMay 19, 2015
  14. Roberto TyleyMay 22, 2015
  15. Heiko VoigtMay 21, 2015
  16. Robert DaileyMay 30, 2015
  17. Heiko VoigtMay 30, 2015
  18. Junio C HamanoMay 30, 2015
  19. Robert DaileyMay 30, 2015
  20. Robert DaileyMay 30, 2015
  21. Junio C HamanoMay 30, 2015
  22. Robert DaileyMay 30, 2015
  23. Heiko VoigtJun 2, 2015
  24. Junio C HamanoMay 4, 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.