Re: [PATCH] Show number of commits being rebased interactively

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I see nobody commented on this, which probably fell into cracks.
Even though I am personally not very interested, I obviously am not
the only user of Git, and there may be others who are interested in
a change like this.

Onno Kortmann <onno@xxxxxxx> writes:

> 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.
> ---

These lines above "---" will become the only log message text, which
is probably not what you intended.  Use "-- >8 --" marker instead
(that is a perforation line with a pair of scissors on it)?

> 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 <onno@xxxxxxx>
> ---
>  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)

Does this count the number of commits?  I suspect it at least needs
to filter "x|exec" out.

>  cat >>"$todo" <<EOF
>
> -$comment_char Rebase $shortrevisions onto $shortonto
> +$comment_char Rebase $shortrevisions onto $shortonto ($commitcount commit(s))
>  EOF
>  append_todo_help
>  git stripspace --comment-lines >>"$todo" <<\EOF
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]