Do not use perl in git-commit.sh
git-commit.sh has the only one place where perl is used and there it can quite trivially be done in sh. git-ls-files without "-z" produces quoted output, even if is different from that produced by perl code it is good enough. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
f5b571fcf7
commit
3dffd2c828
@ -138,32 +138,26 @@ run_status () {
|
|||||||
if test -z "$untracked_files"; then
|
if test -z "$untracked_files"; then
|
||||||
option="--directory --no-empty-directory"
|
option="--directory --no-empty-directory"
|
||||||
fi
|
fi
|
||||||
|
hdr_shown=
|
||||||
if test -f "$GIT_DIR/info/exclude"
|
if test -f "$GIT_DIR/info/exclude"
|
||||||
then
|
then
|
||||||
git-ls-files -z --others $option \
|
git-ls-files --others $option \
|
||||||
--exclude-from="$GIT_DIR/info/exclude" \
|
--exclude-from="$GIT_DIR/info/exclude" \
|
||||||
--exclude-per-directory=.gitignore
|
--exclude-per-directory=.gitignore
|
||||||
else
|
else
|
||||||
git-ls-files -z --others $option \
|
git-ls-files --others $option \
|
||||||
--exclude-per-directory=.gitignore
|
--exclude-per-directory=.gitignore
|
||||||
fi |
|
fi |
|
||||||
@@PERL@@ -e '$/ = "\0";
|
while read line; do
|
||||||
my $shown = 0;
|
if [ -z "$hdr_shown" ]; then
|
||||||
while (<>) {
|
echo '#'
|
||||||
chomp;
|
echo '# Untracked files:'
|
||||||
s|\\|\\\\|g;
|
echo '# (use "git add" to add to commit)'
|
||||||
s|\t|\\t|g;
|
echo '#'
|
||||||
s|\n|\\n|g;
|
hdr_shown=1
|
||||||
s/^/# /;
|
fi
|
||||||
if (!$shown) {
|
echo "# $line"
|
||||||
print "#\n# Untracked files:\n";
|
done
|
||||||
print "# (use \"git add\" to add to commit)\n";
|
|
||||||
print "#\n";
|
|
||||||
$shown = 1;
|
|
||||||
}
|
|
||||||
print "$_\n";
|
|
||||||
}
|
|
||||||
'
|
|
||||||
|
|
||||||
if test -n "$verbose" -a -z "$IS_INITIAL"
|
if test -n "$verbose" -a -z "$IS_INITIAL"
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user