Subject: Re: [RFC/PATCH] Re: git submodule -b ... of current HEAD fails

From: Jens Lehmann <[email-masked]>
Date: Wed, 29 Dec 2010 01:05:22 +0100

Am 28.12.2010 22:42, schrieb Junio C Hamano:
> Jonathan Nieder <[email-masked]> writes:
> 
>> 	git submodule add -b $branch $repository
>>
>> fails when HEAD already points to $branch in $repository.
> 
> I was reviewing the overall picture before tagging 1.7.4-rc0 and started
> wondering if this was a good change.  If repository already had branch
> checked out, and if it was pointing at a commit that was different from
> whatever was taken from origin, shouldn't the command _fail_ to prevent
> the divergent commits from getting lost?

But doesn't this change only affect the case where the submodule is
freshly cloned, so there is no chance of losing local changes?

(But AFAIK the patch doesn't really fix the issue, please see [1] and
Jonathan's followup)

[1] http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/772659/focus=163242