Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-03hooks--pre-commit: detect non-ASCII when renamingJulian Prein
When diff.renames is turned on, the diff-filter will not return renamed files (or copied ones with diff.renames=copy) and potential non-ASCII characters would not be caught by this hook. Use the plumbing command diff-index instead of the porcelain one to not be affected by diff.rename. Signed-off-by: Julian Prein <druckdev@protonmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-22templates: fix deprecated type option `--bool`Lucius Hu
The `--bool` option to `git-config` is marked as historical, and users are recommended to use `--type=bool` instead. This commit replaces all occurrences of `--bool` in the templates. Also note that, no other deprecated type options are found, including `--int`, `--bool-or-int`, `--path`, or `--expiry-date`. Signed-off-by: Lucius Hu <orctarorga@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-02Update shell scripts to compute empty tree object IDbrian m. carlson
Several of our shell scripts hard-code the object ID of the empty tree. To avoid any problems when changing hashes, compute this value on startup of the script. For performance, store the value in a variable and reuse it throughout the life of the script. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-24sample pre-commit hook: use --bool when retrieving config varJohan Herland
Currently if you set [hooks] allowNonAscii (or allownonascii = 1, or = yes) in your .git/config then the sample pre-commit misinterprets the value as "false" and rejects non-ASCII filenames. Use "git config --bool" to get the usual nicer boolean handling. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-07-15templates: spell ASCII in uppercase in pre-commit hookRichard Hartmann
The name of the encoding is ASCII, not ascii. Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15templates: Reformat pre-commit hook's messageRichard Hartmann
Now that we're using heredoc, the message can span the full 80 chars. Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15templates: Use heredoc in pre-commit hookRichard Hartmann
This way, it is easier to see how the text we give the end users would look like, and it will allow us to use (near) full width of the source file. Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-27make the sample pre-commit hook script reject names with newlines, tooJim Meyering
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 <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20Modernize git calling conventions in hook templatesBen Walton
The hook templates were still using/referencing 'git-foo' instead of 'git foo.' This patch updates the sample hooks to use the modern conventions instead. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-07pre-commit.sample: Diff against the empty tree when HEAD is invalidBjörn Steinbrink
This was already the case for the old "diff --check" call, but the new one that checks whether there are any non-ascii file names was missing it, making that check fail for root commits. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-22pre-commit.sample: add comment re tr portability; fix grammarJim Meyering
Add a comment explaining why square brackets around a tr range are not only ok, but actually required in this case. Correct spelling and grammar. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20Extend sample pre-commit hook to check for non ascii filenamesHeiko Voigt
At the moment non-ascii encodings of filenames are not portably converted between different filesystems by git. This will most likely change in the future but to allow repositories to be portable among different file/operating systems this check is enabled by default. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16pre-commit.sample: don't print incidental SHA1Jim Meyering
Make the sample pre-commit hook script discard all git-rev-parse output, not just stderr. Otherwise, it would print an SHA1. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27Update sample pre-commit hook to use "diff --check"Junio C Hamano
Now "diff --check" can detect not just whitespace errors but also notices leftover conflict marker lines, we can use it in the sample pre-commit hook script. These days the object layer knows about the empty tree object without actually having one in the repository, so we can run the test even for the initial commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25Ship sample hooks with .sample suffixJunio C Hamano
We used to mark hooks we ship as samples by making them unexecutable, but some filesystems cannot tell what is executable and what is not. This makes it much more explicit. The hooks are suffixed with .sample (but now are made executable), so enabling it is still one step operation (instead of "chmod +x $hook", you would do "mv $hook.sample $hook") but now they won't get accidentally enabled on systems without executable bit. Signed-off-by: Junio C Hamano <gitster@pobox.com>