Re: Git Feature Request (Fixdown in interactive rebase)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j6t@xxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux