Skip to content

nd/list-files updates

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21ls_colors.c: add $LS_COLORS parsing codeMakefile color.h ls_colors.c+407 -00 replies
2/21ls_colors.c: parse color.ls.* from config fileDocumentation/config.txt ls_colors.c+40 -10 replies
3/21ls_colors.c: add a function to color a file namecolor.h ls_colors.c+68 -00 replies
4/21ls_colors.c: highlight submodules like directoriesDocumentation/config.txt ls_colors.c+9 -20 replies
5/21ls-files: buffer full item in strbuf before printingbuiltin/ls-files.c+35 -130 replies
6/21ls-files: add --color to highlight file namesDocumentation/git-ls-files.txt builtin/ls-files.c+42 -30 replies
7/21ls-files: add --columnDocumentation/git-ls-files.txt builtin/ls-files.c+34 -00 replies
8/21ls-files: support --max-depthDocumentation/git-ls-files.txt builtin/ls-files.c+14 -00 replies
9/21list-files: a user friendly version of ls-files and more.gitignore Documentation/config.txt Documentation/git-list-files.txt +4 more+159 -40 replies
10/21list-files: make alias 'ls' default to 'list-files'Documentation/git-list-files.txt config.c+10 -10 replies
11/21list-files: -u does not imply showing stagesbuiltin/ls-files.c+1 -10 replies
12/21list-files: add -R/--recursive short for --max-depth=-1Documentation/git-list-files.txt builtin/ls-files.c+6 -00 replies
13/21list-files: add -1 short for --no-columnDocumentation/git-list-files.txt builtin/ls-files.c+5 -00 replies
14/21list-files: add -t backDocumentation/git-list-files.txt builtin/ls-files.c+23 -100 replies
15/21list-files: sort output and remove duplicatesbuiltin/ls-files.c+24 -120 replies
16/21list-files: do not show duplicate cached entriesbuiltin/ls-files.c+51 -10 replies
17/21list-files: show directories as well as filesbuiltin/ls-files.c+60 -41 reply
18/21list-files: add -F/--classifyDocumentation/git-list-files.txt builtin/ls-files.c+37 -00 replies
19/21list-files -F: show submodules with the new indicator '&'Documentation/git-list-files.txt builtin/ls-files.c+4 -20 replies
20/21list-files: -M aka diff-cachedbuiltin/ls-files.c+64 -30 replies
21/21t3080: tests for git-list-filest/t3080-list-files.sh+134 -00 replies

Reviews trailers per patch

None of the 21 patches has a Reviewed-by or Acked-by.

PatchJunio C HamanoEric SunshineMichael Blume
1/21
2/21Helped-by
3/21
4/21
5/21
6/21
7/21
8/21
9/21Helped-by
10/21
11/21
12/21
13/21
14/21
15/21
16/21
17/21Helped-by Helped-by
18/21
19/21
20/21
21/21Helped-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/21] nd/list-files updates

- 02/21: fix a bug that ignores config keys if $LS_COLORS is not defined
- 09/21: use listFiles instead of list-files in config keys
- 17/21: incorporate match_pathspec changes from Junio,
use strbuf_swap in show_as_directory()
- 21/21: use test_decode_color and test_when_finished in t3080

Full diff of changes is

-- 8< --

Documentation/config.txt +2 -2
index 74da715..2dc4788 100644
@@ -940,7 +940,7 @@ color.status.<slot>::
 	to red). The values of these variables may be specified as in
 	color.branch.<slot>.
 
-color.list-files::
+color.listFiles::
 	A boolean to enable/disable color in the output of
 	linkgit:git-list-files[1]. May be set to `always`, `false` (or
 	`never`) or `auto` (or `true`), in which case colors are used
@@ -1018,7 +1018,7 @@ column.clean::
 	Specify the layout when list items in `git clean -i`, which always
 	shows files and directories in columns. See `column.ui` for details.
 
-column.list-files::
+column.listFiles::
 	Specify whether to output tag listing in `git list-files` in columns.
 	See `column.ui` for details.
 
builtin/ls-files.c +30 -22

79 lines not on this page · raw message

ls_colors.c +3 -1
index 9259ad3..011a8b9 100644
@@ -326,8 +326,10 @@ void parse_ls_color(void)
 	char *start;
 	size_t len;
 
-	if ((p = getenv("LS_COLORS")) == NULL || *p == '\0')
+	if ((p = getenv("LS_COLORS")) == NULL || *p == '\0') {
+		git_config(ls_colors_config, NULL);
 		return;
+	}
 
 	ext = NULL;
 	strcpy(label, "??");
t/t3080-list-files.sh +16 -4
index 6313dd9..01b9662 100755
@@ -15,16 +15,26 @@ test_expect_success 'setup' '
 
 test_expect_success 'LS_COLORS env variable' '
 	LS_COLORS="rs=0:fi=31:di=32" \
-		git list-files --color=always | grep -v gitlink >actual &&
-	test_cmp "$TEST_DIRECTORY"/t3080/ls_colors actual
+		git list-files --color=always | test_decode_color | \
+		grep -v gitlink >actual &&
+	cat >expected <<-\EOF &&
+	<GREEN>dir<RESET>
+	<RED>file<RESET>
+	EOF
+	test_cmp expected actual
 '
 
 test_expect_success 'color.ls.*' '
 	test_config color.ls.file red &&
 	test_config color.ls.directory green &&
 	test_config color.ls.submodule yellow &&
-	git list-files --color=always >actual &&
-	test_cmp "$TEST_DIRECTORY"/t3080/color_ls actual
+	git list-files --color=always | test_decode_color >actual &&
+	cat >expected <<-\EOF &&
+	<GREEN>dir<RESET>
+	<RED>file<RESET>
+	<YELLOW>gitlink<RESET>
+	EOF
+	test_cmp expected actual
 '
 
 test_expect_success 'column output' '
@@ -78,6 +88,7 @@ test_expect_success 'globbing' '
 '
 
 test_expect_success 'no dups' '
+	test_when_finished "git checkout file" &&
 	echo dirty >>file &&
 	git list-files -m file >actual &&
 	echo "file" >expected &&
@@ -100,6 +111,7 @@ test_expect_success '--classify' '
 '
 
 test_expect_success 'diff-cached' '
+	test_when_finished "git checkout file" &&
 	echo dirty >>file &&
 	git add file &&
 	git list-files -M >actual &&
t/t3080/color_ls deleted +0 -3
deleted file mode 100644
index 47f77ad..0000000
@@ -1,3 +0,0 @@
-dir
-file
-gitlink
t/t3080/ls_colors deleted +0 -2
deleted file mode 100644
index 423c016..0000000
@@ -1,2 +0,0 @@
-dir
-file

-- 8< --

Signature · 1 line
2.3.0.rc1.137.g477eb31