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

[PATCH] git-p4: reverse large file detection order

From
Sam Hocevar <sam@hocevar.net>
Date
Feb 28, 2020, 15:07 UTC
Message-ID
<20200228150710.ikgijcxlft5wjl3h@hocevar.net>

It is more efficient to first check for a file's extension against git-p4.largeFileExtensions before git-p4.largeFileCompressedThreshold because the latter test may trigger a costly compression task.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git git-p4.py git-p4.py
index 40d9e7c594..a54970aa74 100755
--- git-p4.py
+++ git-p4.py
@@ -1197,7 +1197,7 @@ def processContent(self, git_mode, relPath, contents):
         """Processes the content of git fast import. This method decides if a
            file is stored in the large file system and handles all necessary
            steps."""
-        if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
+        if self.hasLargeFileExtension(relPath) or self.exceedsLargeFileThreshold(relPath, contents):
             contentTempFile = self.generateTempFile(contents)
             (pointer_git_mode, contents, localLargeFile) = self.generatePointer(contentTempFile)
             if pointer_git_mode:
-- 
2.25.1
Message 1 of 1 in “git-p4: reverse large file detection order”
  1. git-p4: reverse large file detection orderSam Hocevar, Feb 28, 2020

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.