Skip to content

Commit

Permalink
get_author_ident_from_commit(): remove useless quoting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Junio C Hamano committed Sep 27, 2010
1 parent 9027fa9 commit 9facb3b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9facb3b

Please sign in to comment.