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

rebase: use --update-refs #139

Closed
wants to merge 1 commit into from

Conversation

vermiculus
Copy link

@vermiculus vermiculus commented Jan 29, 2025

Introduced in Git 2.38 (1), the --update-refs option to git-rebase will move refs whose commits are rewritten in a rebase. This behavior is particularly useful when using stacked branches.

When git-absorb is called with --and-rebase, add this option to the rebase call.

(1): 900b50c242 (rebase: add --update-refs option, 2022-07-19)

Introduced in Git 2.38 [1], the --update-refs option to git-rebase
will move refs whose commits are rewritten in a rebase. This behavior
is particularly useful when using stacked branches.

When git-absorb is called with --and-rebase, add this option to the
rebase call.

[1]: 900b50c242 (rebase: add --update-refs option, 2022-07-19)
@vermiculus
Copy link
Author

It's worth noting that I'm not sure what the 'minimum supported Git version' of git-absorb will be, but this option was introduced 'relatively recently' in Q3/Q4 2022, so that's worth consideration.

@ccoVeille
Copy link

I'm using it automatically in git-absorb and
git-interactive-rebase-tool since I configured --update-refs to be used by default.

More information about rebase.updateRefs in git config

So while I understand your patch here, I think it would be better if git-absorb could support --update-refs and --no-update-refs as a flag, so they can be passed to git rebase command called by git-absorb

https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs

@tummychow
Copy link
Owner

sorry, declining this - especially since upstream already has a config option to set it by default. i don't want to be in the game of passing arbitrary flags to git rebase - see #88 for that.

@tummychow tummychow closed this Jan 30, 2025
@vermiculus
Copy link
Author

Ah! Somehow I didn't think to check git-config here. Agreed; that should be preferred :-)

Thanks!

@vermiculus vermiculus deleted the sa/update-refs branch February 7, 2025 02:38
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

Successfully merging this pull request may close these issues.

3 participants