HomePhabricator

Detect LFS by looking for tracks in ".gitattributes" instead of using "ls-tree"

Description

Detect LFS by looking for tracks in ".gitattributes" instead of using "ls-tree"

Summary:
See PHI1718. See also https://discourse.phabricator-community.org/t/arc-diff-fails-due-to-git-cmd-fails/3680/.

Currently, arc diff detects Git LFS with git ls-files -z -- ':(attr:filter=lfs)' magic. This is an accurate test, but does not work on older Git.

Try a simpler, dumber test and see if that will work. If this also has issues, we can try this stuff:

  • do version detection;
  • pipe the whole tree to git check-attr;
  • try a command like git lfs ls-files instead, which is probably a wrapper on one of these other commands.

Test Plan:

  • In a non-LFS repository, ran "arc diff" and saw the repository detect as non-LFS.
  • In an LFS repository, ran "arc diff" and saw the repository detect as LFS.

Differential Revision: https://secure.phabricator.com/D21190

Details

Provenance
epriestleyAuthored on Apr 29 2020, 11:13 PM
epriestleyPushed on Apr 29 2020, 11:23 PM
Differential Revision
D21190: Detect LFS by looking for tracks in ".gitattributes" instead of using "ls-tree"
Parents
rARC6ec09b2f482a: Replace "PhutilFileTree" with a more abstract "VectorTree"
Branches
Unknown
Tags
Unknown
Build Status
Buildable 24281
Build 33447: Run Core Tests