Thread (1 message) 1 message, 1 author, 2016-06-15

Re: full kernel history, in patchset format

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:52

quoted
quoted
quoted
quoted
"PB" == Petr Baudis [off-list ref] writes:
PB> P.S.: It seems that Linus applied a patch to ls-tree which will make it
PB> read_sha1_file() on each item when ls-tree is recursive. Junio, why did
PB> you do it?

Sorry it was my misunderstanding, before I found out exactly how
S_ISDIR is used.  Thank you for pointing it out.

I was confused by this comment around the area I changed:

    /* XXX: We do some ugly mode heuristics here.
     * It seems not worth it to read each file just to get this
     * and the file size. -- pasky@ucw.cz

I mistakenly inferred from that comment that S_ISDIR(mode) is
not a guarantee.  So I mistakenly optimized it for non-recursive
case by keeping that "heuristics".  The logic was: If recursive
we will need to run read_sha1_file() to find out if it is really
a tree anyway.

I'll fix it up, now I know S_ISDIR(mode) is a guarantee that it
is a tree, I'll do the "heuristics" first, and do read_sha1_file
only when it is a tree and I am recursive.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help