Page MenuHomePhabricator

Restore the ":(attr:filter=lfs)" test for LFS
ClosedPublic

Authored by epriestley on Apr 30 2020, 4:01 AM.
Tags
None
Referenced Files
F18857697: D21192.diff
Sat, Nov 1, 5:08 PM
F18852180: D21192.id.diff
Fri, Oct 31, 7:18 AM
F18851109: D21192.diff
Thu, Oct 30, 10:19 PM
F18744729: D21192.id50469.diff
Oct 3 2025, 3:58 AM
F18734276: D21192.id.diff
Sep 30 2025, 10:51 PM
F18726771: D21192.id.diff
Sep 30 2025, 7:12 AM
F18721348: D21192.diff
Sep 29 2025, 8:57 PM
F18717859: D21192.id50470.diff
Sep 29 2025, 2:34 PM
Subscribers

Details

Summary

See D21190. The ".gitattributes" approach fails when ".gitattributes" is in a subdirectory (or global). These are probably unusual cases, but at least one is known in the wild.

Instead:

  • Restore the ":(attr:filter=lfs)" test, which seems to be the fastest accurate test available in modern Git.
  • If the test fails, assume the repository is not LFS. This only impacts users running very old versions of Git.
Test Plan
  • In LFS and non-LFS repositories, created diffs. Saw correct detection again.
  • Broke the command on purpose, saw LFS detection conclude "no LFS", but not fail disastrously.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable