feat: replace the manual rebase code with built-in git commands

Labels: resolution/closed

Timeline

Ben Boeckel (mathstuf) opened

Saw this on Reddit:

is that you lose the ability to fork and merge bugs (at least, not automatically with git branch and git merge)

That's correct, but that's because there is no low level git command that can rebase branch without touching the index. It's really just a shortcoming of git because no one has a serious use case for that (yet). I wrote code in git-bug to do that manually. If that is fixed in git, the data model allow for automatic merge.

FYI, it is possible, but not "trivial". The raw Git commands to do this are in this file. Basically, you make a new index file and work tree and convince Git that things are OK and then you can operate as normal (though only files that Git needs to drop will be dropped; namely conflict files).

It is possible to do the same things using libgit2.

Michael Muré (MichaelMure) commented

awesome, I'll have to test that :-)

Michael Muré (MichaelMure) changed the title from feat: replace the manual rebase code with built-in git commands to feat: replace the manual rebase code with built-in git commands

Michael Muré (MichaelMure) added label Core

Michael Muré (MichaelMure) commented

Well, two years later this is not relevant anymore as all this code has been rewritten and git-bug is not doing any rebase anymore (and that's a good thing).

Michael Muré (MichaelMure) closed the bug

sudoforge added label resolution/closed

sudoforge removed label Core