* [PATCH] git-tar-tree: Lift path length limit
@ 2005-05-07 0:25 Rene Scharfe
2005-05-07 0:57 ` Rene Scharfe
0 siblings, 1 reply; 4+ messages in thread
From: Rene Scharfe @ 2005-05-07 0:25 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git, Petr Baudis
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-tar-tree: Lift path length limit
2005-05-07 0:25 [PATCH] git-tar-tree: Lift path length limit Rene Scharfe
@ 2005-05-07 0:57 ` Rene Scharfe
2005-05-07 12:09 ` Petr Baudis
0 siblings, 1 reply; 4+ messages in thread
From: Rene Scharfe @ 2005-05-07 0:57 UTC (permalink / raw)
To: Linus Torvalds, Petr Baudis; +Cc: git
On Sat, May 07, 2005 at 02:25:27AM +0200, Rene Scharfe wrote:
> Last minute patch?
This leaks memory. D'oh!
Petr, would you add the (hopefully) fixed version below to your tree now
that Linus is on vacation? (Patch applies to tip of GIT tree.)
Thanks,
Rene
Lift path length limits from git-tar-tree.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
commit d36797f64ee0431e6a73aa1c77a7fe7c18b6ce9f
tree ab8e6967a08ac343b69b527f663e6a9722fcea08
parent bf60144c0ab50e88c0086a90c5cb35b81613ad14
author Rene Scharfe <rene.scharfe@lsrfire.ath.cx> 1115322098 +0200
committer Rene Scharfe <rene.scharfe@lsrfire.ath.cx> 1115322098 +0200
Index: tar-tree.c
===================================================================
--- 8ef25a2788d6c225641a3040622b82c364f987b8/tar-tree.c (mode:100644 sha1:9d9bd7be98502f64e4a643ef0973182f3483251e)
+++ ab8e6967a08ac343b69b527f663e6a9722fcea08/tar-tree.c (mode:100644 sha1:8b0d75bd2cf12a531aee3d51e59a8ac8102ba6be)
@@ -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,19 @@
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);
+ free(buffer);
}
static void write_global_extended_header(const char *sha1)
@@ -269,9 +270,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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-tar-tree: Lift path length limit
2005-05-07 0:57 ` Rene Scharfe
@ 2005-05-07 12:09 ` Petr Baudis
2005-05-07 18:42 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Petr Baudis @ 2005-05-07 12:09 UTC (permalink / raw)
To: Rene Scharfe; +Cc: Linus Torvalds, git
Dear diary, on Sat, May 07, 2005 at 02:57:06AM CEST, I got a letter
where Rene Scharfe <rene.scharfe@lsrfire.ath.cx> told me that...
> On Sat, May 07, 2005 at 02:25:27AM +0200, Rene Scharfe wrote:
> > Last minute patch?
>
> This leaks memory. D'oh!
>
> Petr, would you add the (hopefully) fixed version below to your tree now
> that Linus is on vacation? (Patch applies to tip of GIT tree.)
It appears to me that the patch currently in the git tree is this
(correct) one?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-tar-tree: Lift path length limit
2005-05-07 12:09 ` Petr Baudis
@ 2005-05-07 18:42 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2005-05-07 18:42 UTC (permalink / raw)
To: Petr Baudis; +Cc: Rene Scharfe, Linus Torvalds, git
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
PB> Dear diary, on Sat, May 07, 2005 at 02:57:06AM CEST, I got a letter
PB> where Rene Scharfe <rene.scharfe@lsrfire.ath.cx> told me that...
>> On Sat, May 07, 2005 at 02:25:27AM +0200, Rene Scharfe wrote:
>> > Last minute patch?
>>
>> This leaks memory. D'oh!
>>
>> Petr, would you add the (hopefully) fixed version below to your tree now
>> that Linus is on vacation? (Patch applies to tip of GIT tree.)
PB> It appears to me that the patch currently in the git tree is this
PB> (correct) one?
Yes it was merged before Linus left the machine last night.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-07 18:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-07 0:25 [PATCH] git-tar-tree: Lift path length limit Rene Scharfe
2005-05-07 0:57 ` Rene Scharfe
2005-05-07 12:09 ` Petr Baudis
2005-05-07 18:42 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).