-
Notifications
You must be signed in to change notification settings - Fork 343
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
git: Avoid resetting Git index when trees are identical #3767
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mlcui-corp
commented
May 27, 2024
yuja
approved these changes
May 27, 2024
mlcui-corp
added a commit
to mlcui-corp/jj
that referenced
this pull request
May 28, 2024
This shares some common code to both the root and the non-root case, and provides easier access to `mut_repo` in the function - as `set_git_head_target` mutably borrows `mut_repo`. This will be used for a cleaner implementation of jj-vcs#3767.
mlcui-corp
added a commit
to mlcui-corp/jj
that referenced
this pull request
May 28, 2024
This shares some common code to both the root and the non-root case, and provides easier access to `mut_repo` in the function - as `set_git_head_target` mutably borrows `mut_repo`. This will be used for a cleaner implementation of jj-vcs#3767.
mlcui-corp
force-pushed
the
push-tmmpsusnvoku
branch
from
May 28, 2024 05:25
aea276b
to
d799707
Compare
4 tasks
mlcui-corp
changed the title
git: Avoid resetting HEAD when trees are identical
@mlcui-corp git: Avoid resetting Git index when trees are identical
May 28, 2024
mlcui-corp
changed the title
@mlcui-corp git: Avoid resetting Git index when trees are identical
git: Avoid resetting Git index when trees are identical
May 28, 2024
DO NOT SUBMIT until #3774 is merged. |
mlcui-corp
force-pushed
the
push-tmmpsusnvoku
branch
from
May 29, 2024 05:35
d799707
to
3149f83
Compare
mlcui-corp
added a commit
that referenced
this pull request
May 29, 2024
This shares some common code to both the root and the non-root case, and provides easier access to `mut_repo` in the function - as `set_git_head_target` mutably borrows `mut_repo`. This will be used for a cleaner implementation of #3767.
This accounts for commit message-only changes which do not change the tree ID, as well as checkouts between commits with identical tree contents. See jj-vcs#3748 for previous work on avoiding resetting HEAD when the *commits* are identical.
mlcui-corp
force-pushed
the
push-tmmpsusnvoku
branch
from
May 29, 2024 05:48
3149f83
to
ec3d391
Compare
Please take another look, thanks! This should be much cleaner now. |
yuja
approved these changes
May 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This accounts for commit message-only changes which do not change the tree ID, as well as checkouts between commits with identical tree contents.
See #3748 for previous work on avoiding resetting HEAD when the commits are identical.
Checklist
If applicable:
CHANGELOG.md