git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Phillip Wood <phillip.wood@talktalk.net>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Philip Oakley <philipoakley@iee.org>,
	Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: [RFC PATCH 5/5] Add rebase.continue.autostage config setting
Date: Wed, 26 Jul 2017 11:27:20 +0100	[thread overview]
Message-ID: <20170726102720.15274-6-phillip.wood@talktalk.net> (raw)
In-Reply-To: <20170726102720.15274-1-phillip.wood@talktalk.net>

From: Phillip Wood <phillip.wood@dunelm.org.uk>

This enables the user to always specify --autostage with --continue

The tests check that setting rebase.continue.autostage=true results in
'git rebase --continue' autostaging unstaged changes and that
'--no-autostage' overrides it.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 git-rebase.sh              |  2 +-
 t/t3418-rebase-continue.sh | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 9ca387349b1cde440c4244de9125446fd35a7b67..632a19079ba1d88092f47121c7a0797af079aaf5 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -70,7 +70,7 @@ merge_dir="$GIT_DIR"/rebase-merge
 apply_dir="$GIT_DIR"/rebase-apply
 verbose=
 diffstat=
-autostage=false
+autostage=$(git config --bool --get rebase.continue.autostage || echo false)
 test "$(git config --bool rebase.stat)" = true && diffstat=t
 autostash="$(git config --bool rebase.autostash || echo false)"
 fork_point=auto
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 4e71e5d5c2f26866cd5d32bfea445f899398d6c9..7c2a30a3cd8ba7e33519bd68a3f89e90409169da 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -67,6 +67,21 @@ test_autostage () {
 		git reset -- F2 &&
 		test_must_fail git rebase --continue --autostage
 	'
+
+	test_expect_success "rebase.continue.autostage rebase $action works" '
+		reset &&
+		test_must_fail git rebase $action --onto master master topic &&
+		echo "Resolved" >F2 &&
+		git -c rebase.continue.autostage=true rebase --continue
+'
+
+	test_expect_success "rebase $action --continue --no-autostage works" '
+		reset &&
+		test_must_fail git rebase $action --onto master master topic &&
+		echo "Resolved" >F2 &&
+		test_must_fail git -c rebase.continue.autostage=true rebase --continue --no-autostage
+'
+
 }
 
 test_autostage
-- 
2.13.3


  parent reply	other threads:[~2017-07-26 10:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26 10:27 [RFC PATCH 0/5] Add option to autostage changes when continuing a rebase Phillip Wood
2017-07-26 10:27 ` [RFC PATCH 1/5] rebase --continue: add --autostage to stage unstaged changes Phillip Wood
2017-07-26 10:27 ` [RFC PATCH 2/5] rebase -i: improve --continue --autostage Phillip Wood
2017-07-26 10:27 ` [RFC PATCH 3/5] Unify rebase amend message when HEAD has changed Phillip Wood
2017-07-26 10:27 ` [RFC PATCH 4/5] Add tests for rebase --continue --autostage Phillip Wood
2017-07-26 10:27 ` Phillip Wood [this message]
2017-07-26 18:21 ` [RFC PATCH 0/5] Add option to autostage changes when continuing a rebase Junio C Hamano
2017-07-26 21:56   ` Junio C Hamano
2017-07-26 22:12     ` Junio C Hamano
2017-07-27 10:36       ` Phillip Wood
2017-07-27 13:25         ` Phillip Wood
2017-07-27 15:24           ` Junio C Hamano
2017-08-21 10:32             ` Phillip Wood
2017-08-21 22:41               ` Junio C Hamano
2017-08-22 10:54                 ` Phillip Wood
2017-08-22 15:54                   ` Junio C Hamano
2017-08-24 13:25                     ` Phillip Wood
2017-08-24 16:46                       ` Junio C Hamano
2017-08-25 11:54                         ` Phillip Wood

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=20170726102720.15274-6-phillip.wood@talktalk.net \
    --to=phillip.wood@talktalk.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=philipoakley@iee.org \
    --cc=phillip.wood@dunelm.org.uk \
    /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).