summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c2ce04)
raw | patch | inline | side by side (parent: 6c2ce04)
author | Marius Storm-Olsen <marius@trolltech.com> | |
Thu, 5 Jun 2008 12:47:50 +0000 (14:47 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 9 Jun 2008 22:48:20 +0000 (15:48 -0700) |
By default, the untracked files mode for commit/status is 'normal'
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Documentation/config.txt | patch | blob | history | |
Documentation/git-commit.txt | patch | blob | history | |
t/t7502-status.sh | patch | blob | history | |
wt-status.c | patch | blob | history |
index 5331b450ea051334d53ce3f1e727e33def2ea2cf..1e09a57c8c5aeb5d49367a4c96f32ebafe07d410 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
relative to the repository root (this was the default for git
prior to v1.5.4).
+status.showUntrackedFiles::
+ By default, linkgit:git-status[1] and linkgit:git-commit[1] show
+ files which are not currently tracked by Git. Directories which
+ contain only untracked files, are shown with the directory name
+ only. Showing untracked files means that Git needs to lstat() all
+ all the files in the whole repository, which might be slow on some
+ systems. So, this variable controls how the commands displays
+ the untracked files. Possible values are:
++
+--
+ - 'no' - Show no untracked files
+ - 'normal' - Shows untracked files and directories
+ - 'all' - Shows also individual files in untracked directories.
+--
++
+If this variable is not specified, it defaults to 'normal'.
+This variable can be overridden with the -u|--untracked-files option
+of linkgit:git-status[1] and linkgit:git-commit[1].
+
tar.umask::
This variable can be used to restrict the permission bits of
tar archive entries. The default is 0002, which turns off the
index a6f41f3663932fda8121c4fc324ed11d5f37c645..2e5ea22a40fd64f3b949099006b54ef493a4993b 100644 (file)
- 'normal' - Shows untracked files and directories
- 'all' - Also shows individual files in untracked directories.
--
++
+See linkgit:git-config[1] for configuration variable
+used to change the default for when the option is not
+specified.
-v|--verbose::
Show unified diff between the HEAD commit and what
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index d84bda1dda54befb466b67d784a506a17b5fdf33..38a48b57c70a888838cfa114be843e1d4aea00d8 100755 (executable)
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
test_cmp expect output
'
+test_expect_success 'status (status.showUntrackedFiles no)' '
+ git config status.showuntrackedfiles no
+ git status >output &&
+ test_cmp expect output
+'
+
cat >expect <<EOF
# On branch master
# Changes to be committed:
test_cmp expect output
'
+test_expect_success 'status (status.showUntrackedFiles normal)' '
+ git config status.showuntrackedfiles normal
+ git status >output &&
+ test_cmp expect output
+'
+
cat >expect <<EOF
# On branch master
# Changes to be committed:
EOF
test_expect_success 'status -uall' '
git status -uall >output &&
+ test_cmp expect output
+'
+test_expect_success 'status (status.showUntrackedFiles all)' '
+ git config status.showuntrackedfiles all
+ git status >output &&
rm -rf dir3 &&
+ git config --unset status.showuntrackedfiles &&
test_cmp expect output
'
diff --git a/wt-status.c b/wt-status.c
index 23017e4d46826712756c29f1477b94cf461fadfc..28c9e637e3dd42a2c2364dd7b9f099f4671861cb 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
wt_status_relative_paths = git_config_bool(k, v);
return 0;
}
+ if (!strcmp(k, "status.showuntrackedfiles")) {
+ if (!v)
+ return config_error_nonbool(v);
+ else if (!strcmp(v, "no"))
+ show_untracked_files = SHOW_NO_UNTRACKED_FILES;
+ else if (!strcmp(v, "normal"))
+ show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;
+ else if (!strcmp(v, "all"))
+ show_untracked_files = SHOW_ALL_UNTRACKED_FILES;
+ else
+ return error("Invalid untracked files mode '%s'", v);
+ return 0;
+ }
return git_color_default_config(k, v, cb);
}