<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/templates, branch v2.40.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-07T17:00:49Z</updated>
<entry>
<title>fsmonitor: query watchman with right valid json</title>
<updated>2022-06-07T17:00:49Z</updated>
<author>
<name>Son Luong Ngoc</name>
<email>sluongng@gmail.com</email>
</author>
<published>2022-06-07T11:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=134047b500fd6da079c4aad72c456cd76afe6771'/>
<id>urn:sha1:134047b500fd6da079c4aad72c456cd76afe6771</id>
<content type='text'>
In rare circumstances where the current git index does not carry the
last_update_token, the fsmonitor v2 hook will be invoked with an
empty string which would caused the final rendered json to be invalid.

  ["query", "/path/to/my/git/repository/", {
          "since": ,
          "fields": ["name"],
          "expression": ["not", ["dirname", ".git"]]
  }]

Which will left user with the following error message

  &gt; git status
  failed to parse command from stdin: line 2, column 13, position 67: unexpected token near ','
  Watchman: command returned no output.
  Falling back to scanning...

Hide the "since" field in json query when "last_update_token" is empty.

Co-authored-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Son Luong Ngoc &lt;sluongng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: add "$(QUIET)" boilerplate to shared.mak</title>
<updated>2022-03-03T22:14:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-03T16:04:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9fda017f40ee7ef2d41e52581b6064bb69ff7a2'/>
<id>urn:sha1:a9fda017f40ee7ef2d41e52581b6064bb69ff7a2</id>
<content type='text'>
The $(QUIET) variables we define are largely duplicated between our
various Makefiles, let's define them in the new "shared.mak" instead.

Since we're not using the environment to pass these around we don't
need to export the "QUIET_GEN" and "QUIET_BUILT_IN" variables
anymore. The "QUIET_GEN" variable is used in "git-gui/Makefile" and
"gitweb/Makefile", but they've got their own definition for those. The
"QUIET_BUILT_IN" variable is only used in the top-level "Makefile". We
still need to export the "V" variable.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it</title>
<updated>2022-03-03T22:14:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-03T16:04:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8df786d2981f8f4456834798d99b9d92c562d1cd'/>
<id>urn:sha1:8df786d2981f8f4456834798d99b9d92c562d1cd</id>
<content type='text'>
We have various behavior that's shared across our Makefiles, or that
really should be (e.g. via defined templates). Let's create a
top-level "shared.mak" to house those sorts of things, and start by
adding the ".DELETE_ON_ERROR" flag to it.

See my own 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR"
flag, 2021-06-29) and db10fc6c09f (doc: simplify Makefile using
.DELETE_ON_ERROR, 2021-05-21) for the addition and use of the
".DELETE_ON_ERROR" flag.

I.e. this changes the behavior of existing rules in the altered
Makefiles (except "Makefile" &amp; "Documentation/Makefile"). I'm
confident that this is safe having read the relevant rules in those
Makfiles, and as the GNU make manual notes that it isn't the default
behavior is out of an abundance of backwards compatibility
caution. From edition 0.75 of its manual, covering GNU make 4.3:

    [Enabling '.DELETE_ON_ERROR' is] almost always what you want
    'make' to do, but it is not historical practice; so for
    compatibility, you must explicitly request it.

This doesn't introduce a bug by e.g. having this
".DELETE_ON_ERROR" flag only apply to this new shared.mak, Makefiles
have no such scoping semantics.

It does increase the danger that any Makefile without an explicit "The
default target of this Makefile is..." snippet to define the default
target as "all" could have its default rule changed if our new
shared.mak ever defines a "real" rule. In subsequent commits we'll be
careful not to do that, and such breakage would be obvious e.g. in the
case of "make -C t".

We might want to make that less fragile still (e.g. by using
".DEFAULT_GOAL" as noted in the preceding commit), but for now let's
simply include "shared.mak" without adding that boilerplate to all the
Makefiles that don't have it already. Most of those are already
exposed to that potential caveat e.g. due to including "config.mak*".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hook: add sample template for push-to-checkout</title>
<updated>2020-10-16T15:47:02Z</updated>
<author>
<name>Adam Spiers</name>
<email>git@adamspiers.org</email>
</author>
<published>2020-10-15T22:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e632c464d5dbbda72ae370ff6e9cbe31c01b0bb0'/>
<id>urn:sha1:e632c464d5dbbda72ae370ff6e9cbe31c01b0bb0</id>
<content type='text'>
The template is a more-or-less exact translation to shell of the C
code for the default behaviour for git's push-to-checkout hook defined
in the push_to_deploy() function in builtin/receive-pack.c, to serve
as a convenient starting point for modification.

It also contains relevant text extracted from the git-config(1) and
githooks(5) man pages.

Signed-off-by: Adam Spiers &lt;git@adamspiers.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hooks--update.sample: use hash-agnostic zero OID</title>
<updated>2020-09-23T16:31:45Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-23T09:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8d3d632f4165955da49032d50279c20cfbde2e5'/>
<id>urn:sha1:d8d3d632f4165955da49032d50279c20cfbde2e5</id>
<content type='text'>
The update sample hook has the zero OID hardcoded as 40 zeros. However,
with the introduction of SHA-256 support, this assumption no longer
holds true. Replace the hardcoded $z40 with a call to

	git hash-object --stdin &lt;/dev/null | tr '[0-9a-f]' '0'

so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hooks--pre-push.sample: use hash-agnostic zero OID</title>
<updated>2020-09-23T16:31:45Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-23T09:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c7e5059506c6840bfbd4dd8d1730784a5689719'/>
<id>urn:sha1:8c7e5059506c6840bfbd4dd8d1730784a5689719</id>
<content type='text'>
The pre-push sample hook has the zero OID hardcoded as 40 zeros.
However, with the introduction of SHA-256 support, this assumption no
longer holds true. Replace the hardcoded $z40 with a call to

	git hash-object --stdin &lt;/dev/null | tr '[0-9a-f]' '0'

so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hooks--pre-push.sample: modernize script</title>
<updated>2020-09-23T16:31:45Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-23T09:38:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a117da6e523a82115733682f4d3f59755897d5a'/>
<id>urn:sha1:6a117da6e523a82115733682f4d3f59755897d5a</id>
<content type='text'>
The preferred form for a command substitution is $() over ``. Use this
form for the command substitution in the sample hook.

The preferred form for conditional tests is to use `test` over [].
Replace [] with `test`.

Finally, replace all instances of "sha" with "oid".

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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.shady.money/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.shady.money/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.shady.money/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>
</feed>
