<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/entry.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-11-21T05:07:50Z</updated>
<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>
<entry>
<title>fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.</title>
<updated>2017-10-01T08:23:01Z</updated>
<author>
<name>Ben Peart</name>
<email>benpeart@microsoft.com</email>
</author>
<published>2017-09-22T16:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=883e248b8a0fd88773cb902ab8e91273eb147d07'/>
<id>urn:sha1:883e248b8a0fd88773cb902ab8e91273eb147d07</id>
<content type='text'>
When the index is read from disk, the fsmonitor index extension is used
to flag the last known potentially dirty index entries. The registered
core.fsmonitor command is called with the time the index was last
updated and returns the list of files changed since that time. This list
is used to flag any additional dirty cache entries and untracked cache
directories.

We can then use this valid state to speed up preload_index(),
ie_match_stat(), and refresh_cache_ent() as they do not need to lstat()
files to detect potential changes for those entries marked
CE_FSMONITOR_VALID.

In addition, if the untracked cache is turned on valid_cached_dir() can
skip checking directories for new or changed files as fsmonitor will
invalidate the cache only for those directories that have been
identified as having potential changes.

To keep the CE_FSMONITOR_VALID state accurate during git operations;
when git updates a cache entry to match the current state on disk,
it will now set the CE_FSMONITOR_VALID bit.

Inversely, anytime git changes a cache entry, the CE_FSMONITOR_VALID bit
is cleared and the corresponding untracked cache directory is marked
invalid.

Signed-off-by: Ben Peart &lt;benpeart@microsoft.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>
</feed>
