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

Re: [PATCH v3] fast-import: do not write bad delta for replaced subtrees

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 20, 2011, 15:43 UTC
Message-ID
<20110820154356.GB15864@elie.gateway.2wire.net>
In-Reply-To
<m262lspi0h.fsf@linux-m68k.org>
Andreas Schwab wrote:
> $ git grep S_ISUID
> compat/mingw.h:#define S_ISUID 0

Good catch, thanks. Fix below --- despite appearances, this "mode" field is about tree objects in the repository and there is no need to match the current platform's file status conventions.

Another worrisome detail is that the patch changes the semantics of tree_entry.versions[0].mode (by introducing the NO_DELTA bit) without changing its name. It would be safer to rename it to te_mode or something.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
diff --git i/fast-import.c w/fast-import.c
index 95919b63..45e2128a 100644
--- i/fast-import.c
+++ w/fast-import.c
@@ -173,7 +173,7 @@ Format of STDIN stream:
 /*
  * We abuse the setuid bit on directories to mean "do not delta".
  */
-#define NO_DELTA S_ISUID
+#define NO_DELTA 04000
 
 struct object_entry {
 	struct pack_idx_entry idx;
Previous: Andreas SchwabNext: Dmitry Ivankov
Message 11 of 14 in “fix data corruption in fast-import”
  1. 0/3 fix data corruption in fast-importDmitry Ivankov, Aug 12, 2011
  2. 1/3 fast-import: extract object preparation functionDmitry Ivankov, Aug 12, 2011
  3. 2/3 fast-import: add a check for tree delta base sha1Dmitry Ivankov, Aug 12, 2011
  4. Jonathan NiederAug 13, 2011
  5. 3/3 fast-import: prevent producing bad deltaDmitry Ivankov, Aug 12, 2011
  6. 0/2 fix data corruption in fast-importDmitry Ivankov, Aug 14, 2011
  7. 1/2 fast-import: add a test for tree delta base corruptionDmitry Ivankov, Aug 14, 2011
  8. 2/2 fast-import: prevent producing bad deltaDmitry Ivankov, Aug 14, 2011
  9. fast-import: do not write bad delta for replaced subtreesJonathan Nieder, Aug 20, 2011
  10. Andreas SchwabAug 20, 2011
  11. Jonathan NiederAug 20, 2011
  12. fast-import: do not write bad delta for replaced subtreesDmitry Ivankov, Aug 20, 2011
  13. Jonathan NiederAug 20, 2011
  14. Dmitry IvankovAug 20, 2011

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.