Skip to contentSkip to conversation

Problem with submodule merge

DISCUSSION Nicolas Morey-Chaisemartin 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

We have meet an issue few times at work with submodule merge.
I'm running git 1.7.7-rc1 build from master on FC15 x86_64 but I've seen the issue on other ditro with older (stable) versions

I still haven't figured out exactly when it happends but here are the symptoms:

1) I commited some updates for a submodule in our integration repo.
2) I pulled a remote branch of the integration repo which had an update on the same submodule (but different SHAs)
3) When the merge driver try to find a following commit for the submodule, I get some (sometimes many) error messages about refs that point to invalid objects:

[nmorey@sat:SigmaCToolchain (user/nmorey/dev/0.3.0 *%>)]$ git merge origin/prerelease/0.3-0
error: refs/heads/user/nmorey/master does not point to a valid object!
error: refs/remotes/origin/dev/cpp does not point to a valid object!
error: refs/remotes/origin/dev/scuk does not point to a valid object!
error: refs/remotes/origin/dev/sys_agents does not point to a valid object!
error: refs/remotes/origin/user/bbodin/cea does not point to a valid object!
error: refs/remotes/origin/user/borgogoz/master does not point to a valid object!
warning: Failed to merge submodule db (merge following commits not found) Auto-merging db
CONFLICT (submodule): Merge conflict in db
Automatic merge failed; fix conflicts and then commit the result.

I checked and the object really exists in the submodule but is in a pack.

Quoted 1 line

From checking the strace, git looks for a the object in db/.git/objects/... whch does not exists

And from what I could figure it, the issue seems to be coming from find_pack_entry which does not return 1 so git goes looking for loose object and cannot find any (as expected).
This is not a big issue as it just outputs errors about refs and does not block the user but it gets quite scary when there are a few hundreds of them !

I kept a tarball of the repo so I can provide more info/logs/trace if needed.

Nicolas

#1 lore raw

Hi,

this looks like you have hit a codepath where the submodules object database is not added to the object database. I am not sure why.

Could you try my patch that moves the merge search into a forked process:

3dcb369b allow multiple calls to submodule merge search for the same path

That should solve the issue as a side effect. Its currently in Junio's pu branch.

Cheers Heiko

Quoted 39 lines · Nicolas Morey-Chaisemartin

Hi,

We have meet an issue few times at work with submodule merge.
I'm running git 1.7.7-rc1 build from master on FC15 x86_64 but I've seen the issue on other ditro with older (stable) versions

I still haven't figured out exactly when it happends but here are the symptoms:

1) I commited some updates for a submodule in our integration repo.
2) I pulled a remote branch of the integration repo which had an update on the same submodule (but different SHAs)
3) When the merge driver try to find a following commit for the submodule, I get some (sometimes many) error messages about refs that point to invalid objects:

[nmorey@sat:SigmaCToolchain (user/nmorey/dev/0.3.0 *%>)]$ git merge origin/prerelease/0.3-0
error: refs/heads/user/nmorey/master does not point to a valid object!
error: refs/remotes/origin/dev/cpp does not point to a valid object!
error: refs/remotes/origin/dev/scuk does not point to a valid object!
error: refs/remotes/origin/dev/sys_agents does not point to a valid object!
error: refs/remotes/origin/user/bbodin/cea does not point to a valid object!
error: refs/remotes/origin/user/borgogoz/master does not point to a valid object!
warning: Failed to merge submodule db (merge following commits not found) Auto-merging db
CONFLICT (submodule): Merge conflict in db
Automatic merge failed; fix conflicts and then commit the result.

I checked and the object really exists in the submodule but is in a pack.

Quoted 1 line

From checking the strace, git looks for a the object in db/.git/objects/... whch does not exists

And from what I could figure it, the issue seems to be coming from find_pack_entry which does not return 1 so git goes looking for loose object and cannot find any (as expected).
This is not a big issue as it just outputs errors about refs and does not block the user but it gets quite scary when there are a few hundreds of them !

I kept a tarball of the repo so I can provide more info/logs/trace if needed.

Nicolas
--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi,

You're right, this fixes the issue:

$ git merge origin/prerelease/0.3-0
warning: Failed to merge submodule db (merge following commits not found)
Auto-merging db
CONFLICT (submodule): Merge conflict in db
Automatic merge failed; fix conflicts and then commit the result.

Thanks for the help

Nicolas

Quoted 54 lines · Heiko Voigt

Hi,

this looks like you have hit a codepath where the submodules object database is not added to the object database. I am not sure why.

Could you try my patch that moves the merge search into a forked process:

3dcb369b allow multiple calls to submodule merge search for the same path

That should solve the issue as a side effect. Its currently in Junio's pu branch.

Cheers Heiko

Quoted 39 lines · Nicolas Morey-Chaisemartin

Hi,

We have meet an issue few times at work with submodule merge.
I'm running git 1.7.7-rc1 build from master on FC15 x86_64 but I've seen the issue on other ditro with older (stable) versions

I still haven't figured out exactly when it happends but here are the symptoms:

1) I commited some updates for a submodule in our integration repo.
2) I pulled a remote branch of the integration repo which had an update on the same submodule (but different SHAs)
3) When the merge driver try to find a following commit for the submodule, I get some (sometimes many) error messages about refs that point to invalid objects:

[nmorey@sat:SigmaCToolchain (user/nmorey/dev/0.3.0 *%>)]$ git merge origin/prerelease/0.3-0
error: refs/heads/user/nmorey/master does not point to a valid object!
error: refs/remotes/origin/dev/cpp does not point to a valid object!
error: refs/remotes/origin/dev/scuk does not point to a valid object!
error: refs/remotes/origin/dev/sys_agents does not point to a valid object!
error: refs/remotes/origin/user/bbodin/cea does not point to a valid object!
error: refs/remotes/origin/user/borgogoz/master does not point to a valid object!
warning: Failed to merge submodule db (merge following commits not found) Auto-merging db
CONFLICT (submodule): Merge conflict in db
Automatic merge failed; fix conflicts and then commit the result.

I checked and the object really exists in the submodule but is in a pack.

Quoted 1 line

From checking the strace, git looks for a the object in db/.git/objects/... whch does not exists

And from what I could figure it, the issue seems to be coming from find_pack_entry which does not return 1 so git goes looking for loose object and cannot find any (as expected).
This is not a big issue as it just outputs errors about refs and does not block the user but it gets quite scary when there are a few hundreds of them !

I kept a tarball of the repo so I can provide more info/logs/trace if needed.

Nicolas
--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html