diff: cache textconv output
[gitweb.git] / t / t6000lib.sh
old mode 100755 (executable)
new mode 100644 (file)
index 180633e..985d517
@@ -1,3 +1,5 @@
+: included from 6002 and others
+
 [ -d .git/refs/tags ] || mkdir -p .git/refs/tags
 
 :> sed.script
@@ -49,13 +51,15 @@ as_author()
        shift 1
         _save=$GIT_AUTHOR_EMAIL
 
-       export GIT_AUTHOR_EMAIL="$_author"
+       GIT_AUTHOR_EMAIL="$_author"
+       export GIT_AUTHOR_EMAIL
        "$@"
        if test -z "$_save"
        then
                unset GIT_AUTHOR_EMAIL
        else
-               export GIT_AUTHOR_EMAIL="$_save"
+               GIT_AUTHOR_EMAIL="$_save"
+               export GIT_AUTHOR_EMAIL
        fi
 }
 
@@ -69,7 +73,8 @@ on_committer_date()
 {
     _date=$1
     shift 1
-    export GIT_COMMITTER_DATE="$_date"
+    GIT_COMMITTER_DATE="$_date"
+    export GIT_COMMITTER_DATE
     "$@"
     unset GIT_COMMITTER_DATE
 }
@@ -97,7 +102,13 @@ check_output()
 # from front and back.
 name_from_description()
 {
-        tr "'" '-' | tr '~`!@#$%^&*()_+={}[]|\;:"<>,/? ' '-' | tr -s '-' | tr '[A-Z]' '[a-z]' | sed "s/^-*//;s/-*\$//"
+       perl -pe '
+               s/[^A-Za-z0-9.]/-/g;
+               s/-+/-/g;
+               s/-$//;
+               s/^-//;
+               y/A-Z/a-z/;
+       '
 }