<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/cache-tree.c, branch v1.8.3.3</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.3.3</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.3.3'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-12-16T07:04:22Z</updated>
<entry>
<title>cache-tree: invalidate i-t-a paths after generating trees</title>
<updated>2012-12-16T07:04:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-12-16T04:15:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=eec3e7e406867487036cf447fe8fa18740824b2f'/>
<id>urn:sha1:eec3e7e406867487036cf447fe8fa18740824b2f</id>
<content type='text'>
Intent-to-add entries used to forbid writing trees so it was not a
problem. After commit 3f6d56d (commit: ignore intent-to-add entries
instead of refusing - 2012-02-07), we can generate trees from an index
with i-t-a entries.

However, the commit forgets to invalidate all paths leading to i-t-a
entries. With fully valid cache-tree (e.g. after commit or
write-tree), diff operations may prefer cache-tree to index and not
see i-t-a entries in the index, because cache-tree does not have them.

Reported-by: Jonathon Mah &lt;me@JonathonMah.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: fix writing cache-tree when CE_REMOVE is present</title>
<updated>2012-12-16T07:04:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-12-16T04:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3cf773e4264ecc6e9f603a24aeb72cc68b372f96'/>
<id>urn:sha1:3cf773e4264ecc6e9f603a24aeb72cc68b372f96</id>
<content type='text'>
entry_count is used in update_one() for two purposes:

1. to skip through the number of processed entries in in-memory index
2. to record the number of entries this cache-tree covers on disk

Unfortunately when CE_REMOVE is present these numbers are not the same
because CE_REMOVE entries are automatically removed before writing to
disk but entry_count is not adjusted and still counts CE_REMOVE
entries.

Separate the two use cases into two different variables. #1 is taken
care by the new field count in struct cache_tree_sub and entry_count
is prepared for #2.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: replace "for" loops in update_one with "while" loops</title>
<updated>2012-12-16T07:04:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-12-16T04:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=386cc8b031611497186a8c89be0f980a54786525'/>
<id>urn:sha1:386cc8b031611497186a8c89be0f980a54786525</id>
<content type='text'>
The loops in update_one can be increased in two different ways: step
by one for files and by &lt;n&gt; for directories. "for" loop is not
suitable for this as it always steps by one and special handling is
required for directories. Replace them with "while" loops for clarity.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache-tree: remove dead i-t-a code in verify_cache()</title>
<updated>2012-12-16T07:04:21Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-12-16T04:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dbc3904ebc604bf5b818d9840b79228aacdd1343'/>
<id>urn:sha1:dbc3904ebc604bf5b818d9840b79228aacdd1343</id>
<content type='text'>
This code is added in 331fcb5 (git add --intent-to-add: do not let an
empty blob be committed by accident - 2008-11-28) to forbid committing
when i-t-a entries are present. When we allow that, we forgot to
remove this.

Noticed-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/cache-tree-api-refactor'</title>
<updated>2012-02-13T06:42:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-13T06:42:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a7844827da8273dcf030b9313bc381da3eac011d'/>
<id>urn:sha1:a7844827da8273dcf030b9313bc381da3eac011d</id>
<content type='text'>
* nd/cache-tree-api-refactor:
  cache-tree: update API to take abitrary flags
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-commit-ignore-i-t-a'</title>
<updated>2012-02-13T06:42:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-13T06:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=44a1020d4d41b90be80745c7a16e2a49fa612b56'/>
<id>urn:sha1:44a1020d4d41b90be80745c7a16e2a49fa612b56</id>
<content type='text'>
* jc/maint-commit-ignore-i-t-a:
  commit: ignore intent-to-add entries instead of refusing

Conflicts:
	cache-tree.c
</content>
</entry>
<entry>
<title>cache-tree: update API to take abitrary flags</title>
<updated>2012-02-08T00:35:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-01-16T02:36:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e859c69b26528a55bd64f4eee2ed06fad999d862'/>
<id>urn:sha1:e859c69b26528a55bd64f4eee2ed06fad999d862</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: ignore intent-to-add entries instead of refusing</title>
<updated>2012-02-07T20:14:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-07T19:55:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3f6d56de5f99ec5f0667bef4411f2515b253a5b2'/>
<id>urn:sha1:3f6d56de5f99ec5f0667bef4411f2515b253a5b2</id>
<content type='text'>
Originally, "git add -N" was introduced to help users from forgetting to
add new files to the index before they ran "git commit -a".  As an attempt
to help them further so that they do not forget to say "-a", "git commit"
to commit the index as-is was taught to error out, reminding the user that
they may have forgotten to add the final contents of the paths before
running the command.

This turned out to be a false "safety" that is useless.  If the user made
changes to already tracked paths and paths added with "git add -N", and
then ran "git add" to register the final contents of the paths added with
"git add -N", "git commit" will happily create a commit out of the index,
without including the local changes made to the already tracked paths. It
was not a useful "safety" measure to prevent "forgetful" mistakes from
happening.

It turns out that this behaviour is not just a useless false "safety", but
actively hurts use cases of "git add -N" that were discovered later and
have become popular, namely, to tell Git to be aware of these paths added
by "git add -N", so that commands like "git status" and "git diff" would
include them in their output, even though the user is not interested in
including them in the next commit they are going to make.

Fix this ancient UI mistake, and instead make a commit from the index
ignoring the paths added by "git add -N" without adding real contents.

Based on the work by Nguyễn Thái Ngọc Duy, and helped by injection of
sanity from Jonathan Nieder and others on the Git mailing list.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Refactor cache_tree_update idiom from commit</title>
<updated>2011-12-06T22:57:36Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2011-12-06T17:43:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=996277c520641d650dc15ad751cc4ad33318e298'/>
<id>urn:sha1:996277c520641d650dc15ad751cc4ad33318e298</id>
<content type='text'>
We'll need to safely create or update the cache-tree data of the_index
from other places.  While at it, give it an argument that lets us
silence the messages produced by unmerged entries (which prevent it
from working).

Signed-off-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cache_tree_free: Fix small memory leak</title>
<updated>2010-09-07T00:32:28Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2010-09-06T21:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e92fa514a9ade4526ad5c119e3f12e69621c97b6'/>
<id>urn:sha1:e92fa514a9ade4526ad5c119e3f12e69621c97b6</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
