-
Notifications
You must be signed in to change notification settings - Fork 277
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
FR: Command for resetting change ID #4451
Comments
How about |
Those could be good names! I think it is technically not possible to modify the change ID without also modifying the commit ID because of how the change ID is stored for the Git backend (I think if you try it, |
I don't know jj code, but I've assumed it stores references to Git commits and it'd be possible to only recrate the reference. |
Is it really the change ID that is divergent? It seems like the change ID is the thing being managed by the tool, so there are commands to manipulate commits that comprise the change. |
Correct. "commit ID" should be considered a content hash including "change ID". The change ID isn't actually stored in Git commit object, but changing it without updating commit ID would lead to internal data inconsistency. Regarding command name, I feel reassigning change IDs is quite different operation than resetting author or description (even though the underlying representation is similar.) |
Is your feature request related to a problem? Please describe.
If there are multiple commits with the same change ID and I want to keep both versions of them for some reason, it can be difficult to resolve the divergent change ID. I think it would be nice if there was a command that just replaces all commits in a revset with identical commits, except with new change IDs.
Describe the solution you'd like
I'm not sure what a good name for such a command would be, since
jj reset-change-id
seems too long. Maybe it would be good to have a general commandjj reset
that takes different flags depending on what needs to be reset:This might be confusing with
git reset
, so it might not be a good idea. I do feel like this would be a better place to put "reset author" though, since the currentjj describe --reset-author
feels like an unintuitive place to put it.Another option might be a
change-id
subcommand, but I'm not sure if there's any other operations on change IDs that would be useful. Maybe swapping change IDs could be useful (e.g. ifjj split
left the change ID on the wrong commit), but that seems like a weird solution.Describe alternatives you've considered
jj duplicate
followed byjj abandon
of the original commits works. This could maybe be done with an alias if aliases could execute multiple commands and take arguments to pass to each. Or maybe a new option likejj duplicate --replace <REVSET>
could duplicate the commits, but automatically abandon the previous versions and rebase their descendants onto the new commits.The text was updated successfully, but these errors were encountered: