From: "Philip Oakley" <philipoakley@iee.org>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Junio C Hamano" <gitster@pobox.com>
Cc: "Ashutosh Bapat" <ashutosh.bapat@enterprisedb.com>,
<git@vger.kernel.org>, "Michael Haggerty" <mhagger@alum.mit.edu>,
"Michael J Gruber" <git@drmicha.warpmail.net>,
"Matthieu Moy" <Matthieu.Moy@imag.fr>
Subject: Re: Bug with fixup and autosquash
Date: Thu, 9 Feb 2017 23:31:56 -0000 [thread overview]
Message-ID: <454E7D934160418EB4C4871ED209CBCA@PhilipOakley> (raw)
In-Reply-To: alpine.DEB.2.20.1702092142020.3496@virtualbox
From: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Sent: Thursday, February 09, 2017 8:55 PM
> Hi Ashutosh and Junio,
>
> On Wed, 8 Feb 2017, Junio C Hamano wrote:
>
>> Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> writes:
>>
>> > I have been using git rebase heavily these days and seem to have found
>> > a bug.
>> >
>> > If there are two commit messages which have same prefix e.g.
>> > yyyyyy This is prefix
>> > xxxxxx This is prefix and message
>> >
>> > xxxxxx comitted before yyyyyy
>> >
>> > Now I commit a fixup to yyyyyy using git commit --fixup yyyyyy
>> > zzzzzz fixup! This is prefix
>> >
>> > When I run git rebase -i --autosquash, the script it shows me looks
>> > like
>> > pick xxxxxx This is prefix and message
>> > fixup zzzzzz fixup! This is prefix
>> > pick yyyyyy This is prefix
>> >
>> > I think the correct order is
>> > pick xxxxxx This is prefix and message
>> > pick yyyyyy This is prefix
>> > fixup zzzzzz fixup! This is prefix
>> >
>> > Is that right?
>>
>> [...]
>>
>> Unfortunately, "rebase -i --autosquash" reorders the entries by
>> identifying the commit by its title, and it goes with prefix match so
>> that fix-up commits created without using --fixup option but manually
>> records the title's prefix substring can also work.
>
> This prefix match also happens to introduce a serious performance problem,
> which is why I "fixed" this issue in the rebase--helper already (which is
> the case if you are using Git for Windows, whose master branch builds on
> Linux and MacOSX as well). I quoted "fix" because my motivation was to fix
> the performance problem, not the "incorrect match" problem.
>
> The rebase--helper code (specifically, the patch moving autosquash logic
> into it: https://github.com/dscho/git/commit/7d0831637f) tries to match
> exact onelines first,
While I think this is an improvement, and will strongly support the `git
commit --fixup=<commit>` option which will, if the sha1/oid is given, create
the exact commit subject line.
However it would also be useful if the actual commit subject line could have
a similar format option, so that those who use say the git gui (rather than
the cli) for the commit message, could easily create the `!fixup <commit>`
message which would allow a broader range of ways of spelling the commit
(e.g. giving a sha1(min length) that is within the rebase todo list).
> and falls back to prefix matching only after that.
>
> Now that the sequencer-i patch series is in `master`, the next step is to
> send the patch series introducing the rebase--helper. The patch series
> including the fix discussed above relies on that one. Meaning that it will
> take a while to get through the mill.
>
> So please do not hold your breath until this feature/fix hits an official
> Git version. If you need it[*1*] faster, feel free to build Git for
> Windows' master and run with that for a while.
>
> Ciao,
> Johannes
>
> Footnote: By "it" I mean "the feature/fix", not "an official Git version"
> nor "your breath".
>
--
Philip
next prev parent reply other threads:[~2017-02-09 23:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 10:10 Bug with fixup and autosquash Ashutosh Bapat
2017-02-08 22:55 ` Junio C Hamano
2017-02-09 4:06 ` Ashutosh Bapat
2017-02-09 15:07 ` Michael J Gruber
2017-02-09 19:46 ` Junio C Hamano
2017-02-09 20:55 ` Johannes Schindelin
2017-02-09 21:21 ` Junio C Hamano
2017-02-09 22:02 ` Johannes Schindelin
2017-02-09 22:16 ` Junio C Hamano
2017-02-10 15:57 ` Johannes Schindelin
2017-02-10 19:02 ` Philip Oakley
2017-04-25 11:30 ` Johannes Schindelin
2017-02-09 23:31 ` Philip Oakley [this message]
2017-02-10 14:02 ` Johannes Schindelin
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=454E7D934160418EB4C4871ED209CBCA@PhilipOakley \
--to=philipoakley@iee.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=Matthieu.Moy@imag.fr \
--cc=ashutosh.bapat@enterprisedb.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
/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).