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

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

From
Jens Lehmann <jens.lehmann@web.de>
Date
Dec 29, 2010, 00:05 UTC
Message-ID
<4D1A7B42.1050907@web.de>
In-Reply-To
<7vipydwp50.fsf@alter.siamese.dyndns.org>
Am 28.12.2010 22:42, schrieb Junio C Hamano:
Show 11 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 16 in “Re: git submodule -b ... of current HEAD fails”
  1. Re: git submodule -b ... of current HEAD failsJonathan Nieder, Dec 1, 2010
  2. Jens LehmannDec 2, 2010
  3. Mark LevedahlDec 3, 2010
  4. Ben JacksonDec 3, 2010
  5. Jonathan NiederDec 3, 2010
  6. git submodule: Remove now obsolete tests before cloning a repoJens Lehmann, Dec 4, 2010
  7. Junio C HamanoDec 7, 2010
  8. Jens LehmannDec 8, 2010
  9. git submodule -b ... of current HEAD failsJens Lehmann, Dec 8, 2010
  10. Jonathan NiederDec 8, 2010
  11. Junio C HamanoDec 28, 2010
  12. Jens LehmannDec 29, 2010
  13. Junio C HamanoDec 29, 2010
  14. Jens LehmannDec 29, 2010
  15. Re* [RFC/PATCH] Re: git submodule -b ... of current HEAD failsJunio C Hamano, Dec 29, 2010
  16. Jens LehmannDec 29, 2010

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.