Skip to content

Do not delete zero-sized file from LFS storage - #3864

Merged
bk2204 merged 1 commit into
git-lfs:masterfrom
slonopotamus:empty-file
Oct 17, 2019
Merged

bk2204 merged 1 commit into
git-lfs:masterfrom
slonopotamus:empty-file

Conversation

@slonopotamus

Copy link
Copy Markdown
Contributor

Because it:

  1. Doesn't add any value
  2. Introduces a source of race conditions to download logic when multiple git-lfs instances share LFS storage
  3. Forces git-lfs to oscillate between two strange states when empty file is downloaded from LFS server. See Git LFS doesn't properly handle zero-sized file #3863

Because it:
1. Doesn't add any value
2. Introduces a source of race conditions to download logic when multiple git-lfs instances share LFS storage
3. Forces git-lfs to oscillate between two strange states when empty file is downloaded from LFS server. See git-lfs#3863

@bk2204 bk2204 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a fine workaround for the problem. Just be aware that we'll likely reject these pointer files in a future release, since we know that pointer files that don't round-trip cause Git to randomly show files as modified.

@bk2204
bk2204 merged commit 43571ad into git-lfs:master Oct 17, 2019
@slonopotamus
slonopotamus deleted the empty-file branch October 17, 2019 15:46
@slonopotamus

Copy link
Copy Markdown
Contributor Author

Rejecting files will force us to rewrite history. This is much worse than marking files as modified. There are numerous scenarios that trigger marking files as modified, most trivial one is changing .gitattributes without renormalizing existing files in repository.

@mathstuf

Copy link
Copy Markdown
Contributor

Why would history rewrite be required for anything other than checking out older commits with the size 0 pointer? Why not replace it with empty content and work with all future LFS implementations?

@slonopotamus

Copy link
Copy Markdown
Contributor Author

Exactly for checking out old commits. I suggest continuing discussion in #3865. It aims at rejecting much more stuff than just zero-sized LFS pointer.

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