<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/entry.c, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-03-14T16:23:50Z</updated>
<entry>
<title>convert: convert to struct object_id</title>
<updated>2018-03-14T16:23:50Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a750441a7360b29fff7a414649ece1d35acaca6'/>
<id>urn:sha1:1a750441a7360b29fff7a414649ece1d35acaca6</id>
<content type='text'>
Convert convert.c to struct object_id.  Add a use of the_hash_algo to
replace hard-coded constants and change a strbuf_add to a strbuf_addstr
to avoid another hard-coded constant.

Note that a strict conversion using the hexsz constant would cause
problems in the future if the internal and user-visible hash algorithms
differed, as anticipated by the hash function transition plan.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1_file: convert read_sha1_file to struct object_id</title>
<updated>2018-03-14T16:23:50Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4f5aca40e6f77cbabcbf4ff003c3cf30a1830c8'/>
<id>urn:sha1:b4f5aca40e6f77cbabcbf4ff003c3cf30a1830c8</id>
<content type='text'>
Convert read_sha1_file to take a pointer to struct object_id and rename
it read_object_file.  Do the same for read_sha1_file_extended.

Convert one use in grep.c to use the new function without any other code
change, since the pointer being passed is a void pointer that is already
initialized with a pointer to struct object_id.  Update the declaration
and definitions of the modified functions, and apply the following
semantic patch to convert the remaining callers:

@@
expression E1, E2, E3;
@@
- read_sha1_file(E1.hash, E2, E3)
+ read_object_file(&amp;E1, E2, E3)

@@
expression E1, E2, E3;
@@
- read_sha1_file(E1-&gt;hash, E2, E3)
+ read_object_file(E1, E2, E3)

@@
expression E1, E2, E3, E4;
@@
- read_sha1_file_extended(E1.hash, E2, E3, E4)
+ read_object_file_extended(&amp;E1, E2, E3, E4)

@@
expression E1, E2, E3, E4;
@@
- read_sha1_file_extended(E1-&gt;hash, E2, E3, E4)
+ read_object_file_extended(E1, E2, E3, E4)

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>entry: rename 'new' variables</title>
<updated>2018-02-22T18:08:05Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-02-14T18:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8f71807c1d75a34f6f12050a9f307dfe9fdb29d'/>
<id>urn:sha1:d8f71807c1d75a34f6f12050a9f307dfe9fdb29d</id>
<content type='text'>
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bp/fsmonitor'</title>
<updated>2017-11-21T05:07:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-21T05:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e05336bddacb90cf243aacc0f7b7f34f900453d7'/>
<id>urn:sha1:e05336bddacb90cf243aacc0f7b7f34f900453d7</id>
<content type='text'>
We learned to talk to watchman to speed up "git status" and other
operations that need to see which paths have been modified.

* bp/fsmonitor:
  fsmonitor: preserve utf8 filenames in fsmonitor-watchman log
  fsmonitor: read entirety of watchman output
  fsmonitor: MINGW support for watchman integration
  fsmonitor: add a performance test
  fsmonitor: add a sample integration script for Watchman
  fsmonitor: add test cases for fsmonitor extension
  split-index: disable the fsmonitor extension when running the split index test
  fsmonitor: add a test tool to dump the index extension
  update-index: add fsmonitor support to update-index
  ls-files: Add support in ls-files to display the fsmonitor valid bit
  fsmonitor: add documentation for the fsmonitor extension.
  fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.
  update-index: add a new --force-write-index option
  preload-index: add override to enable testing preload-index
  bswap: add 64 bit endianness helper get_be64
</content>
</entry>
<entry>
<title>Merge branch 'ls/filter-process-delayed'</title>
<updated>2017-10-11T05:52:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-11T05:52:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6909bf6bd9e2e09db591ac82eda52ed8f6eb4020'/>
<id>urn:sha1:6909bf6bd9e2e09db591ac82eda52ed8f6eb4020</id>
<content type='text'>
Bugfixes to an already graduated series.

* ls/filter-process-delayed:
  write_entry: untangle symlink and regular-file cases
  write_entry: avoid reading blobs in CE_RETRY case
  write_entry: fix leak when retrying delayed filter
  entry.c: check if file exists after checkout
  entry.c: update cache entry only for existing files
</content>
</entry>
<entry>
<title>write_entry: untangle symlink and regular-file cases</title>
<updated>2017-10-10T00:03:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-10-09T17:50:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cbbf9d6a275eb23b889158edb753d651542d5a9'/>
<id>urn:sha1:7cbbf9d6a275eb23b889158edb753d651542d5a9</id>
<content type='text'>
The write_entry() function switches on the mode of the entry
we're going to write out. The cases for S_IFLNK and S_IFREG
are lumped together. In earlier versions of the code, this
made some sense. They have a shared preamble (which reads
the blob content), a short type-specific body, and a shared
conclusion (which writes out the file contents; always for
S_IFREG and only sometimes for S_IFLNK).

But over time this has grown to make less sense. The preamble
now has conditional bits for each type, and the S_IFREG body
has grown a lot more complicated. It's hard to follow the
logic of which code is running for which mode.

Let's give each mode its own case arm. We will still share
the conclusion code, which means we now jump to it with a
goto. Ideally we'd pull that shared code into its own
function, but it touches so much internal state in the
write_entry() function that the end result is actually
harder to follow than the goto.

While we're here, we'll touch up a few bits of whitespace to
make the beginning and endings of the cases easier to read.

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>write_entry: avoid reading blobs in CE_RETRY case</title>
<updated>2017-10-09T23:59:57Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-10-09T17:48:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c602d3a9897a408ce0db543860d472332f79d045'/>
<id>urn:sha1:c602d3a9897a408ce0db543860d472332f79d045</id>
<content type='text'>
When retrying a delayed filter-process request, we don't
need to send the blob to the filter a second time. However,
we read it unconditionally into a buffer, only to later
throw away that buffer. We can make this more efficient by
skipping the read in the first place when it isn't
necessary.

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>write_entry: fix leak when retrying delayed filter</title>
<updated>2017-10-09T23:59:02Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-10-09T17:48:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2401586fc5168974c77cdc6d8548c51e6c852a6'/>
<id>urn:sha1:b2401586fc5168974c77cdc6d8548c51e6c852a6</id>
<content type='text'>
When write_entry() retries a delayed filter request, we
don't need to send the blob content to the filter again, and
set the pointer to NULL. But doing so means we leak the
contents we read earlier from read_blob_entry(). Let's make
sure to free it before dropping the pointer.

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>entry.c: check if file exists after checkout</title>
<updated>2017-10-06T05:59:16Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2017-10-05T10:44:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11179eb31178d3d162e1b0af50edbdc2a14da23b'/>
<id>urn:sha1:11179eb31178d3d162e1b0af50edbdc2a14da23b</id>
<content type='text'>
If we are checking out a file and somebody else racily deletes our file,
then we would write garbage to the cache entry. Fix that by checking
the result of the lstat() call on that file. Print an error to the user
if the file does not exist.

Reported-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>entry.c: update cache entry only for existing files</title>
<updated>2017-10-05T11:01:07Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2017-10-05T10:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03b95333db32ea92b8a4a61f2f055a900f8d7c84'/>
<id>urn:sha1:03b95333db32ea92b8a4a61f2f055a900f8d7c84</id>
<content type='text'>
In 2841e8f ("convert: add "status=delayed" to filter process protocol",
2017-06-30) we taught the filter process protocol to delay responses.

That means an external filter might answer in the first write_entry()
call on a file that requires filtering  "I got your request, but I
can't answer right now. Ask again later!". As Git got no answer, we do
not write anything to the filesystem. Consequently, the lstat() call in
the finish block of the function writes garbage to the cache entry.
The garbage is eventually overwritten when the filter answers with
the final file content in a subsequent write_entry() call.

Fix the brief time window of garbage in the cache entry by adding a
special finish block that does nothing for delayed responses. The cache
entry is written properly in a subsequent write_entry() call where
the filter responds with the final file content.

Reported-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
