From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Git mailing list <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v5 0/3] rebase: give precise error messages
Date: Sat, 16 Dec 2017 14:33:16 +0530 [thread overview]
Message-ID: <20171216090319.11902-1-kaartic.sivaraam@gmail.com> (raw)
In-Reply-To: <20171127172104.5796-1-kaartic.sivaraam@gmail.com>
The tip of the v4 of this patch can be found at [1]. It was a revamp
sent by Junio mostly touching [PATCH v2 1/3] of the series. I've updated
it a little to add in something of my taste ;-)
There's only one concern that still bothers me a little. With the current
code you would see the following,
$ git rebase origin/maint 3013dff86
Current branch 3013dff86 is up to date.
That doesn't look good, does it? How about we overcome the issue of
handling this case and the HEAD case done in 3/3 by simplifying the
message as shown in the following diff,
diff --git a/git-rebase.sh b/git-rebase.sh
index 0f379ba2b..4d5400034 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -601,11 +601,11 @@ then
test -z "$switch_to" ||
GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $switch_to" \
git checkout -q "$switch_to" --
- say "$(eval_gettext "Current branch \$branch_name is up to date.")"
+ say "$(eval_gettext "\$branch_name is up to date.")"
finish_rebase
exit 0
else
- say "$(eval_gettext "Current branch \$branch_name is up to date, rebase forced.")"
+ say "$(eval_gettext "\$branch_name is up to date, rebase forced.")"
fi
fi
I guess this one is much better than 3/3 of this series as it handles
any kind of case by making no assumptions.
Thoughts ??
Note: In case you're wondering where's v3 of this series, there wasn't
a v3 series but there was a v3 PATCH of 3/3 [2].
References:
[1]: <xmqq1sjxt3tz.fsf@gitster.mtv.corp.google.com>
[2]: <20171201060935.19749-1-kaartic.sivaraam@gmail.com>
Here's the interdiff between v4 and v5,
diff --git a/git-rebase.sh b/git-rebase.sh
index f3dd86443..fd72a35c6 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -518,7 +518,7 @@ case "$onto_name" in
esac
# If the branch to rebase is given, that is the branch we will rebase
-# $branch_name -- branch being rebased, or HEAD (already detached)
+# $branch_name -- branch/commit being rebased, or HEAD (already detached)
# $orig_head -- commit object name of tip of the branch before rebasing
# $head_name -- refs/heads/<that-branch> or "detached HEAD"
switch_to=
@@ -602,7 +602,7 @@ then
GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $switch_to" \
git checkout -q "$switch_to" --
if test "$branch_name" = "HEAD" &&
- !(git symbolic-ref -q HEAD)
+ ! git symbolic-ref -q HEAD
then
say "$(eval_gettext "HEAD is up to date.")"
else
@@ -612,7 +612,7 @@ then
exit 0
else
if test "$branch_name" = "HEAD" &&
- !(git symbolic-ref -q HEAD)
+ ! git symbolic-ref -q HEAD
then
say "$(eval_gettext "HEAD is up to date, rebase forced.")"
else
Kaartic Sivaraam (3):
rebase: consistently use branch_name variable
rebase: distinguish user input by quoting it
rebase: rebasing can also be done when HEAD is detached
git-rebase.sh | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
--
2.15.0.531.g2ccb3012c
next prev parent reply other threads:[~2017-12-16 9:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 15:25 [PATCH] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam
2017-11-22 2:13 ` Junio C Hamano
2017-11-27 17:21 ` [PATCH v2 0/3] rebase: give precise error message Kaartic Sivaraam
2017-11-27 17:21 ` [PATCH v2 1/3] rebase: use a more appropriate variable name Kaartic Sivaraam
2017-11-27 17:21 ` [PATCH v2 2/3] rebase: distinguish user input by quoting it Kaartic Sivaraam
2017-11-27 17:21 ` [PATCH v2 3/3] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam
2017-11-28 2:31 ` Junio C Hamano
2017-11-28 16:15 ` Kaartic Sivaraam
2017-12-01 6:09 ` [PATCH v3 " Kaartic Sivaraam
2017-11-28 2:25 ` [PATCH v2 0/3] rebase: give precise error message Junio C Hamano
2017-11-28 14:04 ` Kaartic Sivaraam
2017-11-29 0:10 ` Junio C Hamano
2017-11-29 3:11 ` Kaartic Sivaraam
2017-11-29 6:47 ` Junio C Hamano
2017-12-16 9:03 ` Kaartic Sivaraam [this message]
2017-12-16 9:03 ` [PATCH v5 1/3] rebase: consistently use branch_name variable Kaartic Sivaraam
2017-12-16 9:03 ` [PATCH v5 2/3] rebase: distinguish user input by quoting it Kaartic Sivaraam
2017-12-16 9:03 ` [PATCH v5 3/3] rebase: rebasing can also be done when HEAD is detached Kaartic Sivaraam
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171216090319.11902-1-kaartic.sivaraam@gmail.com \
--to=kaartic.sivaraam@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
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 NNTP newsgroup(s).