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

[PATCH] git-tar-tree: Lift path length limit

From
Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
May 7, 2005, 00:25 UTC
Message-ID
<20050507002527.GA5082@lsrfire.ath.cx>

Last minute patch? This lifts the limits from path length and link path length that are in git-tar-tree.

Have a nice vacation!
Rene
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>

--- commit 2d7b8f2afc47c753aaab4bf48587fdea730b0db3 tree 378fae86e43460c1c53feccbde3573ced26818f6 parent a02ebff6127c5fc981668fb570f0a80f2b7657ca author Rene Scharfe <rene.scharfe@lsrfire.ath.cx> 1115320521 +0200 committer Rene Scharfe <rene.scharfe@lsrfire.ath.cx> 1115320521 +0200

Index: tar-tree.c
===================================================================
--- 8477488c1965186c98b59ad0da04d221aff3c9a1/tar-tree.c  (mode:100644 sha1:a09cb416595094e493a52dd7f45d943c81c0310a)
+++ 378fae86e43460c1c53feccbde3573ced26818f6/tar-tree.c  (mode:100644 sha1:0fb6514c27a0f0edc2fc6e9850c361c8a58c0a9f)
@@ -212,7 +212,7 @@
                                   const char *path, unsigned int namelen,
                                   void *content, unsigned int contentsize)
 {
-	char *p;
+	char *buffer, *p;
 	unsigned int pathlen, size, linkpathlen = 0;
 
 	size = pathlen = extended_header_len("path", namelen);
@@ -220,18 +220,18 @@
 		linkpathlen = extended_header_len("linkpath", contentsize);
 		size += linkpathlen;
 	}
-	if (size > RECORDSIZE)
-		die("tar-tree: extended header too big, wtf?");
 	write_header(NULL, TYPEFLAG_EXT_HEADER, NULL, NULL, headerfilename,
 	             0100600, NULL, size);
 
-	p = get_record();
+	buffer = p = malloc(size);
+	if (!buffer)
+		die("git-tar-tree: %s", strerror(errno));
 	append_extended_header_prefix(&p, pathlen, "path");
 	append_path(&p, is_dir, basepath, prefix, path);
 	append_char(&p, '\n');
 	if (flags & EXT_HEADER_LINKPATH)
 		append_extended_header(&p, "linkpath", content, contentsize);
-	write_if_needed();
+	write_blocked(buffer, size);
 }
 
 static void write_global_extended_header(const char *sha1)
@@ -269,9 +269,7 @@
 	}
 
 	namelen = path_len(S_ISDIR(mode), basepath, prefix, path);
-	if (namelen > 500)
-		die("tar-tree: name too log of object %s\n", sha1_to_hex(sha1));
-	else if (namelen > 100)
+	if (namelen > 100)
 		ext_header |= EXT_HEADER_PATH;
 	if (typeflag == TYPEFLAG_LNK && size > 100)
 		ext_header |= EXT_HEADER_LINKPATH;
Next: Rene Scharfe
Message 1 of 4 in “git-tar-tree: Lift path length limit”
  1. git-tar-tree: Lift path length limitRene Scharfe, May 7, 2005
  2. Rene ScharfeMay 7, 2005
  3. Petr BaudisMay 7, 2005
  4. Junio C HamanoMay 7, 2005

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.