git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] git-p4 shouldn't attempt to store symlinks in LFS

From
MMMatthew McClain <mmcclain@noprivs.com>
Date
Oct 19, 2023, 00:25 UTC
Message-ID
<20231019002558.867830-1-mmcclain@noprivs.com>
In-Reply-To
<ZTBbqobbqQpxHPI2@tapette.crustytoothpaste.net>

git-p4.py would attempt to put a symlink in LFS if its file extension matched git-p4.largeFileExtensions.

Git LFS doesn't store symlinks because smudge/clean filters don't handle symlinks. They never get passed to the filter process nor the smudge/clean filters, nor could that occur without a change to the protocol or command-line interface. Unless Git learned how to send them to the filters, Git LFS would have a hard time using them in any useful way.

Git LFS's goal is to move large files out of the repository history, and symlinks are functionally limited to 4 KiB or a similar size on most systems.

Signed-off-by: Matthew McClain <mmcclain@noprivs.com>
---
 git-p4.py | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/git-p4.py b/git-p4.py
index d26a980e5a..0eb3bb4c47 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1522,6 +1522,10 @@ def processContent(self, git_mode, relPath, contents):
            file is stored in the large file system and handles all necessary
            steps.
            """
+        # symlinks aren't processed by smudge/clean filters
+        if git_mode == "120000":
+            return (git_mode, contents)
+
         if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
             contentTempFile = self.generateTempFile(contents)
             pointer_git_mode, contents, localLargeFile = self.generatePointer(contentTempFile)
-- 
2.39.3
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “git-p4 shouldn't attempt to store symlinks in LFS”
  1. git-p4 shouldn't attempt to store symlinks in LFSMatthew McClain, Oct 18, 2023
  2. Junio C HamanoOct 18, 2023
  3. brian m. carlsonOct 18, 2023
  4. Junio C HamanoOct 18, 2023
  5. git-p4 shouldn't attempt to store symlinks in LFSMatthew McClain, Oct 19, 2023
  6. Junio C HamanoOct 19, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.