Subject: Re: Auto update submodules after merge and reset

From: Marc Branchaud <[email-masked]>
Date: Wed, 14 Dec 2011 10:16:39 -0500

On 11-12-13 06:05 PM, Andreas T.Auer wrote:
> 
> On 13.12.2011 22:44 Jens Lehmann wrote:
>>
>>  If you follow a tip there won't be any new SHA-1s recorded during
>>  that following so you could not do a bisect and expect the submodule
>>  to be what the developer had when doing the commits, no?
> 
> If you never commit something to the superproject, you wouldn't get SHA1s
> recorded, that's right. But when you commit something to the superproject,
> why shouldn't the current submodule SHA1 be stored? Floating is about
> _ignoring_ the recorded SHA1 in _some_ cases, not about disabling the
> recording. So you can bisect to the bad superproject commit. If you suspect a
> bad submodule commit causing the problem then you could still bisect the
> submodule commits between the recorded SHA1s.

To me this question is one of the more problematic aspects of floating
submodules: When to commit submodule SHA1s.

Andreas suggests always committing them whenever a submodule's tip is moved.
 I don't think this is practical because commits end up with extra changes
that likely have nothing to do with the commit's topic.  This makes it
difficult to merge (or even cherry-pick) a commit elsewhere without also
picking up an unwanted submodule update.

Jens suggests never committing submodule SHA1s.  This makes it difficult to
restore the submodules to the state they were in when a super-repo commit was
made.  To me this is unacceptable -- if commits don't encompass the entire
state of the repo (including its submodules) then they're pretty much
useless.  Well, maybe commits themselves don't need to do that, but I sure
need some way to restore the entire state of the repo.

I'm not sure there's a good or easy answer here.  I suspect that it should
always be up to the user whether or not submodule changes are included in a
commit.  The way git currently works, that means that a floating checkout
would always have a modified status when in fact it isn't really dirty but
merely smudged.

Wish I could propose a solution, but all I have are questions!

		M.