Skip to content

Commit

Permalink
help: include fsmonitor--daemon feature flag in version info
Browse files Browse the repository at this point in the history
Add the "feature: fsmonitor--daemon" message to the output of
`git version --build-options`.

This allows users to know if the built-in fsmonitor feature is
supported on their platform.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler committed Jun 28, 2021
1 parent dfcd3e5 commit 0aaca2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions help.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "version.h"
#include "refs.h"
#include "parse-options.h"
#include "fsmonitor-ipc.h"

struct category_description {
uint32_t category;
Expand Down Expand Up @@ -664,6 +665,9 @@ void get_version_info(struct strbuf *buf, int show_build_options)
strbuf_addf(buf, "sizeof-size_t: %d\n", (int)sizeof(size_t));
strbuf_addf(buf, "shell-path: %s\n", SHELL_PATH);
/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */

if (fsmonitor_ipc__is_supported())
strbuf_addstr(buf, "feature: fsmonitor--daemon\n");
}
}

Expand Down
6 changes: 6 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1674,3 +1674,9 @@ test_lazy_prereq REBASE_P '
# Tests that verify the scheduler integration must set this locally
# to avoid errors.
GIT_TEST_MAINT_SCHEDULER="none:exit 1"

# Does this platform support `git fsmonitor--daemon`
#
test_lazy_prereq FSMONITOR_DAEMON '
git version --build-options | grep "feature:" | grep "fsmonitor--daemon"
'

0 comments on commit 0aaca2f

Please sign in to comment.