Skip to content

Commit ed36a48

Browse files
committed
Merge branch 'maint-1.7.3' into maint-1.7.4
* maint-1.7.3: make the sample pre-commit hook script reject names with newlines, too Reindent closing bracket using tab instead of spaces Documentation/git-update-index: refer to 'ls-files'
2 parents cdb791f + eb4e672 commit ed36a48

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Documentation/git-update-index.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ tree files, you have to explicitly tell git about it by dropping
264264
"assume unchanged" bit, either before or after you modify them.
265265

266266
In order to set "assume unchanged" bit, use `--assume-unchanged`
267-
option. To unset, use `--no-assume-unchanged`.
267+
option. To unset, use `--no-assume-unchanged`. To see which files
268+
have the "assume unchanged" bit set, use `git ls-files -v`
269+
(see linkgit:git-ls-files[1]).
268270

269271
The command looks at `core.ignorestat` configuration variable. When
270272
this is true, paths updated with `git update-index paths...` and
@@ -363,7 +365,8 @@ ctime for marking files processed) (see linkgit:git-config[1]).
363365
SEE ALSO
364366
--------
365367
linkgit:git-config[1],
366-
linkgit:git-add[1]
368+
linkgit:git-add[1],
369+
linkgit:git-ls-files[1]
367370

368371

369372
Author

templates/hooks--pre-commit.sample

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ fi
1818
# If you want to allow non-ascii filenames set this variable to true.
1919
allownonascii=$(git config hooks.allownonascii)
2020

21+
# Redirect output to stderr.
22+
exec 1>&2
23+
2124
# Cross platform projects tend to avoid non-ascii filenames; prevent
2225
# them from being added to the repository. We exploit the fact that the
2326
# printable range starts at the space character and ends with tilde.
2427
if [ "$allownonascii" != "true" ] &&
2528
# Note that the use of brackets around a tr range is ok here, (it's
2629
# even required, for portability to Solaris 10's /usr/bin/tr), since
2730
# the square bracket bytes happen to fall in the designated range.
28-
test "$(git diff --cached --name-only --diff-filter=A -z $against |
29-
LC_ALL=C tr -d '[ -~]\0')"
31+
test $(git diff --cached --name-only --diff-filter=A -z $against |
32+
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
3033
then
3134
echo "Error: Attempt to add a non-ascii file name."
3235
echo
@@ -43,4 +46,5 @@ then
4346
exit 1
4447
fi
4548

49+
# If there are whitespace errors, print the offending file names and fail.
4650
exec git diff-index --check --cached $against --

wt-status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
320320
if (s->ignore_submodule_arg) {
321321
DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
322322
handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
323-
}
323+
}
324324
rev.diffopt.format_callback = wt_status_collect_changed_cb;
325325
rev.diffopt.format_callback_data = s;
326326
rev.prune_data = s->pathspec;

0 commit comments

Comments
 (0)