Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCHv6 4/4] status: better advices when splitting a commit (during rebase -i)

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:58

Kong Lucien [off-list ref] writes:
quoted hunk
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 2bb43f3..0b7f231 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -106,7 +106,7 @@ test_expect_success 'status when rebase in progress before rebase --continue' '
 
 test_expect_success 'status when rebasing -i in edit mode' '
 	git init git &&
-	test_when_finished "rm -rf git fake-editor.sh" &&
+	test_when_finished "rm -rf git" &&
Hrph.  Is this an "oops" fixup of an earlier patch?
quoted hunk
@@ -130,6 +130,67 @@ test_expect_success 'status when rebasing -i in edit mode' '
...
+test_expect_failure 'status after editing the last commit with --amend during a rebase -i' '
+	git init git &&
+	test_when_finished "rm -rf git fake-editor.sh" &&
You do not seem to remove fake-editor.sh in this test.  Why do you
remove it here?
quoted hunk
diff --git a/wt-status.c b/wt-status.c
index 5034eee..bbb3370 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -819,6 +820,69 @@ static void show_am_in_progress(struct wt_status *s,
 	wt_status_print_trailer(s);
 }
 
+static int split_commit_in_progress()
+{
+	int split_in_progress = 0;
+
+	FILE *head = fopen(git_path("HEAD"), "r");
+	if (!head)
+		return 0;
+
...
+	struct strbuf buf_head = STRBUF_INIT;
+	struct strbuf buf_orig_head = STRBUF_INIT;
+	struct strbuf buf_rebase_amend = STRBUF_INIT;
+	struct strbuf buf_rebase_orig_head = STRBUF_INIT;

Please avoid decl-after-statement by declaring all variables at the
beginning of the function before the first statement.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help