git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: [PATCH 5/5] sequencer: revert d3f4628e
Date: Sat,  5 Nov 2011 21:59:46 +0530	[thread overview]
Message-ID: <1320510586-3940-6-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1320510586-3940-1-git-send-email-artagnon@gmail.com>

Revert d3f4628e (revert: Remove sequencer state when no commits are
pending, 2011-06-06), because this is not the right approach.  Instead
of increasing coupling between the sequencer and 'git commit', a
unified '--continue' that invokes 'git commit' on behalf of the
end-user is preferred.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 sequencer.c                     |   12 +-----------
 t/t3510-cherry-pick-sequence.sh |   24 ------------------------
 2 files changed, 1 insertions(+), 35 deletions(-)

diff --git a/sequencer.c b/sequencer.c
index 6762ceb..7caa550 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -758,18 +758,8 @@ static int pick_commits(struct replay_insn_list *todo_list,
 	for (cur = todo_list; cur; cur = cur->next) {
 		save_todo(cur);
 		res = do_pick_commit(cur->operand, cur->action, opts);
-		if (res) {
-			if (!cur->next)
-				/*
-				 * An error was encountered while
-				 * picking the last commit; the
-				 * sequencer state is useless now --
-				 * the user simply needs to resolve
-				 * the conflict and commit
-				 */
-				remove_sequencer_state(0);
+		if (res)
 			return res;
-		}
 	}
 
 	/*
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 4b12244..b30f13a 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -85,30 +85,6 @@ test_expect_success '--reset cleans up sequencer state' '
 	test_path_is_missing .git/sequencer
 '
 
-test_expect_success 'cherry-pick cleans up sequencer state when one commit is left' '
-	pristine_detach initial &&
-	test_must_fail git cherry-pick base..picked &&
-	test_path_is_missing .git/sequencer &&
-	echo "resolved" >foo &&
-	git add foo &&
-	git commit &&
-	{
-		git rev-list HEAD |
-		git diff-tree --root --stdin |
-		sed "s/$_x40/OBJID/g"
-	} >actual &&
-	cat >expect <<-\EOF &&
-	OBJID
-	:100644 100644 OBJID OBJID M	foo
-	OBJID
-	:100644 100644 OBJID OBJID M	unrelated
-	OBJID
-	:000000 100644 OBJID OBJID A	foo
-	:000000 100644 OBJID OBJID A	unrelated
-	EOF
-	test_cmp expect actual
-'
-
 test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '
 	pristine_detach initial &&
 	test_must_fail git cherry-pick base..anotherpick &&
-- 
1.7.6.351.gb35ac.dirty

  parent reply	other threads:[~2011-11-05 16:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 16:29 [PATCH 0/5] Sequencer: working around historical mistakes Ramkumar Ramachandra
2011-11-05 16:29 ` [PATCH 1/5] sequencer: factor code out of revert builtin Ramkumar Ramachandra
2011-11-06  0:12   ` Jonathan Nieder
2011-11-13 10:40     ` Ramkumar Ramachandra
2011-11-13 23:10       ` Junio C Hamano
2011-11-15  9:00         ` Ramkumar Ramachandra
2011-11-15  9:18           ` Miles Bader
2011-11-15  9:47             ` Jonathan Nieder
2011-11-05 16:29 ` [PATCH 2/5] sequencer: remove CHERRY_PICK_HEAD with sequencer state Ramkumar Ramachandra
2011-11-06  0:15   ` Jonathan Nieder
2011-11-05 16:29 ` [PATCH 3/5] sequencer: sequencer state is useless without todo Ramkumar Ramachandra
2011-11-06  0:26   ` Jonathan Nieder
2011-11-13 10:44     ` Ramkumar Ramachandra
2011-11-13 20:50       ` Junio C Hamano
2011-11-15  9:13         ` Ramkumar Ramachandra
2011-11-15  9:52           ` Jonathan Nieder
2011-11-15 16:27             ` Junio C Hamano
2011-11-16  6:17               ` Ramkumar Ramachandra
2011-11-16  7:38                 ` Junio C Hamano
2011-11-16  7:59                 ` [PATCH 0/3] avoiding unintended consequences of git_path() usage Jonathan Nieder
2011-11-16  8:03                   ` [PATCH 1/3] do not let git_path clobber errno when reporting errors Jonathan Nieder
2011-11-16  8:04                   ` [PATCH 2/3] Bigfile: dynamically allocate buffer for marks file name Jonathan Nieder
2011-11-16  8:07                   ` [PATCH 3/3] rename git_path() to git_path_unsafe() Jonathan Nieder
2011-11-17  1:20                     ` Junio C Hamano
2011-11-17  7:03                       ` Jonathan Nieder
2011-11-16  8:37                   ` [PATCH 0/3] avoiding unintended consequences of git_path() usage Nguyen Thai Ngoc Duy
2011-11-16  8:42                     ` Nguyen Thai Ngoc Duy
2011-11-16  8:59                     ` Jonathan Nieder
2011-11-16  9:31                       ` Nguyen Thai Ngoc Duy
2011-11-19 19:25                         ` Ramsay Jones
2011-11-16 21:50                       ` [PATCH/RFC] introduce strbuf_addpath() Jonathan Nieder
2011-11-18  1:42                         ` Nguyen Thai Ngoc Duy
2011-11-16 22:04                     ` [PATCH 0/3] avoiding unintended consequences of git_path() usage Junio C Hamano
2011-11-16  8:51                   ` Ramkumar Ramachandra
2011-11-16 13:33                   ` Nguyen Thai Ngoc Duy
2011-11-16 13:44                     ` Michael Haggerty
2011-11-18  3:33                   ` Nguyen Thai Ngoc Duy
2011-11-05 16:29 ` [PATCH 4/5] sequencer: handle single commit pick separately Ramkumar Ramachandra
2011-11-06  0:35   ` Jonathan Nieder
2011-11-05 16:29 ` Ramkumar Ramachandra [this message]
2011-11-06  0:42   ` [PATCH 5/5] sequencer: revert d3f4628e Jonathan Nieder
2011-11-06 19:10     ` Junio C Hamano
2011-11-07  6:06       ` Ramkumar Ramachandra
2011-11-12 16:13     ` Ramkumar Ramachandra
2011-11-12 22:40       ` Jonathan Nieder
2011-11-05 23:43 ` [PATCH 0/5] Sequencer: working around historical mistakes Jonathan Nieder
2011-11-13 10:42   ` Ramkumar Ramachandra

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=1320510586-3940-6-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.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).