On Sun, Mar 26, 2017 at 03:02:38AM -0400, Mike Lewis wrote:
> Allows the user to verify and/or change the contents of the merge
> before committing as necessary
>
> Signed-off-by: Mike Lewis <[email protected]>
> ---
> contrib/subtree/git-subtree.sh | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index dec085a23..c30087485 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -29,6 +29,8 @@ onto= try connecting new tree to an existing one
> rejoin merge the new branch back into HEAD
> options for 'add', 'merge', and 'pull'
> squash merge subtree changes as a single commit
> + options for 'merge' and 'pull'
> +no-commit perform the merge, but don't commit
> "
> eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit
> $?)"
>
> @@ -48,6 +50,7 @@ annotate=
> squash=
> message=
> prefix=
> +commit_option="--commit"
It might be simpler to default commit_option= empty like the others, and
remove the "" double quotes around "$commit_option" indicated below so
that the shell ignores it when it's empty.
>
> debug () {
> if test -n "$debug"
> @@ -137,6 +140,12 @@ do
> --no-squash)
> squash=
> ;;
> + --no-commit)
> + commit_option="--no-commit"
> + ;;
> + --no-no-commit)
> + commit_option="--commit"
> + ;;
"--no-no-commit" should just be "--commit" instead.
The real flag is called "--commit" (git help merge), so subtree
should follow suite by supporting "--commit" and "--no-commit" only.
> @@ -815,17 +824,17 @@ cmd_merge () {
> then
> if test -n "$message"
> then
> - git merge -s subtree --message="$message" "$rev"
> + git merge -s subtree --message="$message"
> "$commit_option" "$rev"
^
^
> else
> - git merge -s subtree "$rev"
> + git merge -s subtree "$commit_option" "$rev"
^ ^
> fi
> [...]
--
David