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

Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Jun 3, 2009, 04:15 UTC
Message-ID
<200906030615.45791.markus.heidelberg@web.de>
In-Reply-To
<1243983552-24810-2-git-send-email-johan@herland.net>
Johan Herland, 03.06.2009:
Show 20 quoted lines
> The addition of "submodule.<name>.rebase" demonstrates the usefulness of
> alternatives to the default behaviour of "git submodule update". However,
> by naming the config variable "submodule.<name>.rebase", and making it a
> boolean choice, we are artificially constraining future git versions that
> may want to add _more_ alternatives than just "rebase".
> 
> Therefore, while "submodule.<name>.rebase" are not yet in a stable git
> release, future-proof it, by changing it from
> 
>   submodule.<name>.rebase = true/false
> 
> to
> 
>   submodule.<name>.update = checkout/rebase
> 
> where "checkout" specifies the default behaviour of "git submodule update"
> (checking out the new commit to a detached HEAD), and "rebase" specifies
> the --rebase behaviour (where the current local branch in the submodule is
> rebase onto the new commit). Thus .update == checkout is .rebase == false,
> and .update == rebase is equivalent to .rebase == false. Finally, leaving
                                                    ^^^^^
.rebase == true
Show 7 quoted lines
> diff --git a/git-submodule.sh b/git-submodule.sh
> @@ -400,9 +400,9 @@ cmd_update()
>  			die "Unable to find current revision in submodule path '$path'"
>  		fi
>  
> -		if test true = "$rebase"
> +		if ! test -z "$update"

Isn't this simpler: if test -n "$update" OTOH I think I have heard something about portability, but I'm not sure.

Show 10 quoted lines
> @@ -420,16 +420,18 @@ cmd_update()
>  				die "Unable to fetch in submodule path '$path'"
>  			fi
>  
> -			if test true = "$rebase_module"
> -			then
> -				command="git-rebase"
> +			case "$update_module" in
> +			rebase)
> +				command="git rebase"

I think it is common practice to use the dashed form in scripts and this patch shouldn't change it anyway.

Show 7 quoted lines
>  				action="rebase"
>  				msg="rebased onto"
> -			else
> -				command="git-checkout $force -q"
> +				;;
> +			*)
> +				command="git checkout $force -q"
ditto
Previous: Johan HerlandNext: Johan Herland
Message 8 of 11 in “What's cooking in git.git (May 2009, #04; Sun, 31)”
  1. Junio C HamanoJun 1, 2009
  2. Brandon CaseyJun 1, 2009
  3. 0/2 "git submodule update" enhancements (Was: What's cooking in git.git (May 2009, #04; Sun, 31))Johan Herland, Jun 2, 2009
  4. 1/2 Rename submodule.<name>.rebase to submodule.<name>.updateJohan Herland, Jun 2, 2009
  5. Peter HuttererJun 3, 2009
  6. Junio C HamanoJun 3, 2009
  7. Johan HerlandJun 3, 2009
  8. Markus HeidelbergJun 3, 2009
  9. Johan HerlandJun 3, 2009
  10. 1/2 Rename submodule.<name>.rebase to submodule.<name>.updateJohan Herland, Jun 3, 2009
  11. 2/2 git-submodule: add support for --merge.Johan Herland, Jun 2, 2009

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.