From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Andreas Krey <a.krey@gmx.de>, John Keeping <john@keeping.me.uk>,
Jeff King <peff@peff.net>, Richard Hansen <rhansen@bbn.com>,
Philip Oakley <philipoakley@iee.org>,
"Brian M. Carlson" <sandals@crustytoothpaste.net>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v4 2/7] pull: refactor $rebase variable into $mode
Date: Sat, 12 Oct 2013 02:02:00 -0500 [thread overview]
Message-ID: <1381561322-20059-6-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1381561322-20059-1-git-send-email-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
git-pull.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 8363647..f53d193 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -48,8 +48,7 @@ if test -z "$mode"
then
mode=$(git config pull.mode)
fi
-test "$mode" = 'rebase' && rebase="true"
-if test -z "$rebase"
+if test -z "$mode"
then
rebase=$(git config --bool branch.$curr_branch_short.rebase)
if test -z "$rebase"
@@ -58,6 +57,7 @@ then
fi
if test "$rebase" = 'true'
then
+ mode="rebase"
echo "The configurations pull.rebase and branch.<name>.rebase are deprecated."
echo "Please use pull.mode and branch.<name>.pullmode instead."
fi
@@ -125,10 +125,10 @@ do
merge_args="$merge_args$xx "
;;
-r|--r|--re|--reb|--reba|--rebas|--rebase)
- rebase=true
+ mode=rebase
;;
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
- rebase=false
+ mode=
;;
--recurse-submodules)
recurse_submodules=--recurse-submodules
@@ -171,7 +171,7 @@ error_on_no_merge_candidates () {
esac
done
- if test true = "$rebase"
+ if test "$mode" = rebase
then
op_type=rebase
op_prep=against
@@ -185,7 +185,7 @@ error_on_no_merge_candidates () {
remote=$(git config "branch.$curr_branch.remote")
if [ $# -gt 1 ]; then
- if [ "$rebase" = true ]; then
+ if [ "$mode" = rebase ]; then
printf "There is no candidate for rebasing against "
else
printf "There are no candidates for merging "
@@ -208,7 +208,7 @@ error_on_no_merge_candidates () {
exit 1
}
-test true = "$rebase" && {
+test "$mode" = rebase && {
if ! git rev-parse -q --verify HEAD >/dev/null
then
# On an unborn branch
@@ -273,7 +273,7 @@ case "$merge_head" in
then
die "$(gettext "Cannot merge multiple branches into empty head")"
fi
- if test true = "$rebase"
+ if test "$mode" = rebase
then
die "$(gettext "Cannot rebase onto multiple branches")"
fi
@@ -294,7 +294,7 @@ then
exit
fi
-if test true = "$rebase"
+if test "$mode" = rebase
then
o=$(git show-branch --merge-base $curr_branch $merge_head $oldremoteref)
if test "$oldremoteref" = "$o"
@@ -304,8 +304,8 @@ then
fi
merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
-case "$rebase" in
-true)
+case "$mode" in
+rebase)
eval="git-rebase $diffstat $strategy_args $merge_args $verbosity"
eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
;;
--
1.8.4-fc
next prev parent reply other threads:[~2013-10-12 7:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-12 7:01 [PATCH v4 4/7] pull: add merge-ff-only option Felipe Contreras
2013-10-12 7:01 ` [PATCH v4 0/7] Reject non-ff pulls by default Felipe Contreras
2013-10-12 7:01 ` [PATCH v4 3/7] pull: add --merge option Felipe Contreras
2013-10-12 7:01 ` [PATCH v4 5/7] pull: add warning on non-ff merges Felipe Contreras
2013-10-12 7:01 ` [PATCH v4 6/7] pull: cleanup documentation Felipe Contreras
2013-10-12 7:02 ` Felipe Contreras [this message]
2013-10-12 7:02 ` [PATCH v4 1/7] pull: rename pull.rename to pull.mode Felipe Contreras
2013-10-12 7:02 ` [PATCH v4 7/7] pull: add documentation about non-ff merges Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381561322-20059-6-git-send-email-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--cc=a.krey@gmx.de \
--cc=git@vger.kernel.org \
--cc=john@keeping.me.uk \
--cc=peff@peff.net \
--cc=philipoakley@iee.org \
--cc=rhansen@bbn.com \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).