From acd6d7e70a0dd2a91c6028e5ca68d19c5de4d00b Mon Sep 17 00:00:00 2001 From: Stefan Naewe Date: Wed, 21 Sep 2011 08:21:50 +0200 Subject: Documentation/git-update-index: refer to 'ls-files' 'ls-files' refers to 'update-index' to show how the 'assume unchanged' bit can be seen. This makes the connection 'bi-directional'. Signed-off-by: Stefan Naewe Signed-off-by: Junio C Hamano diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index 68dc187..d2ab35c 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -266,7 +266,9 @@ tree files, you have to explicitly tell git about it by dropping "assume unchanged" bit, either before or after you modify them. In order to set "assume unchanged" bit, use `--assume-unchanged` -option. To unset, use `--no-assume-unchanged`. +option. To unset, use `--no-assume-unchanged`. To see which files +have the "assume unchanged" bit set, use `git ls-files -v` +(see linkgit:git-ls-files[1]). The command looks at `core.ignorestat` configuration variable. When this is true, paths updated with `git update-index paths...` and @@ -365,7 +367,8 @@ ctime for marking files processed) (see linkgit:git-config[1]). SEE ALSO -------- linkgit:git-config[1], -linkgit:git-add[1] +linkgit:git-add[1], +linkgit:git-ls-files[1] Author -- cgit v0.10.2-6-g49f6 From c4c42f2cbd2eb14871881cc0d27412b477f699a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 24 Oct 2011 15:24:51 +1100 Subject: Reindent closing bracket using tab instead of spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/wt-status.c b/wt-status.c index 9624865..e0a3260 100644 --- a/wt-status.c +++ b/wt-status.c @@ -316,7 +316,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s) if (s->ignore_submodule_arg) { DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG); handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg); - } + } rev.diffopt.format_callback = wt_status_collect_changed_cb; rev.diffopt.format_callback_data = s; rev.prune_data = s->pathspec; -- cgit v0.10.2-6-g49f6 From c14daa4845ff2ec0d27807fa50f9fac1ca4d6462 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 22 Oct 2011 19:44:40 +0200 Subject: make the sample pre-commit hook script reject names with newlines, too The sample pre-commit hook script would fail to reject a file name like "a\nb" because of the way newlines are handled in "$(...)". Adjust the test to count filtered bytes and require there be 0. Also print all diagnostics to standard error, not stdout, so they will actually be seen. Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample index b187c4b..18c4829 100755 --- a/templates/hooks--pre-commit.sample +++ b/templates/hooks--pre-commit.sample @@ -18,6 +18,9 @@ fi # If you want to allow non-ascii filenames set this variable to true. allownonascii=$(git config hooks.allownonascii) +# Redirect output to stderr. +exec 1>&2 + # Cross platform projects tend to avoid non-ascii filenames; prevent # them from being added to the repository. We exploit the fact that the # printable range starts at the space character and ends with tilde. @@ -25,8 +28,8 @@ if [ "$allownonascii" != "true" ] && # Note that the use of brackets around a tr range is ok here, (it's # even required, for portability to Solaris 10's /usr/bin/tr), since # the square bracket bytes happen to fall in the designated range. - test "$(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0')" + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 then echo "Error: Attempt to add a non-ascii file name." echo @@ -43,4 +46,5 @@ then exit 1 fi +# If there are whitespace errors, print the offending file names and fail. exec git diff-index --check --cached $against -- -- cgit v0.10.2-6-g49f6