From: Onno Kortmann Date: Mon, 10 Nov 2014 16:32:19 GMT Subject: [PATCH] Show number of commits being rebased interactively Message-ID: <5460E893.7080003@gmx.net> In-Reply-To: Hi again, oops, I realized that my MUA mangled the patch, even though it shouldn't. Here it is again, with a bit more description. --- During 'rebase -i', one wrong edit in a long rebase session might inadvertently drop commits. This change shows the total number of commits in the comments below the commit list. After the rebase edit, the number can be quickly compared to the line number of the last commit - by scrolling to the last entry in the rebase TODO list. This gives peace of mind that no commits have been lost in the edit. Signed-off-by: Onno Kortmann --- git-rebase--interactive.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index b64dd28..b266dc0 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -1031,9 +1031,11 @@ test -s "$todo" || echo noop >> "$todo" test -n "$autosquash" && rearrange_squash "$todo" test -n "$cmd" && add_exec_commands "$todo" +commitcount=$(git stripspace --strip-comments <"$todo" | wc -l) + cat >>"$todo" <>"$todo" <<\EOF -- 2.2.0.rc1.1.gbab0d06