From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Johannes Sixt <j.sixt@viscovery.net>,
Christian Couder <chriscool@tuxfamily.org>,
Thomas Rast <trast@student.ethz.ch>
Subject: Re: [PATCH v2 00/31] refactor rebase
Date: Sun, 13 Feb 2011 20:54:55 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.00.1102132047500.4253@debian> (raw)
In-Reply-To: <alpine.DEB.2.00.1102111811300.26684@debian>
On Fri, 11 Feb 2011, Martin von Zweigbergk wrote:
> On Thu, 10 Feb 2011, Junio C Hamano wrote:
>
> > I am not sure if forbidding "-v --continue" adds any value; would it be
> > too much effort to allow "--continue -v" instead to achieve the same
> > degree of consistency between the two?
>
> I'll have a look at it when
> I get some time.
This would apply on top of mz/rebase after dropping 95135b0 (rebase:
stricter check of standalone sub command, 2011-02-06). If you agree
with it, I will include it in a future re-roll.
-- 8< --
Subject: [PATCH/RFC] rebase: allow options to be overridden when resuming
The sub commands '--continue', '--skip' or '--abort' may only be used
standalone according to the documentation. Other options following the
sub command are currently not accepted, but options preceeding them
are. For example, 'git rebase --continue -v' is not accepted, while
'git rebase -v --continue' is. In the latter case, the verbose option
will only be used until the rebase is interrupted (e.g. for editing,
or due to conflict). From that point on, the intial settings will be
used again.
Improve the situation by allowing options to be combined with sub
commands both before and after the sub command itself. Persist the new
value to make sure it is remembered across interruptions.
Fail if options that can not be used together with sub commands, such
as '-i', are used. For simplicity, allow the same set of options for
all three sub commands, even though e.g. '-s' makes no sense when
combined with '--abort'.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---
Documentation/git-rebase.txt | 2 +-
git-rebase.sh | 51 ++++++++++++++++++++++++++++++++----------
t/t3418-rebase-continue.sh | 12 ++++++++++
3 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 96680c8..095a67f 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -13,7 +13,7 @@ SYNOPSIS
'git rebase' [-i | --interactive] [options] --onto <newbase>
--root [<branch>]
-'git rebase' --continue | --skip | --abort
+'git rebase' --continue | --skip | --abort [options]
DESCRIPTION
-----------
diff --git a/git-rebase.sh b/git-rebase.sh
index 34a2a0a..5abfeac 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -67,6 +67,16 @@ preserve_merges=
autosquash=
test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t
+write_options() {
+ echo "$GIT_QUIET" > "$state_dir"/quiet &&
+ test t = "$verbose" && : > "$state_dir"/verbose
+ test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy
+ test -n "$strategy_opts" && echo "$strategy_opts" > \
+ "$state_dir"/strategy_opts
+ test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \
+ "$state_dir"/allow_rerere_autoupdate
+}
+
read_basic_state () {
head_name=$(cat "$state_dir"/head-name) &&
onto=$(cat "$state_dir"/onto) &&
@@ -78,9 +88,21 @@ read_basic_state () {
orig_head=$(cat "$state_dir"/orig-head)
else
orig_head=$(cat "$state_dir"/head)
- fi &&
- GIT_QUIET=$(cat "$state_dir"/quiet) &&
- test -f "$state_dir"/verbose && verbose=t
+ fi
+ # First write any overriding options from the command line
+ write_options
+ if test -n "$GIT_QUIET"
+ then
+ rm "$state_dir"/verbose
+ else
+ GIT_QUIET=$(cat "$state_dir"/quiet)
+ fi
+ if test t = "$verbose"
+ then
+ rm "$state_dir"/quiet
+ else
+ test -f "$state_dir"/verbose && verbose=t
+ fi
test -f "$state_dir"/strategy && strategy="$(cat "$state_dir"/strategy)"
test -f "$state_dir"/strategy_opts &&
strategy_opts="$(cat "$state_dir"/strategy_opts)"
@@ -92,13 +114,7 @@ write_basic_state () {
echo "$head_name" > "$state_dir"/head-name &&
echo "$onto" > "$state_dir"/onto &&
echo "$orig_head" > "$state_dir"/orig-head &&
- echo "$GIT_QUIET" > "$state_dir"/quiet &&
- test t = "$verbose" && : > "$state_dir"/verbose
- test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy
- test -n "$strategy_opts" && echo "$strategy_opts" > \
- "$state_dir"/strategy_opts
- test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \
- "$state_dir"/allow_rerere_autoupdate
+ write_options
}
output () {
@@ -164,6 +180,7 @@ then
fi
test -n "$type" && in_progress=t
+resume_incompatible=
while test $# != 0
do
case "$1" in
@@ -174,11 +191,11 @@ do
ok_to_skip_pre_rebase=
;;
--continue|--skip|--abort)
+ test -n "$action" && usage
action=${1##--}
- shift
- break
;;
--onto)
+ resume_incompatible=t
test 2 -le "$#" || usage
onto="$2"
shift
@@ -197,6 +214,7 @@ do
autosquash=
;;
-M|-m|--m|--me|--mer|--merg|--merge)
+ resume_incompatible=t
do_merge=t
;;
-X*|--strategy-option*)
@@ -232,9 +250,11 @@ do
do_merge=t
;;
-n|--no-stat)
+ resume_incompatible=t
diffstat=
;;
--stat)
+ resume_incompatible=t
diffstat=t
;;
-v|--verbose)
@@ -249,6 +269,7 @@ do
diffstat=
;;
--whitespace=*)
+ resume_incompatible=t
git_am_opt="$git_am_opt $1"
case "$1" in
--whitespace=fix|--whitespace=strip)
@@ -257,19 +278,24 @@ do
esac
;;
--ignore-whitespace)
+ resume_incompatible=t
git_am_opt="$git_am_opt $1"
;;
--committer-date-is-author-date|--ignore-date)
+ resume_incompatible=t
git_am_opt="$git_am_opt $1"
force_rebase=t
;;
-C*)
+ resume_incompatible=t
git_am_opt="$git_am_opt $1"
;;
--root)
+ resume_incompatible=t
rebase_root=t
;;
-f|--f|--fo|--for|--forc|--force|--force-r|--force-re|--force-reb|--force-reba|--force-rebas|--force-rebase|--no-ff)
+ resume_incompatible=t
force_rebase=t
;;
--rerere-autoupdate|--no-rerere-autoupdate)
@@ -288,6 +314,7 @@ test $# -gt 2 && usage
if test -n "$action"
then
+ test -n "$resume_incompatible" && "--$action used with incompatible option"
test -z "$in_progress" && die "No rebase in progress?"
# Only interactive rebase uses detailed reflog messages
if test "$type" = interactive && test "$GIT_REFLOG_ACTION" = rebase
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 15cef3c..1581f00 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -90,4 +90,16 @@ test_expect_success 'rebase --continue remembers --rerere-autoupdate' '
git rebase --continue
'
+test_expect_success 'rebase --continue --no-rerere-autoupdate overrides' '
+ rm -fr .git/rebase-* &&
+ git reset --hard topic@{1} &&
+ test_must_fail git rebase -m --rerere-autoupdate master &&
+ test "$(cat F2)" = "Resolved" &&
+ git rebase --continue --no-rerere-autoupdate &&
+ test "$(cat F3)" = "Resolved" &&
+ test_must_fail git rebase --continue &&
+ git add F3 &&
+ git rebase --continue
+'
+
test_done
--
1.7.4.rc2.33.g8a14f
next prev parent reply other threads:[~2011-02-14 1:55 UTC|newest]
Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-28 9:30 [PATCH 00/31] Refactor rebase Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 01/31] rebase: clearer names for directory variables Martin von Zweigbergk
2010-12-28 23:08 ` Junio C Hamano
2010-12-28 20:53 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 02/31] rebase: refactor reading of state Martin von Zweigbergk
2010-12-28 23:08 ` Junio C Hamano
2010-12-29 8:09 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 03/31] rebase: read state outside loop Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 04/31] rebase: remove unused rebase state 'prev_head' Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 05/31] rebase: improve detection of rebase in progress Martin von Zweigbergk
2010-12-28 23:08 ` Junio C Hamano
2010-12-28 20:35 ` Martin von Zweigbergk
2011-01-12 10:20 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 06/31] rebase: act on command line outside parsing loop Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 07/31] rebase: stricter check of standalone sub command Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 08/31] rebase: align variable names Martin von Zweigbergk
2011-01-04 19:12 ` Thomas Rast
2011-01-05 2:25 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 09/31] rebase: align variable content Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 10/31] rebase: factor out command line option processing Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 11/31] rebase -i: remove now unnecessary directory checks Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 12/31] rebase: reorder validation steps Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 13/31] rebase: factor out reference parsing Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 14/31] rebase: factor out clean work tree check Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 15/31] rebase: factor out call to pre-rebase hook Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 16/31] rebase -i: support --stat Martin von Zweigbergk
2010-12-28 17:59 ` Johannes Schindelin
2010-12-28 13:24 ` Martin von Zweigbergk
2010-12-28 23:36 ` Junio C Hamano
2010-12-28 23:44 ` Johannes Schindelin
2010-12-28 9:30 ` [PATCH 17/31] rebase: remove $branch as synonym for $orig_head Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 18/31] rebase: extract merge code to new source file Martin von Zweigbergk
2010-12-29 21:31 ` Johannes Sixt
2010-12-29 22:24 ` Martin von Zweigbergk
2010-12-31 12:23 ` Thomas Rast
2010-12-31 14:05 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 19/31] rebase: extract am " Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 20/31] rebase: show consistent conflict resolution hint Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 21/31] rebase -i: align variable names Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 22/31] rebase: make -v a tiny bit more verbose Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 23/31] rebase: factor out sub command handling Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 24/31] rebase: extract code for writing basic state Martin von Zweigbergk
2011-01-04 19:19 ` Thomas Rast
2011-01-05 2:40 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 25/31] rebase: remember verbose option Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 26/31] rebase: remember strategy and strategy options Martin von Zweigbergk
2011-01-04 19:27 ` Thomas Rast
2011-01-05 3:33 ` Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 27/31] rebase -m: remember allow_rerere_autoupdate option Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 28/31] rebase -m: don't print exit code 2 when merge fails Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 29/31] git-rebase--am: remove unnecessary --3way option Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 30/31] rebase -i: don't read unused variable preserve_merges Martin von Zweigbergk
2010-12-28 9:30 ` [PATCH 31/31] rebase -i: remove unnecessary state rebase-root Martin von Zweigbergk
2010-12-28 16:40 ` Thomas Rast
2010-12-29 22:31 ` Martin von Zweigbergk
2010-12-31 5:41 ` Christian Couder
2011-01-04 19:57 ` [PATCH 00/31] Refactor rebase Thomas Rast
2011-01-05 3:39 ` Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 00/31] refactor rebase Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 01/31] rebase: clearer names for directory variables Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 02/31] rebase: refactor reading of state Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 03/31] rebase: read state outside loop Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 04/31] rebase: remove unused rebase state 'prev_head' Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 05/31] rebase: improve detection of rebase in progress Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 06/31] rebase: act on command line outside parsing loop Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 07/31] rebase: stricter check of standalone sub command Martin von Zweigbergk
2011-07-01 3:55 ` Jonathan Nieder
2011-07-01 13:16 ` Martin von Zweigbergk
2011-07-01 22:29 ` Jonathan Nieder
2011-07-06 1:48 ` Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 08/31] rebase: align variable names Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 09/31] rebase: align variable content Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 10/31] rebase: factor out command line option processing Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 11/31] rebase -i: remove now unnecessary directory checks Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 12/31] rebase: reorder validation steps Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 13/31] rebase: factor out reference parsing Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 14/31] rebase: factor out clean work tree check Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 15/31] rebase: factor out call to pre-rebase hook Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 16/31] rebase -i: support --stat Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 17/31] rebase: remove $branch as synonym for $orig_head Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 18/31] rebase: extract merge code to new source file Martin von Zweigbergk
2011-02-14 8:02 ` Johannes Sixt
2011-02-14 13:56 ` Martin von Zweigbergk
2011-02-24 3:27 ` Martin von Zweigbergk
2011-02-24 8:07 ` Jeff King
2011-02-24 8:09 ` Jeff King
2011-02-25 3:32 ` Martin von Zweigbergk
2011-02-25 9:02 ` Jeff King
2011-02-25 20:24 ` Junio C Hamano
2011-02-25 20:27 ` Jakub Narebski
2011-03-01 22:04 ` Jeff King
2011-03-01 22:43 ` Jakub Narebski
2011-02-06 18:43 ` [PATCH v2 19/31] rebase: extract am " Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 20/31] rebase: show consistent conflict resolution hint Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 21/31] rebase -i: align variable names Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 22/31] rebase: make -v a tiny bit more verbose Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 23/31] rebase: factor out sub command handling Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 24/31] rebase: extract code for writing basic state Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 25/31] rebase: remember verbose option Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 26/31] rebase: remember strategy and strategy options Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 27/31] rebase -m: remember allow_rerere_autoupdate option Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 28/31] rebase -m: don't print exit code 2 when merge fails Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 29/31] git-rebase--am: remove unnecessary --3way option Martin von Zweigbergk
2011-02-06 18:43 ` [PATCH v2 30/31] rebase -i: don't read unused variable preserve_merges Martin von Zweigbergk
2011-02-06 18:44 ` [PATCH v2 31/31] rebase -i: remove unnecessary state rebase-root Martin von Zweigbergk
2011-02-10 22:44 ` [PATCH v2 00/31] refactor rebase Junio C Hamano
2011-02-12 0:55 ` Martin von Zweigbergk
2011-02-14 1:54 ` Martin von Zweigbergk [this message]
2011-02-14 3:15 ` Martin von Zweigbergk
2011-02-15 0:36 ` Junio C Hamano
2011-02-22 13:58 ` Martin von Zweigbergk
2011-02-22 19:21 ` Junio C Hamano
2011-02-23 11:26 ` Martin von Zweigbergk
2011-02-16 14:52 ` Johannes Sixt
2011-02-17 3:41 ` Martin von Zweigbergk
2011-02-24 3:07 ` [PATCH] rebase: define options in OPTIONS_SPEC Martin von Zweigbergk
2011-02-27 10:59 ` Junio C Hamano
2011-03-01 1:59 ` Martin von Zweigbergk
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=alpine.DEB.2.00.1102132047500.4253@debian \
--to=martin.von.zweigbergk@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=trast@student.ethz.ch \
/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