threads / rfc / 27998

[ANNOUNCE/RFC] cj-git-patchtool: a "rebase -i" with more interaction

Subject: [ANNOUNCE/RFC] cj-git-patchtool: a "rebase -i" with more interaction

## tl;dr

3 messages between Aug 2, 2011 and Aug 4, 2011.

replies: 2people: 2as markdown or json

Christian Jaeger· Aug 2, 2011, 19:22 UTC · lore
Hi

I've always been a frequent user of git rebase -i to clean up private branches before publication. I like committing without thinking while coding and then grouping the commits sensibly afterwards. But git rebase -i didn't scale for me for this purpose, cleaning up several days (or even weeks) of work would become a pain because frequently I'd make some error, like when dealing with conflicts, and then multiple rebase -i runs are needed, requiring to partially redo the work.

So I've written a set of tools[1] that separates the acts of editing and applying history changes. It does this by turning the history in question into a set of git patch files and a file containing the list of the patches (and optionally new commit messages), and allows to edit both the list and the patch files themselves incrementally until they can be applied cleanly again in the new order. In other words, an (attempted) application (cj-git-patchtool's "app" command) will not remove these files, and if there's a problem the existing files can be further refined. There's also a command "wig" that uses "wiggle" (by Neil Brown) to try to apply a patch automatically when git or patch wouldn't accept it, and if successful, stores the result back into the patch file so that it will be reused on subsequent "app" runs. For convenience, these files, which are put inside a newly created directory, are automatically checked into their own git repository, too, so when doing something really complicated, the state of work can be committed and reverted easily when reaching a dead end.

For more information see the README on Github.[1]

This works well for me, I'm now always using it whenever I need to do more than a couple trivial changes to a Git history.

I don't know whether there are other tools offering the same now. Also, I have written this "just for myself", and for this reason made use of a set of never-before released Perl libraries of mine. If there's general interest in this tool, I'll be glad to help get rid of the dependency on these libraries (or clean them up and publish them properly, too).

I welcome your comments.
Christian.
[1] https://github.com/pflanze/cj-git-patchtool
Jakub Narebski· Aug 3, 2011, 10:55 UTC · re: Christian Jaeger · lore

Re: [ANNOUNCE/RFC] cj-git-patchtool: a "rebase -i" with more interaction

Christian Jaeger <chrjae@gmail.com> writes:
> So I've written a set of tools[1] that separates the acts of editing
> and applying history changes.
[...]
> 
> For more information see the README on Github.[1]
[...]

I have added cj-git-patchtool to "Patch-management Interface layers" section of "Interfaces, frontends and tools" page on Git Wiki:

  https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#cj-git-patchtool

Please check if it is correct, and improve project description if needed.

Show 6 quoted lines
> I don't know whether there are other tools offering the same now.
> Also, I have written this "just for myself", and for this reason made
> use of a set of never-before released Perl libraries of mine. If
> there's general interest in this tool, I'll be glad to help get rid of
> the dependency on these libraries (or clean them up and publish them
> properly, too).

I use one of patch management interfaces for that, namely StGit. It operates on stack of patches, which you can apply and unapply, going back and forth and correcting them.

-- 
Jakub Narębski
Christian Jaeger· Aug 4, 2011, 06:02 UTC · re: Jakub Narebski · lore

Re: [ANNOUNCE/RFC] cj-git-patchtool: a "rebase -i" with more interaction

2011/8/3 Jakub Narebski <jnareb@gmail.com>:
> I have added cj-git-patchtool to "Patch-management Interface layers"
> section of "Interfaces, frontends and tools" page on Git Wiki:
Cool, thanks!
> I use one of patch management interfaces for that, namely StGit.  It
> operates on stack of patches, which you can apply and unapply, going
> back and forth and correcting them.

I knew StGit existed, but I've never actually tried it. Now I also see that the description of Guilt actually sounds exactly what cj-git-patchtool does. (I was expecting that these tools would just let me easily create sets of patches, similar to Darcs, not that they'd actually allow to edit patches to fix conflicts.) I'll have to try them out as soon as I find some time. Thanks for the hint.

Christian.

← back to recent threads