Skip to content

Commit 3dffd2c

Browse files
raalkmlJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5b571f commit 3dffd2c

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

git-commit.sh

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -138,32 +138,26 @@ run_status () {
138138
if test -z "$untracked_files"; then
139139
option="--directory --no-empty-directory"
140140
fi
141+
hdr_shown=
141142
if test -f "$GIT_DIR/info/exclude"
142143
then
143-
git-ls-files -z --others $option \
144+
git-ls-files --others $option \
144145
--exclude-from="$GIT_DIR/info/exclude" \
145146
--exclude-per-directory=.gitignore
146147
else
147-
git-ls-files -z --others $option \
148+
git-ls-files --others $option \
148149
--exclude-per-directory=.gitignore
149150
fi |
150-
@@PERL@@ -e '$/ = "\0";
151-
my $shown = 0;
152-
while (<>) {
153-
chomp;
154-
s|\\|\\\\|g;
155-
s|\t|\\t|g;
156-
s|\n|\\n|g;
157-
s/^/# /;
158-
if (!$shown) {
159-
print "#\n# Untracked files:\n";
160-
print "# (use \"git add\" to add to commit)\n";
161-
print "#\n";
162-
$shown = 1;
163-
}
164-
print "$_\n";
165-
}
166-
'
151+
while read line; do
152+
if [ -z "$hdr_shown" ]; then
153+
echo '#'
154+
echo '# Untracked files:'
155+
echo '# (use "git add" to add to commit)'
156+
echo '#'
157+
hdr_shown=1
158+
fi
159+
echo "# $line"
160+
done
167161

168162
if test -n "$verbose" -a -z "$IS_INITIAL"
169163
then

0 commit comments

Comments
 (0)