<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/entry.c, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-11T05:52:24Z</updated>
<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>
<entry>
<title>Merge branch 'jk/write-in-full-fix'</title>
<updated>2017-09-25T06:24:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-25T06:24:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c50424a6f07f17ff9b06927606df650cd73a09a3'/>
<id>urn:sha1:c50424a6f07f17ff9b06927606df650cd73a09a3</id>
<content type='text'>
Many codepaths did not diagnose write failures correctly when disks
go full, due to their misuse of write_in_full() helper function,
which have been corrected.

* jk/write-in-full-fix:
  read_pack_header: handle signed/unsigned comparison in read result
  config: flip return value of store_write_*()
  notes-merge: use ssize_t for write_in_full() return value
  pkt-line: check write_in_full() errors against "&lt; 0"
  convert less-trivial versions of "write_in_full() != len"
  avoid "write_in_full(fd, buf, len) != len" pattern
  get-tar-commit-id: check write_in_full() return against 0
  config: avoid "write_in_full(fd, buf, len) &lt; len" pattern
</content>
</entry>
<entry>
<title>convert less-trivial versions of "write_in_full() != len"</title>
<updated>2017-09-14T06:17:59Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-13T17:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=564bde9ae69dc3d60e764078745275b637f90991'/>
<id>urn:sha1:564bde9ae69dc3d60e764078745275b637f90991</id>
<content type='text'>
The prior commit converted many sites to check the return
value of write_in_full() for negativity, rather than a
mismatch with the input length. This patch covers similar
cases, but where the return value is stored in an
intermediate variable. These should get the same treatment,
but they need to be reviewed more carefully since it would
be a bug if the return value is stored in an unsigned type
(which indeed, it is in one of the cases).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ls/convert-filter-progress'</title>
<updated>2017-09-10T08:08:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-10T08:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fbbd3ec0f62b9147e867dee1916cd38d28e7b19'/>
<id>urn:sha1:7fbbd3ec0f62b9147e867dee1916cd38d28e7b19</id>
<content type='text'>
The codepath to call external process filter for smudge/clean
operation learned to show the progress meter.

* ls/convert-filter-progress:
  convert: display progress for filtered objects that have been delayed
</content>
</entry>
<entry>
<title>convert: display progress for filtered objects that have been delayed</title>
<updated>2017-08-24T19:41:20Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2017-08-20T15:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52f1d62eb44faf569edca360ec9af9ddd4045fe0'/>
<id>urn:sha1:52f1d62eb44faf569edca360ec9af9ddd4045fe0</id>
<content type='text'>
In 2841e8f ("convert: add "status=delayed" to filter process protocol",
2017-06-30) we taught the filter process protocol to delayed responses.
These responses are processed after the "Checking out files" phase.
If the processing takes noticeable time, then the user might think Git
is stuck.

Display the progress of the delayed responses to let the user know that
Git is still processing objects. This works very well for objects that
can be filtered quickly. If filtering of an individual object takes
noticeable time, then the user might still think that Git is stuck.
However, in that case the user would at least know what Git is doing.

It would be technical more correct to display "Checking out files whose
content filtering has been delayed". For brevity we only print
"Filtering content".

The finish_delayed_checkout() call was moved below the stop_progress()
call in unpack-trees.c to ensure that the "Checking out files" progress
is properly stopped before the "Filtering content" progress starts in
finish_delayed_checkout().

Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Suggested-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
