git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] status: rebase and merge can be in progress at the same time

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 12, 2018, 23:26 UTC
Message-ID
<7b2f5e37f4dca7cafb4d6ea5eebafc31e120a339.1542065154.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.75.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

Since `git rebase -r` was introduced, that is possible. But our machinery did not think that possible, and failed to say anything about the rebase in progress when in the middle of a merge.

Let's work around that in the minimal fashion.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 wt-status.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 187568a112..a24711374c 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1559,6 +1559,7 @@ void wt_status_get_state(struct wt_status_state *state,
 	struct object_id oid;
 
 	if (!stat(git_path_merge_head(the_repository), &st)) {
+		wt_status_check_rebase(NULL, state);
 		state->merge_in_progress = 1;
 	} else if (wt_status_check_rebase(NULL, state)) {
 		;		/* all set */
@@ -1583,9 +1584,13 @@ static void wt_longstatus_print_state(struct wt_status *s)
 	const char *state_color = color(WT_STATUS_HEADER, s);
 	struct wt_status_state *state = &s->state;
 
-	if (state->merge_in_progress)
+	if (state->merge_in_progress) {
+		if (state->rebase_interactive_in_progress) {
+			show_rebase_information(s, state_color);
+			fputs("\n", s->fp);
+		}
 		show_merge_in_progress(s, state_color);
-	else if (state->am_in_progress)
+	} else if (state->am_in_progress)
 		show_am_in_progress(s, state_color);
 	else if (state->rebase_in_progress || state->rebase_interactive_in_progress)
 		show_rebase_in_progress(s, state_color);
-- 
gitgitgadget
Previous: Johannes Schindelin
Message 14 of 14 in “Assorted fixes revolving around rebase and merges”
  1. 0/5 Assorted fixes revolving around rebase and mergesJohannes Schindelin via GitGitGadget, Nov 12, 2018
  2. 1/5 rebase -r: demonstrate bug with conflicting mergesJohannes Schindelin via GitGitGadget, Nov 12, 2018
  3. Junio C HamanoNov 13, 2018
  4. Johannes SchindelinNov 13, 2018
  5. Junio C HamanoNov 13, 2018
  6. Johannes SchindelinNov 13, 2018
  7. Junio C HamanoNov 13, 2018
  8. 2/5 rebase -r: do not write MERGE_HEAD unless neededJohannes Schindelin via GitGitGadget, Nov 12, 2018
  9. 3/5 rebase -i: include MERGE_HEAD into files to clean upJohannes Schindelin via GitGitGadget, Nov 12, 2018
  10. Junio C HamanoNov 13, 2018
  11. 4/5 built-in rebase --skip/--abort: clean up stale .git/<name> filesJohannes Schindelin via GitGitGadget, Nov 12, 2018
  12. Junio C HamanoNov 13, 2018
  13. Johannes SchindelinNov 13, 2018
  14. 5/5 status: rebase and merge can be in progress at the same timeJohannes Schindelin via GitGitGadget, Nov 12, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.