Skip to content

git-p4: use lfs.storage instead of local .git/lfs

r.burenkov via GitGitGadget git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 5 repliesIn review
  2. v11 patch 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1"git lfs" allows users to specify the custom storage location by configuration variable lfs.storage, but when "git p4" interacts with GitLFS pointers, it always used the hardcoded default that is the .git/lfs/ directory, without paying attention to the configuration.git-p4.py+8 -25 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/1] git-p4: use lfs.storage instead of local .git/lfs

Use lfs.storage if it defined in git.config. If lfs.storage not define - used local .git/lfs.

Original code uses local .git/lfs in sync/clone operations, but if you have external lfs storage better to use it.

panzercheg (1):
"git lfs" allows users to specify the custom storage location by
configuration variable lfs.storage, but when "git p4" interacts with GitLFS pointers, it always used the hardcoded default that is the .git/lfs/ directory, without paying attention to the configuration.

 git-p4.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

base-commit: d9f6f3b6195a0ca35642561e530798ad1469bd41
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-483%2Fpanzercheg%2Fgit-p4-improve-lfs-logic-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-483/panzercheg/git-p4-improve-lfs-logic-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/483

Range-diff vs v1:

1: 73d0dfc9dd ! 1: e65375c528 git-p4: use lfs.storage instead of local .git/lfs Use lfs.storage if it defined in git.config. If lfs.storage not define - used local .git/lfs. Original code uses local .git/lfs in sync/clone operations, but if you have external lfs storage better to use it.
@@ -1,10 +1,13 @@
Author: panzercheg <[email protected]>

- git-p4: use lfs.storage instead of local .git/lfs
- Use lfs.storage if it defined in git.config.
- If lfs.storage not define - used local .git/lfs.
- Original code uses local .git/lfs in sync/clone operations,
- but if you have external lfs storage better to use it.
+ "git lfs" allows users to specify the custom storage location by
+ configuration variable lfs.storage, but when "git p4" interacts
+ with GitLFS pointers, it always used the hardcoded default that
+ is the .git/lfs/ directory, without paying attention to the
+ configuration.
+
+ Use the value configured in lfs.storage, if exists, as all the
+ "git" operations do, for consistency.

@@ -16,9 +19,11 @@

oid = re.search(r'^oid \w+:(\w+)', pointerFile, re.MULTILINE).group(1)
+ # if someone use external lfs.storage ( not in local repo git )
-+ lfs_path = os.path.join(os.getcwd(), '.git', 'lfs')
-+ if gitConfig('lfs.storage'):
-+ lfs_path = gitConfig('lfs.storage')
++ lfs_path = gitConfig('lfs.storage')
++ if not lfs_path:
++ lfs_path = 'lfs'
++ if not os.path.isabs(lfs_path):
++ lfs_path = os.path.join(os.getcwd(), '.git', lfs_path)
localLargeFile = os.path.join(
- os.getcwd(),
- '.git', 'lfs', 'objects', oid[:2], oid[2:4],

Signature · 1 line
gitgitgadget