From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Mike McLean <stixmclean@googlemail.com>, git@vger.kernel.org
Subject: Re: Git Feature Request (Fixdown in interactive rebase)
Date: Thu, 24 Dec 2020 14:21:11 -0800 [thread overview]
Message-ID: <xmqq8s9m3kx4.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <ab835195-0c69-830b-c7cb-71d50b4ce4db@kdbg.org> (Johannes Sixt's message of "Thu, 24 Dec 2020 10:16:00 +0100")
Johannes Sixt <j6t@kdbg.org> writes:
> 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.
Yeah, I actually find that an interesting scenario.
In such a workflow, you'd want to view all the previous steps
building pieces as preparing for the final step that makes the
cumulative effort into presentable whole. Whether you want to use
the log message only from the last step or want to use the "squash"
to collect pieces from all the WIP commits, you would want the other
aspects of the resulting single commit to be more similar to the
final one rather than the earlier one(s), as if you did something
like "commit --reset-author --amend" (yes, I am including the case
where the work on the branch was a team effort and the one that
collects them into a single resulting commit would become the
"corresponding author").
I wonder if we deliberately designed how each insn you can write in
the todo list should come up with the authorship data (i.e. ident
and timestamp), or if we are just using the natural consequence of
how the implementation happens to work? I think it makes sense for
"fixup", as an instruction used to make a small tweak to the bulk of
work you've done some time ago, to use the authorship information of
the original commit that gets fixed up. I don't know offhand what
other insns like "edit", "reword", etc. do, and if there is a room
to improve them.
next prev parent reply other threads:[~2020-12-24 22:22 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
2020-12-24 22:21 ` Junio C Hamano [this message]
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=xmqq8s9m3kx4.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--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).