<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/tree.c, branch v1.5.4.4</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.4.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.5.4.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2007-08-10T18:44:23Z</updated>
<entry>
<title>Optimize "diff --cached" performance.</title>
<updated>2007-08-10T18:44:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-08-09T20:42:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=af3785dc5a76f4d5ddb8039e33c322e0e8b60e72'/>
<id>urn:sha1:af3785dc5a76f4d5ddb8039e33c322e0e8b60e72</id>
<content type='text'>
The read_tree() function is called only from the call chain to
run "git diff --cached" (this includes the internal call made by
git-runstatus to run_diff_index()).  The function vacates stage
without any funky "merge" magic.  The caller then goes and
compares stage #1 entries from the tree with stage #0 entries
from the original index.

When adding the cache entries this way, it used the general
purpose add_cache_entry().  This function looks for an existing
entry to replace or if there is none to find where to insert the
new entry, resolves D/F conflict and all the other things.

For the purpose of reading entries into an empty stage, none of
that processing is needed.  We can instead append everything and
then sort the result at the end.

This commit changes read_tree() to first make sure that there is
no existing cache entries at specified stage, and if that is the
case, it runs add_cache_entry() with ADD_CACHE_JUST_APPEND flag
(new), and then sort the resulting cache using qsort().

This new flag tells add_cache_entry() to omit all the checks
such as "Does this path already exist?  Does adding this path
remove other existing entries because it turns a directory to a
file?" and instead append the given cache entry straight at the
end of the active cache.  The caller of course is expected to
sort the resulting cache at the end before using the result.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sv/objfixes'</title>
<updated>2007-06-06T22:43:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-06-06T22:43:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d44c782bbd6b0e806e056f9e8ff8cd8e426e67a3'/>
<id>urn:sha1:d44c782bbd6b0e806e056f9e8ff8cd8e426e67a3</id>
<content type='text'>
* sv/objfixes:
  Don't assume tree entries that are not dirs are blobs
  git-cvsimport: Make sure to use $git_dir always instead of .git sometimes
  fix documentation of unpack-objects -n
  Accept dates before 2000/01/01 when specified as seconds since the epoch
</content>
</entry>
<entry>
<title>Don't assume tree entries that are not dirs are blobs</title>
<updated>2007-06-06T22:43:18Z</updated>
<author>
<name>Sam Vilain</name>
<email>sam.vilain@catalyst.net.nz</email>
</author>
<published>2007-06-06T10:25:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e2ac7cb5fbcf1407003aa07cdcd14141527ea2e3'/>
<id>urn:sha1:e2ac7cb5fbcf1407003aa07cdcd14141527ea2e3</id>
<content type='text'>
When scanning the trees in track_tree_refs() there is a "lazy" test
that assumes that entries are either directories or files.  Don't do
that.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rename dirlink to gitlink.</title>
<updated>2007-05-22T06:34:54Z</updated>
<author>
<name>Martin Waitz</name>
<email>tali@admingilde.org</email>
</author>
<published>2007-05-21T20:08:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=302b9282c9ddfcc704ca759bdc98c1d5f75eba2f'/>
<id>urn:sha1:302b9282c9ddfcc704ca759bdc98c1d5f75eba2f</id>
<content type='text'>
Unify naming of plumbing dirlink/gitlink concept:

git ls-files -z '*.[ch]' |
xargs -0 perl -pi -e 's/dirlink/gitlink/g;' -e 's/DIRLNK/GITLINK/g;'

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lt/objalloc'</title>
<updated>2007-04-22T00:42:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2007-04-22T00:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=42c4b58059fa9af65e90f2c418bb551e30d1d32f'/>
<id>urn:sha1:42c4b58059fa9af65e90f2c418bb551e30d1d32f</id>
<content type='text'>
* 'lt/objalloc':
  Clean up object creation to use more common code
  Use proper object allocators for unknown object nodes too
</content>
</entry>
<entry>
<title>Clean up object creation to use more common code</title>
<updated>2007-04-17T06:36:16Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-04-17T05:11:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=100c5f3b0b27ec6617de1a785c4ff481e92636c1'/>
<id>urn:sha1:100c5f3b0b27ec6617de1a785c4ff481e92636c1</id>
<content type='text'>
This replaces the fairly odd "created_object()" function that did _most_
of the object setup with a more complete "create_object()" function that
also has a more natural calling convention.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Teach "fsck" not to follow subproject links</title>
<updated>2007-04-10T20:46:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-04-10T04:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=8d9721c86b0169c282ad1c5528317eafeb7fb0f7'/>
<id>urn:sha1:8d9721c86b0169c282ad1c5528317eafeb7fb0f7</id>
<content type='text'>
Since the subprojects don't necessarily even exist in the current tree,
much less in the current git repository (they are totally independent
repositories), we do not want to try to follow the chain from one git
repository to another through a gitlink.

This involves teaching fsck to ignore references to gitlink objects from
a tree and from the current index.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Initialize tree descriptors with a helper function rather than by hand.</title>
<updated>2007-03-21T17:21:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-03-21T17:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6fda5e5180c2e7c130978361aea53b4e66f36823'/>
<id>urn:sha1:6fda5e5180c2e7c130978361aea53b4e66f36823</id>
<content type='text'>
This removes slightly more lines than it adds, but the real reason for
doing this is that future optimizations will require more setup of the
tree descriptor, and so we want to do it in one place.

Also renamed the "desc.buf" field to "desc.buffer" just to trigger
compiler errors for old-style manual initializations, making sure I
didn't miss anything.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Remove "pathlen" from "struct name_entry"</title>
<updated>2007-03-21T17:21:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-03-21T17:07:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a8c40471ab0851bf9a58f7dc76f121258e0690e2'/>
<id>urn:sha1:a8c40471ab0851bf9a58f7dc76f121258e0690e2</id>
<content type='text'>
Since we have the "tree_entry_len()" helper function these days, and
don't need to do a full strlen(), there's no point in saving the path
length - it's just redundant information.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Trivial cleanup of track_tree_refs()</title>
<updated>2007-03-19T08:48:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-03-18T20:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c711a214c1e9a4dfb5043bc1a11d0f76313b097e'/>
<id>urn:sha1:c711a214c1e9a4dfb5043bc1a11d0f76313b097e</id>
<content type='text'>
This makes "track_tree_refs()" use the same "tree_entry()" function for
counting the entries as it does for actually traversing them a few lines
later.

Not a biggie, but the reason I care was that this was the only user of
"update_tree_entry()" that didn't actually *extract* the tree entry first.
It doesn't matter as things stand now, but it meant that a separate
test-patch I had that avoided a few more "strlen()" calls by just saving
the entry length in the entry descriptor and using it directly when
updating wouldn't work without this patch.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
