Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for --update-refs would be nice to have #131

Open
parkercoates opened this issue Mar 16, 2023 · 3 comments
Open

Support for --update-refs would be nice to have #131

parkercoates opened this issue Mar 16, 2023 · 3 comments

Comments

@parkercoates
Copy link

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.

@anordal
Copy link
Contributor

anordal commented Jul 29, 2023

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.

@MartyLake
Copy link

MartyLake commented May 15, 2024

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

@anordal
Copy link
Contributor

anordal commented May 15, 2024

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)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants