* submodules workflow aches
@ 2008-05-19 14:56 Nigel Magnay
2008-05-19 18:11 ` Chris Shoemaker
0 siblings, 1 reply; 3+ messages in thread
From: Nigel Magnay @ 2008-05-19 14:56 UTC (permalink / raw)
To: git
We've been using submodule support for a few months (and I've been
checking out the list to see what other people are doing); it works
well, but there's a couple of ache points (in the sense that if I'm to
convince SVN users to migrate, they're liable to point and laugh).
The first nuisance is the 'get me up to date' stanza of 'git pull &&
git submodule update' always leaving you on (no branch), even if you
were on [master] before, and the head commit now is also equal to
[master]. Having to remember to go into several submodules and do 'git
checkout master' to get you back to ready-to-do-work mode isn't nice
(and is worse if you're on autopilot, and someone has committed a
submodule on a different branch
The second nuisance is around conflicts in submodules. If I make a
(non-conflicting) change to a submodule, merge with the head and
commit, then when I do a 'git pull' in the superproject readiness to
do a push, I get a conflict. This is presumably because it doesn't
know that the submodule change is a fast-forward. It'd be nice if it
could figure that out, and not conflict?
Are people writing their own wrapper scripts for this? I find I have a
hard time explaining why it's all necessary to svn users who just (by
and large) do 'svn up' and 'svn ci' on projects..
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: submodules workflow aches
2008-05-19 14:56 submodules workflow aches Nigel Magnay
@ 2008-05-19 18:11 ` Chris Shoemaker
2008-05-19 18:55 ` Nigel Magnay
0 siblings, 1 reply; 3+ messages in thread
From: Chris Shoemaker @ 2008-05-19 18:11 UTC (permalink / raw)
To: Nigel Magnay; +Cc: git
On Mon, May 19, 2008 at 03:56:49PM +0100, Nigel Magnay wrote:
> We've been using submodule support for a few months (and I've been
> checking out the list to see what other people are doing); it works
> well, but there's a couple of ache points (in the sense that if I'm to
> convince SVN users to migrate, they're liable to point and laugh).
>
> The first nuisance is the 'get me up to date' stanza of 'git pull &&
> git submodule update' always leaving you on (no branch), even if you
> were on [master] before, and the head commit now is also equal to
> [master]. Having to remember to go into several submodules and do 'git
> checkout master' to get you back to ready-to-do-work mode isn't nice
> (and is worse if you're on autopilot, and someone has committed a
> submodule on a different branch
It might help if you describe more completely how you expect it to behave
under a wide variety of conditions. I suspect that the current behavior
is the simplest behavior that remains correct under all conditions.
> The second nuisance is around conflicts in submodules. If I make a
> (non-conflicting) change to a submodule, merge with the head and
> commit, then when I do a 'git pull' in the superproject readiness to
> do a push, I get a conflict. This is presumably because it doesn't
> know that the submodule change is a fast-forward. It'd be nice if it
> could figure that out, and not conflict?
If I follow the scenario correctly, you're essentially pulling into a
dirty working tree. I guess you're saying that if the submodule
wasn't touched by the merge, you'd like it to leave your working tree
dirty?
> Are people writing their own wrapper scripts for this? I find I have a
> hard time explaining why it's all necessary to svn users who just (by
> and large) do 'svn up' and 'svn ci' on projects..
I'll throw out one nuisance that I hit, perhaps related to your second
one: in the super-module, rebasing a series containing a submodule
update. I start the rebase with a clean working tree, but since the
rebase doesn't update the submodule, (which I wouldn't really want it
to do anyway) the rebase aborts in the middle with:
$ git rebase --continue
plugin/submodule: needs update
Working tree is dirty
forcing me to "git submodule update" in order to continue.
Then, when the rebase finishes, my working tree is dirty again because
the submodule is out-of-date, so I have to "submodule update" AGAIN.
Am I just missing the much better way to do this?
-chris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: submodules workflow aches
2008-05-19 18:11 ` Chris Shoemaker
@ 2008-05-19 18:55 ` Nigel Magnay
0 siblings, 0 replies; 3+ messages in thread
From: Nigel Magnay @ 2008-05-19 18:55 UTC (permalink / raw)
To: Chris Shoemaker; +Cc: git
>> We've been using submodule support for a few months (and I've been
>> checking out the list to see what other people are doing); it works
>> well, but there's a couple of ache points (in the sense that if I'm to
>> convince SVN users to migrate, they're liable to point and laugh).
>>
>> The first nuisance is the 'get me up to date' stanza of 'git pull &&
>> git submodule update' always leaving you on (no branch), even if you
>> were on [master] before, and the head commit now is also equal to
>> [master]. Having to remember to go into several submodules and do 'git
>> checkout master' to get you back to ready-to-do-work mode isn't nice
>> (and is worse if you're on autopilot, and someone has committed a
>> submodule on a different branch
>
> It might help if you describe more completely how you expect it to behave
> under a wide variety of conditions. I suspect that the current behavior
> is the simplest behavior that remains correct under all conditions.
>
Oh, I agree. git is actually much more powerful, but it (currently)
requires a lot more faffing for common usecases (unless of course I've
missed some new features, which is entirely possible).
Coming from the svn world, with a project containing many
svn:externals, a 'bring everything up to date, ready to continue work'
is just a case of 'svn up'. In the git equivalent, it seems to be
git pull && git submodule update
(for-each-submodule-that-changed) cd submodule && git checkout master
If module A was on branch [x] before submodule update, and after
update sha1(HEAD)==sha1([x]), couldn't it return the module to being
on branch [x] ?
>> The second nuisance is around conflicts in submodules. If I make a
>> (non-conflicting) change to a submodule, merge with the head and
>> commit, then when I do a 'git pull' in the superproject readiness to
>> do a push, I get a conflict. This is presumably because it doesn't
>> know that the submodule change is a fast-forward. It'd be nice if it
>> could figure that out, and not conflict?
>
> If I follow the scenario correctly, you're essentially pulling into a
> dirty working tree. I guess you're saying that if the submodule
> wasn't touched by the merge, you'd like it to leave your working tree
> dirty?
>
I find this kinda stuff hard to describe :-)
Superproject SP, Modules M1 and M2
origin:
SP = sha1-x
m1 = sha1-y
m2 = sha1-z
User1 and User2 both have SP checked out@sha1-x.
User1 makes a change in M1, commits and updates origin (push) M1 and then SP.
origin:
SP = sha1-xx
m1 = sha1-yy
m2 = sha1=z
User2 makes a change in M1 that doesn't conflict with U1. commits and
updates origin M1 (needs to pull then push to automatically merge),
producing sha1-yyy.
When trying to commit SP, push fails. pull then produces a conflict -
SP[sha1-xx] says m1=sha1-yy, and local WC m1=sha1-yyy.
But - sha1-yyy is a fast-forward from sha1-yy, so it should be
automatically mergeable. Maybe. Either way it's a pain - most people
seem to just ignore it and 'git add' each submodule and force the
commit anyway. But it basically happens virtually every commit (unless
you were the last person to do the SP commit and so it's not a merge),
which is annoying especially since I'm asking svn users to replace a
'svn up && svn ci' with an equivalent in the module /and/ the
superproject /and/ to merge a (to the user irrelevant) conflict.
>> Are people writing their own wrapper scripts for this? I find I have a
>> hard time explaining why it's all necessary to svn users who just (by
>> and large) do 'svn up' and 'svn ci' on projects..
>
> I'll throw out one nuisance that I hit, perhaps related to your second
> one: in the super-module, rebasing a series containing a submodule
> update. I start the rebase with a clean working tree, but since the
> rebase doesn't update the submodule, (which I wouldn't really want it
> to do anyway) the rebase aborts in the middle with:
>
> $ git rebase --continue
> plugin/submodule: needs update
> Working tree is dirty
>
> forcing me to "git submodule update" in order to continue.
>
> Then, when the rebase finishes, my working tree is dirty again because
> the submodule is out-of-date, so I have to "submodule update" AGAIN.
>
> Am I just missing the much better way to do this?
>
> -chris
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-19 18:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-19 14:56 submodules workflow aches Nigel Magnay
2008-05-19 18:11 ` Chris Shoemaker
2008-05-19 18:55 ` Nigel Magnay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).