Skip to content

Allow reset <tag> in git rebase -ir #199

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

Closed
dscho opened this issue May 17, 2019 · 7 comments
Closed

Allow reset <tag> in git rebase -ir #199

dscho opened this issue May 17, 2019 · 7 comments
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits

Comments

@dscho
Copy link
Member

dscho commented May 17, 2019

The interactive rebase allows resetting HEAD to a specified revision, but it currently cannot handle tags. Let's fix that.

See https://public-inbox.org/git/[email protected]/

@dscho dscho added the leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits label May 17, 2019
@agrn
Copy link

agrn commented Oct 13, 2019

I just tried to reset to a tag with git rebase -ir and it worked, what am I missing here?

@dscho
Copy link
Member Author

dscho commented Oct 13, 2019

I just tried to reset to a tag with git rebase -ir and it worked, what am I missing here?

Did you issue something like reset v2.23.0? In my case, this failed, but I did not re-try recently, I have to admint.

@agrn
Copy link

agrn commented Oct 14, 2019

Hmm, I tried to reset to a lightweight tag and it worked (on v2.23.0), but I just tried to reset to an annotated tag and it failed. Now I understand.

@LemmingAvalanche
Copy link

This seems to work on git version 2.42.0? I'm not completely sure that I understand the issue.

This works with an annotated tag:

label onto

# Branch b
reset onto
pick 0c6e48d commit
pick c15c869 commit
pick b455456 commit
label branch-point
pick eb741d4 commit
pick c3cff52 commit
pick 47eb2a3 commit
pick 341a5a4 commit
label b

reset branch-point-tag # annotated tag
merge -C 017ad1b b # Merge branch 'b' into a

Deferencing (term?) to the commit with ^0 seems to work the same way:

...
reset branch-point-tag^0 
...

@dscho
Copy link
Member Author

dscho commented Oct 8, 2023

@LemmingAvalanche I bet it was 82766b2 that fixed this. Could you verify?

@LemmingAvalanche
Copy link

@dscho Confirming that:

  • This works (rebase succeeds) on 82766b2
  • This does not work on the antecedent commit (82766b2^1)

Failed rebase:

hint: Could not execute the todo command
hint: 
hint:     reset tag-branch-point
hint: 
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint: 
hint:     git rebase --edit-todo
hint:     git rebase --continue

@dscho
Copy link
Member Author

dscho commented Oct 17, 2023

@LemmingAvalanche thank you for confirming!

@dscho dscho closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits
Projects
None yet
Development

No branches or pull requests

3 participants