<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/read-cache.c, branch v1.7.9.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.7.9.7</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.9.7'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2012-02-17T18:11:05Z</updated>
<entry>
<title>refresh_index: do not show unmerged path that is outside pathspec</title>
<updated>2012-02-17T18:11:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-17T18:11:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3d1f148c3381de410a9b02a05bde05cd0fb17a0c'/>
<id>urn:sha1:3d1f148c3381de410a9b02a05bde05cd0fb17a0c</id>
<content type='text'>
When running "git add --refresh &lt;pathspec&gt;", we incorrectly showed the
path that is unmerged even if it is outside the specified pathspec, even
though we did honor pathspec and refreshed only the paths that matched.

Note that this cange does not affect "git update-index --refresh"; for
hysterical raisins, it does not take a pathspec (it takes real paths) and
more importantly itss command line options are parsed and executed one by
one as they are encountered, so "git update-index --refresh foo" means
"first refresh the index, and then update the entry 'foo' by hashing the
contents in file 'foo'", not "refresh only entry 'foo'".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/allocate-cache-entry-individually'</title>
<updated>2011-12-09T21:36:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-12-09T21:36:56Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ef87690b27fd1facdc8cc48f6789a930939303a3'/>
<id>urn:sha1:ef87690b27fd1facdc8cc48f6789a930939303a3</id>
<content type='text'>
* rs/allocate-cache-entry-individually:
  cache.h: put single NUL at end of struct cache_entry
  read-cache.c: allocate index entries individually

Conflicts:
	read-cache.c
</content>
</entry>
<entry>
<title>refresh_index: make porcelain output more specific</title>
<updated>2011-11-18T19:55:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-11-18T11:13:08Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=73b7eae60c18036eab21a84e42bfa8b5297fe679'/>
<id>urn:sha1:73b7eae60c18036eab21a84e42bfa8b5297fe679</id>
<content type='text'>
If you have a deleted file and a porcelain refreshes the
cache, we print:

  Unstaged changes after reset:
  M	file

This is technically correct, in that the file is modified,
but it's friendlier to the user if we further differentiate
the case of a deleted file (especially because this output
looks a lot like "diff --name-status", which would also make
the distinction).

Similarly, we can distinguish typechanges ("T") and
intent-to-add files ("A"), both of which appear as just "M"
in the current output.

The plumbing output for all cases remains "needs update" for
historical compatibility.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refresh_index: rename format variables</title>
<updated>2011-11-18T19:55:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-11-18T11:11:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4bd4e73093eb741a87b7d80bc84469d880f4e2f3'/>
<id>urn:sha1:4bd4e73093eb741a87b7d80bc84469d880f4e2f3</id>
<content type='text'>
When refreshing the index, for modified (or unmerged) files we will print
"needs update" (or "needs merge") for plumbing, or line similar to the
output from "diff --name-status" for porcelain.

The variables holding which type of message to show are named after the
plumbing messages. However, as we begin to differentiate more cases at the
porcelain level (with the plumbing message staying the same), that naming
scheme will become awkward.

Instead, name the variables after which case we found (modified or
unmerged), not what we will output.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read-cache: let refresh_cache_ent pass up changed flags</title>
<updated>2011-11-18T19:53:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-11-18T11:11:08Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d05e69701053c0cf786e99251879f860702374b7'/>
<id>urn:sha1:d05e69701053c0cf786e99251879f860702374b7</id>
<content type='text'>
This will enable refresh_cache to differentiate more cases
of modification (such as typechange) when telling the user
what isn't fresh.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read-cache.c: allocate index entries individually</title>
<updated>2011-10-26T22:25:59Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2011-10-24T21:59:14Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=debed2a6291a29fd7b0e96f63fbf0142ed3280eb'/>
<id>urn:sha1:debed2a6291a29fd7b0e96f63fbf0142ed3280eb</id>
<content type='text'>
The code to estimate the in-memory size of the index based on its on-disk
representation is subtly wrong for certain architecture-dependent struct
layouts.  Instead of fixing it, replace the code to keep the index entries
in a single large block of memory and allocate each entry separately
instead.  This is both simpler and more flexible, as individual entries
can now be freed.  Actually using that added flexibility is left for a
later patch.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>read-cache.c: fix index memory allocation</title>
<updated>2011-10-26T21:35:16Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2011-10-24T01:01:27Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=8f41c07f90da5e314cbc428f1e3e936563f7f39d'/>
<id>urn:sha1:8f41c07f90da5e314cbc428f1e3e936563f7f39d</id>
<content type='text'>
estimate_cache_size() tries to guess how much memory is needed for the
in-memory representation of an index file.  It does that by using the
file size, the number of entries and the difference of the sizes of the
on-disk and in-memory structs -- without having to check the length of
the name of each entry, which varies for each entry, but their sums are
the same no matter the representation.

Except there can be a difference.  First of all, the size is really
calculated by ce_size and ondisk_ce_size based on offsetof(..., name),
not sizeof, which can be different.  And entries are padded with 1 to 8
NULs at the end (after the variable name) to make their total length a
multiple of eight.

So in order to allocate enough memory to hold the index, change the
delta calculation to be based on offsetof(..., name) and round up to
the next multiple of eight.

On a 32-bit Linux, this delta was used before:

	sizeof(struct cache_entry)        == 72
	sizeof(struct ondisk_cache_entry) == 64
	                                    ---
	                                      8

The actual difference for an entry with a filename length of one was,
however (find the definitions are in cache.h):

	offsetof(struct cache_entry, name)        == 72
	offsetof(struct ondisk_cache_entry, name) == 62

	ce_size        == (72 + 1 + 8) &amp; ~7 == 80
	ondisk_ce_size == (62 + 1 + 8) &amp; ~7 == 64
	                                      ---
	                                       16

So eight bytes less had been allocated for such entries.  The new
formula yields the correct delta:

	(72 - 62 + 7) &amp; ~7 == 16

Reported-by: John Hsing &lt;tsyj2007@gmail.com&gt;
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2011-08-25T23:00:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-08-25T23:00:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1952e102b702b977d6bdfcee7cb48b843cb92049'/>
<id>urn:sha1:1952e102b702b977d6bdfcee7cb48b843cb92049</id>
<content type='text'>
* maint:
  whitespace: have SP on both sides of an assignment "="
  update-ref: whitespace fix
</content>
</entry>
<entry>
<title>whitespace: have SP on both sides of an assignment "="</title>
<updated>2011-08-25T21:47:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-08-25T21:46:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=cd2b8ae983a277fb3f3c2b2c6747b0a075af1421'/>
<id>urn:sha1:cd2b8ae983a277fb3f3c2b2c6747b0a075af1421</id>
<content type='text'>
I've deliberately excluded the borrowed code in compat/nedmalloc
directory.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ef/maint-win-verify-path'</title>
<updated>2011-06-30T00:09:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-06-30T00:09:17Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=033c2dc4364042b9e6dbd44e82e1974f78a72567'/>
<id>urn:sha1:033c2dc4364042b9e6dbd44e82e1974f78a72567</id>
<content type='text'>
* ef/maint-win-verify-path:
  verify_dotfile(): do not assume '/' is the path seperator
  verify_path(): simplify check at the directory boundary
  verify_path: consider dos drive prefix
  real_path: do not assume '/' is the path seperator
  A Windows path starting with a backslash is absolute
</content>
</entry>
</feed>
