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
Ben Jackson <ben@ben.com>
Date
Dec 3, 2010, 01:21 UTC
Message-ID
<20101203012155.GA30999@kronos.home.ben.com>
In-Reply-To
<4CF844E5.5010808@gmail.com>
On Thu, Dec 02, 2010 at 08:16:21PM -0500, Mark Levedahl wrote:
Show 26 quoted lines
> On 12/02/2010 04:11 PM, Jens Lehmann wrote:
> > Nope, these lines date back to the time before I got involved in the
> > submodule business ... Seems like this "git checkout" was added in
> > March 2008 by Mark Levedahl (CCed), maybe he can shed some light on
> > that.
> >
> > But to me your change looks good, so feel free to add:
> > Acked-by: Jens Lehmann<Jens.Lehmann@web.de>
> >
> >
> >> diff --git a/git-submodule.sh b/git-submodule.sh
> >> index 33bc41f..6242d7f 100755
> >> --- a/git-submodule.sh
> >> +++ b/git-submodule.sh
> >> @@ -241,7 +241,7 @@ cmd_add()
> >>   			# ash fails to wordsplit ${branch:+-b "$branch"...}
> >>   			case "$branch" in
> >>   			'') git checkout -f -q ;;
> >> -			?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
> >> +			?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
> >>   			esac
> >>   		) || die "Unable to checkout submodule '$path'"
> >>   	fi
> >>
> These lines were actually added by Ben Jackson in commit ea10b60c91 in 
> 2009, long after I last touched that module.

I didn't mean to change any functionality -- I just wanted to fix a portability problem (/bin/sh is ash on FreeBSD, hence the comment at the top of the context). Looks like `checkout -B' (capital B) didn't even exist at that time. Seems reasonable, though.

-- 
Ben Jackson AD7GD
<ben@ben.com>
http://www.ben.com/
Previous: Mark LevedahlNext: Jonathan Nieder
Message 4 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.