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

Re: [PATCH] pack-objects: use of version 3 delta is now optional.

From
Nicolas Pitre <nico@cam.org>
Date
Oct 15, 2006, 15:53 UTC
Message-ID
<Pine.LNX.4.64.0610151135110.17085@xanadu.home>
In-Reply-To
<7virim10rb.fsf@assigned-by-dhcp.cox.net>
On Sun, 15 Oct 2006, Junio C Hamano wrote:
Show 17 quoted lines
> This introduces a new configuration item, pack.deltaversion, to
> control whether pack-objects is allowed to use version 3 delta.
> By default, we keep generating version 2 delta (and version 2
> packfile format) to be compatible with git earlier than v1.2.0.
> 
> This configuration affects the command in the following ways:
> 
>  - the resulting packfile will have the specified version;
> 
>  - when generating delta, larger copies are allowed only when
>    deltaversion is 3;
> 
>  - the logic to reuse delta from existing packs refuses to reuse
>    delta from packs that uses delta version 3 when the
>    configuration is set to 2.
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>

I'd suggest to drop this altogether. See my previous email for my reasoning on this issue. I think this should be done another way.

If anything, maybe this patch can be added before v1.4.3 is released:
diff --git a/fetch-pack.c b/fetch-pack.c
index 7d23a80..1688417 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -165,9 +165,10 @@ static int find_common(int fd[2], unsign
 			continue;
 		}
 
-		packet_write(fd[1], "want %s%s%s\n", sha1_to_hex(remote),
+		packet_write(fd[1], "want %s%s%s%s\n", sha1_to_hex(remote),
 			     (multi_ack ? " multi_ack" : ""),
-			     (use_thin_pack ? " thin-pack" : ""));
+			     (use_thin_pack ? " thin-pack" : ""),
+			     " packv3");
 		fetching++;
 	}
 	packet_flush(fd[1]);
diff --git a/upload-pack.c b/upload-pack.c
index 979e583..8e57316 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -218,7 +218,7 @@ static int receive_needs(void)
 
 static int send_ref(const char *refname, const unsigned char *sha1)
 {
-	static char *capabilities = "multi_ack thin-pack";
+	static char *capabilities = "multi_ack thin-pack packv3";
 	struct object *o = parse_object(sha1);
 
 	if (!o)

This way pack v3 could be fed to GIT v1.4.3 and above whenever we add 
back pack v3 generation, and a pack converted to v2 from any v3 on the 
fly when that capability is not present.


Nicolas
Previous: Jakub NarebskiNext: Junio C Hamano
Message 4 of 22 in “Recent and near future backward incompatibilities”
  1. Junio C HamanoOct 15, 2006
  2. pack-objects: use of version 3 delta is now optional.Junio C Hamano, Oct 15, 2006
  3. Jakub NarebskiOct 15, 2006
  4. Nicolas PitreOct 15, 2006
  5. Junio C HamanoOct 15, 2006
  6. Jakub NarebskiOct 15, 2006
  7. Nicolas PitreOct 15, 2006
  8. Junio C HamanoOct 16, 2006
  9. Nicolas PitreOct 16, 2006
  10. Nicolas PitreOct 15, 2006
  11. A Large Angry SCMOct 15, 2006
  12. Nicolas PitreOct 16, 2006
  13. Linus TorvaldsOct 15, 2006
  14. Nicolas PitreOct 16, 2006
  15. Junio C HamanoOct 17, 2006
  16. Nicolas PitreOct 17, 2006
  17. A Large Angry SCMOct 15, 2006
  18. Nicolas PitreOct 15, 2006
  19. Junio C HamanoOct 15, 2006
  20. Theodore TsoOct 15, 2006
  21. Linus TorvaldsOct 15, 2006
  22. Stephen HemmingerOct 16, 2006

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.