<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/templates, branch v2.26.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2020-02-14T20:54:20Z</updated>
<entry>
<title>Merge branch 'kw/fsmonitor-watchman-racefix'</title>
<updated>2020-02-14T20:54:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-14T20:54:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c9a33e5e5d7e124feb86ccff08ea466faff53b26'/>
<id>urn:sha1:c9a33e5e5d7e124feb86ccff08ea466faff53b26</id>
<content type='text'>
A new version of fsmonitor-watchman hook has been introduced, to
avoid races.

* kw/fsmonitor-watchman-racefix:
  fsmonitor: update documentation for hook version and watchman hooks
  fsmonitor: add fsmonitor hook scripts for version 2
  fsmonitor: handle version 2 of the hooks that will use opaque token
  fsmonitor: change last update timestamp on the index_state to opaque token
</content>
</entry>
<entry>
<title>Merge branch 'lh/bool-to-type-bool'</title>
<updated>2020-01-30T22:17:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-01-30T22:17:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7050624abceb6f7b4ca0ca7ddfce5831f8a40b8f'/>
<id>urn:sha1:7050624abceb6f7b4ca0ca7ddfce5831f8a40b8f</id>
<content type='text'>
Replace "git config --bool" calls with "git config --type=bool" in
sample templates.

* lh/bool-to-type-bool:
  templates: fix deprecated type option `--bool`
</content>
</entry>
<entry>
<title>fsmonitor: add fsmonitor hook scripts for version 2</title>
<updated>2020-01-23T23:10:23Z</updated>
<author>
<name>Kevin Willford</name>
<email>Kevin.Willford@microsoft.com</email>
</author>
<published>2020-01-23T15:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e4e1e8342aa03c4e4585908736a103130cc8906d'/>
<id>urn:sha1:e4e1e8342aa03c4e4585908736a103130cc8906d</id>
<content type='text'>
Version 2 of the fsmonitor hooks is passed the version and an update
token and must pass back a last update token to use for subsequent calls
to the hook.

Signed-off-by: Kevin Willford &lt;Kevin.Willford@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>templates: fix deprecated type option `--bool`</title>
<updated>2020-01-21T22:11:20Z</updated>
<author>
<name>Lucius Hu</name>
<email>orctarorga@gmail.com</email>
</author>
<published>2020-01-19T22:53:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=81e3db42f3212a8e441e4ecee9a2928921cb9045'/>
<id>urn:sha1:81e3db42f3212a8e441e4ecee9a2928921cb9045</id>
<content type='text'>
The `--bool` option to `git-config` is marked as historical, and users are
recommended to use `--type=bool` instead. This commit replaces all occurrences
of `--bool` in the templates.

Also note that, no other deprecated type options are found, including `--int`,
`--bool-or-int`, `--path`, or `--expiry-date`.

Signed-off-by: Lucius Hu &lt;orctarorga@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kw/fsmonitor-watchman-fix'</title>
<updated>2019-12-01T17:04:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-01T17:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=fc7b26c907b7a07c143611c5acf31daa88a35eb3'/>
<id>urn:sha1:fc7b26c907b7a07c143611c5acf31daa88a35eb3</id>
<content type='text'>
The watchman integration for fsmonitor was racy, which has been
corrected to be more conservative.

* kw/fsmonitor-watchman-fix:
  fsmonitor: fix watchman integration
</content>
</entry>
<entry>
<title>fsmonitor: fix watchman integration</title>
<updated>2019-11-06T03:23:30Z</updated>
<author>
<name>Kevin Willford</name>
<email>kewillf@microsoft.com</email>
</author>
<published>2019-11-04T17:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dd0b61f577f041f1119bb3288451f8f9b7f9e3f2'/>
<id>urn:sha1:dd0b61f577f041f1119bb3288451f8f9b7f9e3f2</id>
<content type='text'>
When running Git commands quickly -- such as in a shell script or the
test suite -- the Git commands frequently complete and start again
during the same second. The example fsmonitor hooks to integrate with
Watchman truncate the nanosecond times to seconds. In principle, this is
fine, as Watchman claims to use inclusive comparisons [1]. The result
should only be an over-representation of the changed paths since the
last Git command.

However, Watchman's own documentation claims "Using a timestamp is prone
to race conditions in understanding the complete state of the file tree"
[2]. All of their documented examples use a "clockspec" that looks like
'c:123:234'. Git should eventually learn how to store this type of
string to provide a stronger integration, but that will be a more
invasive change.

When using GIT_TEST_FSMONITOR="$(pwd)/t7519/fsmonitor-watchman", scripts
such as t7519-wtstatus.sh fail due to these race conditions. In fact,
running any test script with GIT_TEST_FSMONITOR pointing at
t/t7519/fsmonitor-wathcman will cause failures in the test_commit
function. The 'git add "$indir$file"' command fails due to not enough
time between the creation of '$file' and the 'git add' command.

For now, subtract one second from the timestamp we pass to Watchman.
This will make our window large enough to avoid these race conditions.
Increasing the window causes tests like t7519-wtstatus.sh to pass.

When the integration was introduced in def437671 (fsmonitor: add a
sample integration script for Watchman, 2018-09-22), the query included
an expression that would ignore files created and deleted in that
window. The performance reason for this change was to ignore temporary
files created by a build between Git commands. However, this causes
failures in script scenarios where Git is creating or deleting files
quickly.

When using GIT_TEST_FSMONITOR as before, t2203-add-intent.sh fails
due to this add-and-delete race condition.

By removing the "expression" from the Watchman query, we remove this
race condition. It will lead to some performance degradation in the case
of users creating and deleting temporary files inside their working
directory between Git commands. However, that is a cost we need to pay
to be correct.

[1] https://github.com/facebook/watchman/blob/master/query/since.cpp#L35-L39
[2] https://facebook.github.io/watchman/docs/clockspec.html

Helped-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Kevin Willford &lt;Kevin.Willford@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-merge: honor pre-merge-commit hook</title>
<updated>2019-08-07T19:37:33Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2019-08-07T18:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6098817fd7f64209664c701df30096dc0f4fb876'/>
<id>urn:sha1:6098817fd7f64209664c701df30096dc0f4fb876</id>
<content type='text'>
git-merge does not honor the pre-commit hook when doing automatic merge
commits, and for compatibility reasons this is going to stay.

Introduce a pre-merge-commit hook which is called for an automatic merge
commit just like pre-commit is called for a non-automatic merge commit
(or any other commit).

[js: * renamed hook from "pre-merge" to "pre-merge-commit"
     * only discard the index if the hook is actually present
     * expanded githooks documentation entry
     * clarified that hook should write messages to stderr
     * squashed test changes from the original series' patch 4/4
     * modified tests to follow new pattern from this series' patch 1/4
     * added a test case for non-executable merge hooks
     * added a test case for failed merges
     * when testing that the merge hook did not run, make sure we
       actually have a merge to perform (by resetting the "side" branch
       to its original state).
     * reworded commit message
]

Improved-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Michael J Gruber &lt;git@grubix.eu&gt;
Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Update shell scripts to compute empty tree object ID</title>
<updated>2018-05-02T04:59:53Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-05-02T00:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=03a7f388dafaee0aa084144efe7a8f9c151e5221'/>
<id>urn:sha1:03a7f388dafaee0aa084144efe7a8f9c151e5221</id>
<content type='text'>
Several of our shell scripts hard-code the object ID of the empty tree.
To avoid any problems when changing hashes, compute this value on
startup of the script.  For performance, store the value in a variable
and reuse it throughout the life of the script.

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>fsmonitor: simplify determining the git worktree under Windows</title>
<updated>2017-11-13T01:02:20Z</updated>
<author>
<name>Ben Peart</name>
<email>benpeart@microsoft.com</email>
</author>
<published>2017-11-10T21:03:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=1fff303fc2b31d5005f38f55f38c4e8521da5a93'/>
<id>urn:sha1:1fff303fc2b31d5005f38f55f38c4e8521da5a93</id>
<content type='text'>
Simplify and speed up the process of finding the git worktree when
running on Windows by keeping it in perl and avoiding spawning helper
processes.

Signed-off-by: Ben Peart &lt;benpeart@microsoft.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsmonitor: read from getcwd(), not the PWD environment variable</title>
<updated>2017-11-10T05:04:50Z</updated>
<author>
<name>Alex Vandiver</name>
<email>alexmv@dropbox.com</email>
</author>
<published>2017-11-09T19:58:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6f1dc21d983a495877c8054d41d9b634e234ccc4'/>
<id>urn:sha1:6f1dc21d983a495877c8054d41d9b634e234ccc4</id>
<content type='text'>
Though the process has chdir'd to the root of the working tree, the
PWD environment variable is only guaranteed to be updated accordingly
if a shell is involved -- which is not guaranteed to be the case.
That is, if `/usr/bin/perl` is a binary, $ENV{PWD} is unchanged from
whatever spawned `git` -- if `/usr/bin/perl` is a trivial shell
wrapper to the real `perl`, `$ENV{PWD}` will have been updated to the
root of the working copy.

Update to read from the Cwd module using the `getcwd` syscall, not the
PWD environment variable.  The Cygwin case is left unchanged, as it
necessarily _does_ go through a shell.

Signed-off-by: Alex Vandiver &lt;alexmv@dropbox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
