Re: Graphical tool to merge and reorder commits

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

 



Am 19.08.25 um 18:33 schrieb Junio C Hamano:
> Bernd Petrovitsch <bernd@xxxxxxxxxxxxxxxxxxx> writes:
>> On 19.08.25 10:35, R. Diez wrote:
>>> - A - B - fixA1 - C - fixA2 - D - E
>>> [...]
>>> - A+fixA1+fixA2 - B - C - D - E
>>
>> - `git rebase -i HEAD~11` (or so;-)
>> - move fixA1 and fixA2 under A and change "pick" to "fixup" for fixA1 and fixA2
>> - save and exit the editor
>>
>> And done.
> 
> I hope we all know that ;-).  But the question was if there is a GUI
> tool to let you do so without knowing how to move lines in your
> editor or how to edit "pick" and change it to "fixup", I think.
Half-GUI is to keep `gitk --branches HEAD &` open for easy diff
inspection and `git gui` next to it for easy staging of (partial)
changes. The workflow is then

    # fix bugs
    # git gui: stage all or partial changes
    # gitk: search commit

    git commit --fixup 123abc

    # git gui: stage more changes
    # gitk: search commit

    git commit --fixup def456

    git rebase -i --autosquash HEAD~11   # or so ;)
    # fixup commits are already at the correct positions

Bonus feature: After staging, press F5 in gitk, select the green commit
("Local changes check in to the index..."), right-click in the diff
panel on a removed line[*], select "Show origin of this line", and you
are right at the commit that you want to fix up.

[*] works also for context lines, but it is less obvious which one to
choose.

This workflow requires useful commit message summary lines. If you have
only identical silly summaries like "fix bug" or "new feature",
--autosquash doesn't know which one you mean.

-- Hannes





[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