From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood <phillip.wood@talktalk.net>,
Git Mailing List <git@vger.kernel.org>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH] rebase -i: fix numbering in squash message
Date: Thu, 16 Aug 2018 10:42:30 +0200 (DST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1808161039300.71@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqy3d7h21r.fsf@gitster-ct.c.googlers.com>
Hi,
On Wed, 15 Aug 2018, Junio C Hamano wrote:
> Phillip Wood <phillip.wood@talktalk.net> writes:
>
> >> I wonder if it makes it easier to read, understand and maintain if
> >> there were a local variable that gets opts->current_fixup_count+2 at
> >> the beginning of the function, make these three places refer to that
> >> variable, and move the increment of opts->current_fixup_count down
> >> in the function, after the "if we are squashing, do this, if we are
> >> fixing up, do that, otherwise, we do not know what we are doing"
> >> cascade. And use the more common post-increment, as we no longer
> >> depend on the returned value while at it.
> >>
> >> IOW, something like this (untested), on top of yours.
> >
> > I think you'd need to change commit_staged_changes() as well as it
> > relies on the current_fixup_count counting the number of fixups, not the
> > number of fixups plus two.
>
> I suspect you misread what I wrote (see below for the patch).
I had the same reaction as Phillip: is your patch good enough, or does it
only touch one part, but not other that may need the same "touch-upping".
> The fixup_count is a new local variable in update_squash_messages()
> that holds N+2; in other words, I am not suggesting to change what
> opts->current_fixup_count means.
Sure, and the better cleanup could possibly be to change the meaning of
opts->current_fixup_count altogether.
> > Having said that using 'current_fixup_count +
> > 2' to create the labels and incrementing the count at the end of
> > update_squash_messages() would probably be clearer than my version. I'm
> > about to go away so it'll probably be the second week of September
> > before I can re-roll this, will that be too late for getting it into 2.19?
>
> I actually do not mind to go with what you originally sent, unless a
> cleaned up version is vastly more readable. After all, a clean-up
> can be done separately and safely.
At this point, I think Phillip's version would be safer, as it would make
it easier to do a more complete cleanup without the pressure of having to
fix a bug in one big hurry.
So: ACK on Phillip's patch from me.
Ciao,
Dscho
prev parent reply other threads:[~2018-08-16 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 9:41 [PATCH] rebase -i: fix numbering in squash message Phillip Wood
2018-08-15 18:05 ` Junio C Hamano
2018-08-15 18:33 ` Phillip Wood
2018-08-15 19:17 ` Junio C Hamano
2018-08-16 8:42 ` Johannes Schindelin [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.QRO.7.76.6.1808161039300.71@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=phillip.wood@talktalk.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).