From: Johannes Sixt <j6t@kdbg.org>
To: Mike McLean <stixmclean@googlemail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: Git Feature Request (Fixdown in interactive rebase)
Date: Thu, 24 Dec 2020 10:16:00 +0100 [thread overview]
Message-ID: <ab835195-0c69-830b-c7cb-71d50b4ce4db@kdbg.org> (raw)
In-Reply-To: <CAM0jFOfSE3_TQ7WXiR_G6eHOZnr-0ryv=CniXs4sxs1=JnucUg@mail.gmail.com>
Am 24.12.20 um 01:13 schrieb Mike McLean:
> I agree that "realism and frequency of use case" is a critical metric :D
>
> For me it's very much the 2nd case you described and there are 2
> scenarios that it comes up in most frequently:
>
> [...]
> 2) Interactive rebases
> I make heavy use of interactive rebases, in order to make committing
> be a REALLY low effort task. If I don't have to clean up my commits
> when I make them, then I can commit really easily, which means I
> commit frequently, which is a good thing :D But then I have a messy
> git history. Especially if I'm juggling a bunch of small fixes at
> once, and I end up with bits of one fix/refactor in a commit that was
> mostly about another thing.
>
> Not a problem: Interactive rebase to the rescue!
>
> I use `edit` mode to split stuff apart and then squash mode to push
> the relevant bits back together again.
> But a downside of this is that frequently I end up with the commit
> with the good message being *after* the scrappy bit that's just been
> split off from another commit.
> Sometimes I can just pull that scrappy bit past the main commit and
> then `fixup` that bit, but often that would cause merge conflicts, so
> it'd be easier to have a fixdown that does exactly what I'm going to
> do with `squash`.
>
> =-=-=-=-=-=-=-=-=-=-=
>
> I recognise that these might be very niche or non-standard usages, and
> if you don't think there would be much demand for such functionality
> then I'm fine with that :D
I would not say that your workflow is exceptional; quite the contrary: I
do exactly like you explained. And I guess that many others do as well
(interactive rebase was invented for uses cases like yours).
I don't mind using 'squash' to consolidate commits where the meat of the
change and the commit message is not in the first one.
But consider a situation like this, which I find myself in regularly:
$ work
$ git commit -m "WIP begin feature"
$ work -- ah, this can be done independently:
$ git commit -m "refactor stuff"
$ do the real feature (takes time, many commits)
# finally:
$ git commit -m "the real feature"
Here I wish that the final commit carries an author date that should be
after the "refactor" commit to be realistic. But 'squash' takes
authorship including the date from the first commit (the "WIP" commit in
this example). That is where the suggested feature could help. I admit,
though, that it's not a huge deal.
-- Hannes
next prev parent reply other threads:[~2020-12-24 9:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAM0jFOeCE-iTAMkiGE6m8bVNjJRn-BUmbUAP2ANrj4FbhuQG=g@mail.gmail.com>
2020-12-23 23:08 ` Git Feature Request (Fixdown in interactive rebase) Mike McLean
2020-12-23 23:25 ` brian m. carlson
2020-12-23 23:28 ` Mike McLean
2020-12-23 23:57 ` Junio C Hamano
2020-12-24 0:13 ` Mike McLean
2020-12-24 9:16 ` Johannes Sixt [this message]
2020-12-24 22:21 ` Junio C Hamano
2020-12-24 22:54 ` Johannes Sixt
2021-01-06 22:40 ` Johannes Schindelin
2021-01-27 7:55 ` Charvi Mendiratta
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=ab835195-0c69-830b-c7cb-71d50b4ce4db@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=stixmclean@googlemail.com \
/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.
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 NNTP newsgroup(s).