diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2006-07-13 10:30:43 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-07-13 22:00:16 -0700 |
commit | 3dffd2c82862f3e49dd9399adb480cd80d4f34ae (patch) | |
tree | c19fbc08d62756d47b6f92370ed7be6cf3d29929 | |
parent | f5b571fcf7929ca6e85b3c35c4bb96db305d0b1e (diff) | |
download | git-3dffd2c82862f3e49dd9399adb480cd80d4f34ae.tar.gz git-3dffd2c82862f3e49dd9399adb480cd80d4f34ae.tar.xz |
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>
-rwxr-xr-x | git-commit.sh | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/git-commit.sh b/git-commit.sh index 802dd7243..4cf3fab05 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -138,32 +138,26 @@ run_status () { if test -z "$untracked_files"; then option="--directory --no-empty-directory" fi + hdr_shown= if test -f "$GIT_DIR/info/exclude" then - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-from="$GIT_DIR/info/exclude" \ --exclude-per-directory=.gitignore else - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-per-directory=.gitignore fi | - @@PERL@@ -e '$/ = "\0"; - my $shown = 0; - while (<>) { - chomp; - s|\\|\\\\|g; - s|\t|\\t|g; - s|\n|\\n|g; - s/^/# /; - if (!$shown) { - print "#\n# Untracked files:\n"; - print "# (use \"git add\" to add to commit)\n"; - print "#\n"; - $shown = 1; - } - print "$_\n"; - } - ' + while read line; do + if [ -z "$hdr_shown" ]; then + echo '#' + echo '# Untracked files:' + echo '# (use "git add" to add to commit)' + echo '#' + hdr_shown=1 + fi + echo "# $line" + done if test -n "$verbose" -a -z "$IS_INITIAL" then |