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

Re: Can't understand the behaviour of git-diff --submodule

From
FMFrancis Moreau <francis.moro@gmail.com>
Date
Oct 28, 2012, 08:26 UTC
Message-ID
<CAC9WiBim80NgUnjeRMRw9vKQD62TFJ_pxWjO6hzHW4nxcPZ67g@mail.gmail.com>
In-Reply-To
<508C6823.5060800@web.de>
On Sun, Oct 28, 2012 at 1:02 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
Show 19 quoted lines
> Am 26.10.2012 22:43, schrieb Francis Moreau:
>> On Fri, Oct 26, 2012 at 10:05 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>> [...]
>>>
>>> That is weird, "git diff --submodule" should show that too. Is there
>>> anything unusual about your setup? (The only explanation I can come
>>> up with after checking the code is that your submodule has neither a
>>> .git directory nor a gitfile or the objects directory in there doesn't
>>> contain these commits)
>>
>> Oh now you're asking, I think the submodule has been added by using
>> the --reference option of git-submodule-add.
>>
>>   $ cd configs
>>   $ cat .git
>>   gitdir: ../.git/modules/configs
>
> Thanks, I suspect the --reference option makes the difference here,
> I'll check that as soon as I find some time.
Yes that's fairly easy to reproduce:
$ mkdir super
$ cd super
$ git init
$ git submodule add --reference ~/tmp/git-submodule/public/a.git
~/tmp/git-submodule/public/a.git a
$ git commit -m "Initial creation of super project"
$ cd a
$ date >a.txt
$ git commit -a -m "add to a.txt a random change"
$ cd ..
$ git submodule summary
* a 2f8803a...a1aa4bf (1):
  > add to a.txt a random change
$ git commit -a -m "Include a's changes in super project"
$ git diff --submodule=log HEAD~1 HEAD
Submodule a 2f8803a...a1aa4bf (commits not present)
Thanks
-- 
Francis
Previous: Jens LehmannNext: Jens Lehmann
Message 7 of 9 in “Can't understand the behaviour of git-diff --submodule”
  1. Francis MoreauOct 26, 2012
  2. Jens LehmannOct 26, 2012
  3. Francis MoreauOct 26, 2012
  4. Jens LehmannOct 26, 2012
  5. Francis MoreauOct 26, 2012
  6. Jens LehmannOct 27, 2012
  7. Francis MoreauOct 28, 2012
  8. Jens LehmannOct 30, 2012
  9. Francis MoreauOct 31, 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.