Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
ls-files: Add support in ls-files to display the fsmonitor valid bit
author
Ben Peart
<benpeart@microsoft.com>
Fri, 22 Sep 2017 16:35:42 +0000
(12:35 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 1 Oct 2017 08:23:05 +0000
(17:23 +0900)
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>
builtin/ls-files.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
780494b
)
diff --git
a/builtin/ls-files.c
b/builtin/ls-files.c
index e1339e6d17d2bf592b800d3e5a686cbc91c12331..313962a0c1ccf7e1ba2a4abfccde6e3d12108449 100644
(file)
--- a/
builtin/ls-files.c
+++ b/
builtin/ls-files.c
@@
-31,6
+31,7
@@
static int show_resolve_undo;
static int show_modified;
static int show_killed;
static int show_valid_bit;
static int show_modified;
static int show_killed;
static int show_valid_bit;
+static int show_fsmonitor_bit;
static int line_terminator = '\n';
static int debug_mode;
static int show_eol;
static int line_terminator = '\n';
static int debug_mode;
static int show_eol;
@@
-86,7
+87,8
@@
static const char *get_tag(const struct cache_entry *ce, const char *tag)
{
static char alttag[4];
{
static char alttag[4];
- if (tag && *tag && show_valid_bit && (ce->ce_flags & CE_VALID)) {
+ if (tag && *tag && ((show_valid_bit && (ce->ce_flags & CE_VALID)) ||
+ (show_fsmonitor_bit && (ce->ce_flags & CE_FSMONITOR_VALID)))) {
memcpy(alttag, tag, 3);
if (isalpha(tag[0])) {
memcpy(alttag, tag, 3);
if (isalpha(tag[0])) {
@@
-515,6
+517,8
@@
int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
N_("identify the file status with tags")),
OPT_BOOL('v', NULL, &show_valid_bit,
N_("use lowercase letters for 'assume unchanged' files")),
N_("identify the file status with tags")),
OPT_BOOL('v', NULL, &show_valid_bit,
N_("use lowercase letters for 'assume unchanged' files")),
+ OPT_BOOL('f', NULL, &show_fsmonitor_bit,
+ N_("use lowercase letters for 'fsmonitor clean' files")),
OPT_BOOL('c', "cached", &show_cached,
N_("show cached files in the output (default)")),
OPT_BOOL('d', "deleted", &show_deleted,
OPT_BOOL('c', "cached", &show_cached,
N_("show cached files in the output (default)")),
OPT_BOOL('d', "deleted", &show_deleted,
@@
-584,7
+588,7
@@
int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
for (i = 0; i < exclude_list.nr; i++) {
add_exclude(exclude_list.items[i].string, "", 0, el, --exclude_args);
}
for (i = 0; i < exclude_list.nr; i++) {
add_exclude(exclude_list.items[i].string, "", 0, el, --exclude_args);
}
- if (show_tag || show_valid_bit) {
+ if (show_tag || show_valid_bit
|| show_fsmonitor_bit
) {
tag_cached = "H ";
tag_unmerged = "M ";
tag_removed = "R ";
tag_cached = "H ";
tag_unmerged = "M ";
tag_removed = "R ";