mystor / git-revise

A handy tool for doing efficient in-memory commit rebases & fixups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for `--update-refs` would be nice to have

parkercoates opened this issue · comments

Git 2.38 added an --update-refs flag to git rebase and a corresponding update-ref command available when rebasing interactively. This can be very handy when working on a chain of dependent branches and wanting append changes to a parent branch.

I now sometimes find myself missing --update-refs when using git-revise, so it sure would be neat to see it implemented here as well, assuming its feasible.

This sounds very useful! I didn't know git could do that until I read your suggestion, but now I want it too, so I had a go in my superdevbranch:
anordal/git-revise/rebasehappy-integration-tryout

Comments welcome.

It became a big change, though. I'll add tests and split it up in smaller PRs, firstly this little fix: #135.

Hello, I tried to test the superbranch by installing using pip3 install git+https://github.com/anordal/git-revise.git, but when trying to issue git revise -i deadbeefdeadbeef, I have the error:

invalid value: Commit deadbeefdeadbeef has 2 parents

Were you also experiencing the same errors ?

EDIT: git revise --version returns 0.7.0
EDIT2: realised that this message is not precise enough to describe my issue, so I opened a new ticket #137

Commit deadbeef has 2 parents

Yeah, this means you chose the wrong base commit. It's an error message that could be improved, and is not related to this feature or any other on my branch.

For example, this happens every time after you have done a git fetch (so that origin/HEAD is no longer a commit in your local history) without then rebasing on origin/HEAD, and you then attempt to revise on top of origin/HEAD. It's simply a case of "holding it wrong".

So for example, instead of this:

git revise -i origin/HEAD

Do this:

git revise -i "$(git merge-base HEAD origin/HEAD)"