Skip to content

Commit 335dc84

Browse files
committed
Teach the sequencer about interactive rebase's verbose mode
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ac8763b commit 335dc84

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

sequencer.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ static GIT_PATH_FUNC(git_path_rebase_amend, "rebase-merge/amend")
6262
* the long commit name of the corresponding patch.
6363
*/
6464
static GIT_PATH_FUNC(stopped_sha, "rebase-merge/stopped-sha")
65+
/*
66+
* The following files are written by git-rebase just after parsing the
67+
* command-line (and are only consumed, not modified, by the sequencer).
68+
*/
69+
static GIT_PATH_FUNC(orig_head, "rebase-merge/orig-head")
70+
static GIT_PATH_FUNC(git_path_rebase_verbose, "rebase-merge/verbose") /* TODO: turn into opt */
6571

6672
#define IS_REBASE_I() (opts->action == REPLAY_INTERACTIVE_REBASE)
6773

@@ -1301,9 +1307,26 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
13011307
}
13021308

13031309
if (IS_REBASE_I()) {
1310+
struct strbuf buf = STRBUF_INIT;
1311+
13041312
/* Stopped in the middle, as planned? */
13051313
if (todo_list->current < todo_list->nr)
13061314
return 0;
1315+
1316+
if (file_exists(git_path_rebase_verbose())) {
1317+
const char *argv[] = {
1318+
"diff-tree", "--stat", NULL, NULL
1319+
};
1320+
1321+
if (strbuf_read_file(&buf, orig_head(), 41) <= 0)
1322+
return error("Could not read %s", orig_head());
1323+
strbuf_rtrim(&buf);
1324+
strbuf_addstr(&buf, "..HEAD");
1325+
argv[2] = buf.buf;
1326+
run_command_v_opt(argv, RUN_GIT_CMD);
1327+
strbuf_reset(&buf);
1328+
}
1329+
strbuf_release(&buf);
13071330
}
13081331

13091332
/*

0 commit comments

Comments
 (0)