From: Junio C Hamano <gitster@pobox•com>
To: git@vger•kernel.org
Cc: Onno Kortmann <onno@gmx•net>
Subject: Re: [PATCH] Show number of commits being rebased interactively
Date: Fri, 05 Dec 2014 13:37:19 -0800 [thread overview]
Message-ID: <xmqq388tpyls.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5460E893.7080003@gmx.net> (Onno Kortmann's message of "Mon, 10 Nov 2014 17:32:19 +0100")
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@gmx•net> 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@gmx•net>
> ---
> 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
next prev parent reply other threads:[~2014-12-05 21:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <md5:H/n6RCGs7zvP8Sp7z7ElnQ==>
2014-11-10 16:32 ` [PATCH] Show number of commits being rebased interactively Onno Kortmann
2014-12-05 21:37 ` Junio C Hamano [this message]
2014-12-07 20:56 ` Onno Kortmann
2014-12-09 19:03 ` Junio C Hamano
2014-12-10 18:16 ` Onno Kortmann
2014-11-09 13:24 Onno Kortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq388tpyls.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=onno@gmx$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox