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

Re: Fwd: Git Directory Diff for submodule

From
GLGábor Lipták <gabor.liptak@gmail.com>
Date
Feb 10, 2014, 07:33 UTC
Message-ID
<CAN-m_UnSqTnLydyVF2TLxOia9vzmQr9e4+xWh8aVNBosfCq5nA@mail.gmail.com>
In-Reply-To
<52F54441.6090209@web.de>
Hi Jens,
So "git status" says:

liptak@liptak-kubuntu:~/Projects/MAIN_MODULE/platform/SUBMODULE [master]$ git status # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: xxxxxx.java # modified: xxxxxxx.java # ... # ... # ... # ... # ... # no changes added to commit (use "git add" and/or "git commit -a")

git config core.worktree gives back: "../../../../platform/SUBMODULE"

The submodule was inited simply with "git submodule init" + "git.submodule update"

MAINMODULE/.gitsubmodules file contains similar entry: [submodule "platform/SUBMODULE"] path = platform/SUBMODULE url = ssh://git@somehost/foo/bar.git

MAINMODULE/.git/config: [submodule "platform/SUBMODULE"] url = ssh://git@somehost/foo/bar.git

MAINMODULE/platform/SUBMODULE/.git: gitdir: ../../.git/modules/platform/SUBMODULE

MAINMODULE/.git/modules/platform/SUBMODULE/config: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true worktree = ../../../../platform/SUBMODULE [remote "origin"] url = ssh://git@somehost/foo/bar.git fetch = +refs/heads/*:refs/remotes/origin/*

So for me it seems that somehow the relative path inside MAINMODULE/.git/modules/platform/SUBMODULE/config gets configuread wrong during submodule init+update.

I tried to update the MAINMODULE/.git/modules/platform/SUBMODULE/config to contain ../../platform/SUBMODULE as worktree path, then meld was correctly started, but the compare tree was not usable. For file changes it displayed always: XXXXX.java: Dangling symlink. So this is still not a complete solution somehow.

Regards,
Gábor Lipták
2014-02-07 Jens Lehmann <Jens.Lehmann@web.de>:
Show 24 quoted lines
> Am 07.02.2014 10:15, schrieb Gábor Lipták:
>> I think I have found a bug related to submodules and directory diff.
>> See the details at hXXp://stackoverflow.com/q/21623155/337621.
>
> Let's inline the recipe one finds after decrypting this link:
>
> ~/Projects/MAINMODULE/platform/SUBMODULE [master]$ git difftool -tool=meld --dir-diff --cached
>   fatal: Could not switch to '../../../../platform/': No such file or directory
>   diff --raw --no-abbrev -z --cached: command returned error: 128
> ~/Projects/MAINMODULE/platform/SUBMODULE [master]$ cd ..
> ~/Projects/MAINMODULE/platform [master]$ cd ..
> ~/Projects/MAINMODULE [master]$ git difftool -tool=meld --dir-diff --cached
>   // NO PROBLEM, works.
> ~/Projects/MAINMODULE [master]$ git version
>   git version 1.8.4
>
>
>> If you need any further details, just ask.
>
> - Does this only happen when you use difftool? E.g. what does
>   "git status" inside the submodule say?
>
> - What does "git config core.worktree" print when run in the
>   submodule?
Previous: Jens LehmannNext: Jens Lehmann
Message 3 of 6 in “Fwd: Git Directory Diff for submodule”
  1. Gábor LiptákFeb 7, 2014
  2. Jens LehmannFeb 7, 2014
  3. Gábor LiptákFeb 10, 2014
  4. Jens LehmannFeb 20, 2014
  5. David AguilarFeb 20, 2014
  6. John KeepingFeb 21, 2014

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.