-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
potentially invoke lfs for 'git update-index' #2647
Conversation
test/test-clone.sh
Outdated
@@ -119,6 +123,7 @@ begin_test "cloneSSL" | |||
|
|||
newclonedir="testcloneSSL1" | |||
git lfs clone "$SSLGITSERVER/$reponame" "$newclonedir" 2>&1 | tee lfsclone.log | |||
#assert_clean_status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this commented intentionally?
@@ -459,7 +459,7 @@ func DefaultRemote() (string, error) { | |||
} | |||
|
|||
func UpdateIndexFromStdin() *subprocess.Cmd { | |||
return gitNoLFS("update-index", "-q", "--refresh", "--stdin") | |||
return git("update-index", "-q", "--refresh", "--stdin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, here is my understanding:
We hit this code path only if we manually resolve the Git LFS pointers. Manually here means: we don't use the Git clean/smudge mechanism. This happens in the git lfs clone ...
and git lfs pull
calls. In these calls the following happens:
- Git checks out all files without running the Git LFS filters. We have the Git LFS pointer files checked out as a result.
- Git LFS iterates over all pointer files and replaces them with the actual content
- Git LFS asks Git to re-index the changed content (this happens with the
update-index
call above). During the re-index Git needs toclean
the real content to calculate the pointer file and compare that against the version stored in the repository. This waygit status
can tell us if the file was changed or not.
--> I think it makes sense to run Git with the clean filter here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the single commented line everything looks good to me!
Thanks for the review 🤘 |
Your welcome! Do you know when 2.3.3 will be released with the fix? |
I have some stuff this morning, but I could release it this afternoon. Though, I don't think a friday afternoon release is a good idea, so I'm leaning towards Monday. What do you think? |
I trust your judgement here. I agree with the Friday argument. However, this is a pretty nasty bug, too. |
In commit caaa0f9 of PR git-lfs#2647 and number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as check that after those commands are invoked, a "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so will fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, as a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). This bug was already in place at the time of PR git-lfs#2647, and so the assertions are never actually performed in these tests. We expect to address this problem in a subsequent commit in this PR, and when we do so, the test "cloneSSL" test will fail because the assert_clean_status() call is made without having changed the current working directory to that of the cloned repository's working tree. Therefore we move the assertion to the end of the block of checks performed after the "pushd" shell command is used to change the directory to that of the new clone's working tree. We also take the opportunity to add the assert_clean_status() calls to a number of other tests in the t/t-clone.sh script, so they are all performing similar sets of checks. This will help keep our tests in closer aligment with each other.
In commit caaa0f9 of PR git-lfs#2647 and number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as check that after those commands are invoked, a "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so will fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, as a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). This bug was already in place at the time of PR git-lfs#2647, and so the assertions are never actually performed in these tests. We expect to address this problem in a subsequent commit in this PR, and when we do so, the test "cloneSSL" test will fail because the assert_clean_status() call is made without having changed the current working directory to that of the cloned repository's working tree. Therefore we move the assertion to the end of the block of checks performed after the "pushd" shell command is used to change the directory to that of the new clone's working tree. We also take the opportunity to add the assert_clean_status() calls to a number of other tests in the t/t-clone.sh script, so they are all performing similar sets of checks. This will help keep our tests in closer aligment with each other.
In commit caaa0f9 of PR git-lfs#2647 and number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as check that after those commands are invoked, a "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so will fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, as a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). This bug was already in place at the time of PR git-lfs#2647, and so the assertions are never actually performed in these tests. We expect to address this problem in a subsequent commit in this PR, and when we do so, the test "cloneSSL" test will fail because the assert_clean_status() call is made without having changed the current working directory to that of the cloned repository's working tree. Therefore we move the assertion to the end of the block of checks performed after the "pushd" shell command is used to change the directory to that of the new clone's working tree. We also take the opportunity to add the assert_clean_status() calls to a number of other tests in the t/t-clone.sh script, so they are all performing similar sets of checks. This will help keep our tests in closer aligment with each other.
In commit caaa0f9 of PR git-lfs#2647 a number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as to check that after those commands are invoked, the "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so should fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). Instead, the tests exit early and always declare success. We will address this problem in a subsequent commit in this PR, and when we do so, the "cloneSSL" test will fail because the misplaced assertion. Therefore we move the assertion into the block of checks performed after a "pushd" shell command changes the current directory to that of the new clone's working tree, which will allow the test to pass when we resolve the bug with the TRAVIS variable check. We also take the opportunity to add assert_clean_status() calls to a number of other tests in the t/t-clone.sh test script, so the tests are all performing similar sets of checks. This will help us keep the tests in that script more consistent with each other in the future.
In commit caaa0f9 of PR git-lfs#2647 a number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as to check that after those commands are invoked, the "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so should fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). Instead, the tests exit early and always declare success. We will address this problem in a subsequent commit in this PR, and when we do so, the "cloneSSL" test will fail because the misplaced assertion. Therefore we move the assertion into the block of checks performed after a "pushd" shell command changes the current directory to that of the new clone's working tree, which will allow the test to pass when we resolve the bug with the TRAVIS variable check. We also take the opportunity to add assert_clean_status() calls to a number of other tests in the t/t-clone.sh test script, so the tests are all performing similar sets of checks. This will help us keep the tests in that script more consistent with each other in the future.
In commit caaa0f9 of PR git-lfs#2647 a number of tests of the "git lfs clone" and "git lfs pull" commands were enhanced so as to check that after those commands are invoked, the "git status" command returns a "working tree clean" message. To perform these checks, a call to our assert_clean_status() shell function was added to the tests. In the case of the "cloneSSL" test, an assert_clean_status() call was added, but left commented out; it was then uncommented in commit e0eede1 of the same PR. Unfortunately, the call is made when the current working directory has not yet been changed to that of the newly cloned repository's working tree, and so should fail as it stands now. However, as described in git-lfs#5658, the "cloneSSL" test and the "clone ClientCert" tests in our t/t-clone.sh test script do not actually run to completion, a consequence of an improper check of the TRAVIS variable (which is no longer used since we migrated our test suite to GitHub Actions in PR git-lfs#3808). Instead, the tests exit early and always declare success. We will address this problem in a subsequent commit in this PR, and when we do so, the "cloneSSL" test will fail because the misplaced assertion. Therefore we move the assertion into the block of checks performed after a "pushd" shell command changes the current directory to that of the new clone's working tree, which will allow the test to pass when we resolve the bug with the TRAVIS variable check. We also take the opportunity to add assert_clean_status() calls to a number of other tests in the t/t-clone.sh test script, so the tests are all performing similar sets of checks. This will help us keep the tests in that script more consistent with each other in the future.
Brings LFS back for
git update-index
calls. This fixes issues wheregit status
is unclean after agit lfs pull
orgit lfs clone
./cc #2646 (comment)