git-commit-vandalism/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
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
hooks--update.sample
info--exclude
Makefile
this--description