subtree: use git-sh-setup's say
subtree currently defines its own `say` implementation, rather than using git-sh-setups's implementation. Change that, don't re-invent the wheel. Signed-off-by: Luke Shumaker <lukeshu@datawire.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f664304836
commit
6d43585a68
@ -30,7 +30,6 @@ squash merge subtree changes as a single commit
|
|||||||
|
|
||||||
PATH=$PATH:$(git --exec-path)
|
PATH=$PATH:$(git --exec-path)
|
||||||
|
|
||||||
quiet=
|
|
||||||
branch=
|
branch=
|
||||||
debug=
|
debug=
|
||||||
command=
|
command=
|
||||||
@ -49,15 +48,8 @@ debug () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
say () {
|
|
||||||
if test -z "$quiet"
|
|
||||||
then
|
|
||||||
printf "%s\n" "$*" >&2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
progress () {
|
progress () {
|
||||||
if test -z "$quiet"
|
if test -z "$GIT_QUIET"
|
||||||
then
|
then
|
||||||
printf "%s\r" "$*" >&2
|
printf "%s\r" "$*" >&2
|
||||||
fi
|
fi
|
||||||
@ -93,7 +85,7 @@ main () {
|
|||||||
|
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
-q)
|
-q)
|
||||||
quiet=1
|
GIT_QUIET=1
|
||||||
;;
|
;;
|
||||||
-d)
|
-d)
|
||||||
debug=1
|
debug=1
|
||||||
@ -201,7 +193,7 @@ main () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
debug "command: {$command}"
|
debug "command: {$command}"
|
||||||
debug "quiet: {$quiet}"
|
debug "quiet: {$GIT_QUIET}"
|
||||||
debug "revs: {$revs}"
|
debug "revs: {$revs}"
|
||||||
debug "dir: {$dir}"
|
debug "dir: {$dir}"
|
||||||
debug "opts: {$*}"
|
debug "opts: {$*}"
|
||||||
@ -698,7 +690,7 @@ cmd_add () {
|
|||||||
|
|
||||||
cmd_add_repository "$@"
|
cmd_add_repository "$@"
|
||||||
else
|
else
|
||||||
say "error: parameters were '$@'"
|
say >&2 "error: parameters were '$@'"
|
||||||
die "Provide either a commit or a repository and commit."
|
die "Provide either a commit or a repository and commit."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -742,7 +734,7 @@ cmd_add_commit () {
|
|||||||
fi
|
fi
|
||||||
git reset "$commit" || exit $?
|
git reset "$commit" || exit $?
|
||||||
|
|
||||||
say "Added dir '$dir'"
|
say >&2 "Added dir '$dir'"
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_split () {
|
cmd_split () {
|
||||||
@ -807,7 +799,7 @@ cmd_split () {
|
|||||||
fi
|
fi
|
||||||
git update-ref -m 'subtree split' \
|
git update-ref -m 'subtree split' \
|
||||||
"refs/heads/$branch" "$latest_new" || exit $?
|
"refs/heads/$branch" "$latest_new" || exit $?
|
||||||
say "$action branch '$branch'"
|
say >&2 "$action branch '$branch'"
|
||||||
fi
|
fi
|
||||||
echo "$latest_new"
|
echo "$latest_new"
|
||||||
exit 0
|
exit 0
|
||||||
@ -830,7 +822,7 @@ cmd_merge () {
|
|||||||
sub=$2
|
sub=$2
|
||||||
if test "$sub" = "$rev"
|
if test "$sub" = "$rev"
|
||||||
then
|
then
|
||||||
say "Subtree is already at commit $rev."
|
say >&2 "Subtree is already at commit $rev."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
new=$(new_squash_commit "$old" "$sub" "$rev") || exit $?
|
new=$(new_squash_commit "$old" "$sub" "$rev") || exit $?
|
||||||
|
Reference in New Issue
Block a user