feat(move): Add `--fixup` to squash moved commits into the destination
See https://github.com/arxanas/git-branchless/pull/538#pullrequestreview-1105180957
@arxanas I could use some help with this.
This seems to be working for simple cases (ie in memory sticks) but I think I could use some guidance to get unblocked on where to go next. Specifically, I'm having a hard time getting my head around how to handle on-disk fixup rebases and having some issues with fixing up complicated commit graphs. I feel like I'm playing whack-a-mole with errors and conditions: if I get one test working, another breaks; when I get that working, the other one breaks; etc, and I'm left wondering if my approach is heading in the wrong direction and/or is too rigid or something.
-
[ ] This is still pretty "draft"; please don't be too alarmed by the ugly bits that I need to go back through and clean up! :smile:
-
[ ] I added some code that uses
git2::Tree::iter()directly- [ ] I started to work on this, but it felt very copy-pasty and boilerplate-y and seemed to add a lot more code than I was expecting compared to just using
tree.inner.iter(), plus other parts ofrepo.rsalready usetree.inner.iter(), so I gave up and moved on to more fun stuff. :laughing: Does it seem OK to leave that as is, or would you prefer that it be wrapped?
- [ ] I started to work on this, but it felt very copy-pasty and boilerplate-y and seemed to add a lot more code than I was expecting compared to just using
-
[ ] In-memory fix ups seem to work for stick stacks, but if a commit w/ otherwise unaffected children is fixed up, it's left in a "needs restack" state. Is this inevitable, or is there is a convenient way to recognize and automatically restack in cases like these? (See
test_move_fixup_complicated, but note that this tests breaks as of the last commit in this stack, in which I'm trying (and failing) to get on-disk rebases to work) -
[ ] On disk rebase is not working
- [ ] As noted, the last commit in this stack is me hacking around to try to get on-disk fixup rebases to work. It's incomplete and breaks many/most of the in-memory fixup rebase tests.
- [ ] I have tried doing
SkipUpstreamAppliedCommitafter everyFixUp. This helps in some cases, but not all, and it makes in-memory fixups involving multiple fixup commits complicated b/c it's hard to keep track of the target/fixed-up commit as it's always being "rewritten to zero". - [ ] Perhaps I need to be sorting the
RebaseCommandsdifferently, so thatSkipUpstreamAppliedCommitis only called at the end of the rebase? - [ ] Or could it be that I'm not giving the
post-rewriteetc hooks the info they need to figure things out?