git/templates
Son Luong Ngoc 134047b500 fsmonitor: query watchman with right valid json
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

  > 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 <avarab@gmail.com>
Signed-off-by: Son Luong Ngoc <sluongng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-06-07 10:00:49 -07:00
..
.gitignore
Makefile Makefile: add "$(QUIET)" boilerplate to shared.mak 2022-03-03 14:14:55 -08:00
branches--
hooks--applypatch-msg.sample
hooks--commit-msg.sample
hooks--fsmonitor-watchman.sample fsmonitor: query watchman with right valid json 2022-06-07 10:00:49 -07:00
hooks--post-update.sample
hooks--pre-applypatch.sample
hooks--pre-commit.sample
hooks--pre-merge-commit.sample
hooks--pre-push.sample
hooks--pre-rebase.sample
hooks--pre-receive.sample
hooks--prepare-commit-msg.sample
hooks--push-to-checkout.sample hook: add sample template for push-to-checkout 2020-10-16 08:47:02 -07:00
hooks--update.sample hooks--update.sample: use hash-agnostic zero OID 2020-09-23 09:31:45 -07:00
info--exclude
this--description