]> asedeno.scripts.mit.edu Git - git.git/commitdiff
get_author_ident_from_commit(): remove useless quoting
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 23 Sep 2010 09:22:10 +0000 (11:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Sep 2010 17:49:49 +0000 (10:49 -0700)
The command 's/'\''/'\''\'\'\''/g' only triples single quotes:

$ echo "What's up?" | sed 's/'\''/'\''\'\'\''/g'
What'''s up?

This doesn't hurt as compared to a single single quote it only adds an
empty string, but it makes the script needlessly complicated and hard to
understand.  The useful quoting is done by s/'\''/'\''\\'\'\''/g at the
beginning of the script and only once for all three variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-sh-setup.sh

index 6131670860514c215a6b9b7417dd05c3124e81b4..8d54b73d3208064829613499580bad541586c725 100644 (file)
@@ -151,17 +151,14 @@ get_author_ident_from_commit () {
                s/'\''/'\''\\'\'\''/g
                h
                s/^author \([^<]*\) <[^>]*> .*$/\1/
-               s/'\''/'\''\'\'\''/g
                s/.*/GIT_AUTHOR_NAME='\''&'\''/p
 
                g
                s/^author [^<]* <\([^>]*\)> .*$/\1/
-               s/'\''/'\''\'\'\''/g
                s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
 
                g
                s/^author [^<]* <[^>]*> \(.*\)$/\1/
-               s/'\''/'\''\'\'\''/g
                s/.*/GIT_AUTHOR_DATE='\''&'\''/p
 
                q