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>
Alex Riesen committed
Jul 13, 2006 at 10:30 UTC
3dffd2c82862f3e49dd9399adb480cd80d4f34ae
1 file changed
+13
-19
git-commit.sh
+13
-19
@@ -138,32 +138,26 @@ run_status () {
138
if test -z "$untracked_files"; then
139
option="--directory --no-empty-directory"
140
fi
141
+ hdr_shown=
142
if test -f "$GIT_DIR/info/exclude"
143
then
143
- git-ls-files -z --others $option \
144
+ git-ls-files --others $option \
145
--exclude-from="$GIT_DIR/info/exclude" \
146
--exclude-per-directory=.gitignore
147
else
147
- git-ls-files -z --others $option \
148
+ git-ls-files --others $option \
149
--exclude-per-directory=.gitignore
150
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
161
162
if test -n "$verbose" -a -z "$IS_INITIAL"
163
then