Skip to content

Commit d8c71db

Browse files
benpeartgitster
authored andcommitted
ls-files: Add support in ls-files to display the fsmonitor valid bit
Add a new command line option (-f) to ls-files to have it use lowercase letters for 'fsmonitor valid' files Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 780494b commit d8c71db

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

builtin/ls-files.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static int show_resolve_undo;
3131
static int show_modified;
3232
static int show_killed;
3333
static int show_valid_bit;
34+
static int show_fsmonitor_bit;
3435
static int line_terminator = '\n';
3536
static int debug_mode;
3637
static int show_eol;
@@ -86,7 +87,8 @@ static const char *get_tag(const struct cache_entry *ce, const char *tag)
8687
{
8788
static char alttag[4];
8889

89-
if (tag && *tag && show_valid_bit && (ce->ce_flags & CE_VALID)) {
90+
if (tag && *tag && ((show_valid_bit && (ce->ce_flags & CE_VALID)) ||
91+
(show_fsmonitor_bit && (ce->ce_flags & CE_FSMONITOR_VALID)))) {
9092
memcpy(alttag, tag, 3);
9193

9294
if (isalpha(tag[0])) {
@@ -515,6 +517,8 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
515517
N_("identify the file status with tags")),
516518
OPT_BOOL('v', NULL, &show_valid_bit,
517519
N_("use lowercase letters for 'assume unchanged' files")),
520+
OPT_BOOL('f', NULL, &show_fsmonitor_bit,
521+
N_("use lowercase letters for 'fsmonitor clean' files")),
518522
OPT_BOOL('c', "cached", &show_cached,
519523
N_("show cached files in the output (default)")),
520524
OPT_BOOL('d', "deleted", &show_deleted,
@@ -584,7 +588,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
584588
for (i = 0; i < exclude_list.nr; i++) {
585589
add_exclude(exclude_list.items[i].string, "", 0, el, --exclude_args);
586590
}
587-
if (show_tag || show_valid_bit) {
591+
if (show_tag || show_valid_bit || show_fsmonitor_bit) {
588592
tag_cached = "H ";
589593
tag_unmerged = "M ";
590594
tag_removed = "R ";

0 commit comments

Comments
 (0)