Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

6 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:14

Nguyen Thai Ngoc Duy [off-list ref] writes:
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.  Besides, you can create
arbitrarily deep tree structure without busting the limit on the
filesystem by writing tree objects by hand.

In other words, all paths shouldn't exceed PATH_MAX, but the responsiblity
to verify that is _yours_.

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:14

On Tue, Dec 14, 2010 at 12:32 PM, Junio C Hamano [off-list ref] wrote:
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.  Besides, you can create
arbitrarily deep tree structure without busting the limit on the
filesystem by writing tree objects by hand.

In other words, all paths shouldn't exceed PATH_MAX, but the responsiblity
to verify that is _yours_.
OK. I can check and die if any path exceeds PATH_MAX.
-- 
Duy

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:50:14

Am 12/14/2010 6:32, schrieb Junio C Hamano:
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.
And that is not just gray theory: On Windows, PATH_MAX is whopping 260
characters!

-- Hannes

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:14

On Tue, Dec 14, 2010 at 2:32 PM, Johannes Sixt [off-list ref] wrote:
Am 12/14/2010 6:32, schrieb Junio C Hamano:
quoted
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.
And that is not just gray theory: On Windows, PATH_MAX is whopping 260
characters!
Does that mean Windows won't accept any path longer than that, or
PATH_MAX is defined just for fun?
-- 
Duy

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:50:14

Am 12/14/2010 8:43, schrieb Nguyen Thai Ngoc Duy:
On Tue, Dec 14, 2010 at 2:32 PM, Johannes Sixt [off-list ref] wrote:
quoted
Am 12/14/2010 6:32, schrieb Junio C Hamano:
quoted
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.
And that is not just gray theory: On Windows, PATH_MAX is whopping 260
characters!
Does that mean Windows won't accept any path longer than that, or
PATH_MAX is defined just for fun?
It is the limit for path names that we can have without MAJOR extra
efforts. It is not a limit implied by the file system.

-- Hannes

Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:14

On Tue, Dec 14, 2010 at 3:21 PM, Johannes Sixt [off-list ref] wrote:
Am 12/14/2010 8:43, schrieb Nguyen Thai Ngoc Duy:
quoted
On Tue, Dec 14, 2010 at 2:32 PM, Johannes Sixt [off-list ref] wrote:
quoted
Am 12/14/2010 6:32, schrieb Junio C Hamano:
quoted
Nguyen Thai Ngoc Duy [off-list ref] writes:
quoted
All paths should not exceed PATH_MAX, right?
Your PATH_MAX may be a lot shorter than the PATH_MAX on the system I
created my trees on that you are reading.
And that is not just gray theory: On Windows, PATH_MAX is whopping 260
characters!
Does that mean Windows won't accept any path longer than that, or
PATH_MAX is defined just for fun?
It is the limit for path names that we can have without MAJOR extra
efforts. It is not a limit implied by the file system.
Just googled around and found this [1]. I'm going with strbuf so it
can be reallocated if necessary. A bit tricky because "base" can be
moved, but I think it's worth it.

[1] http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help