get_author_ident_from_commit(): remove useless quoting
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>
This commit is contained in:
parent
9027fa9eb7
commit
9facb3b05b
@ -151,17 +151,14 @@ get_author_ident_from_commit () {
|
|||||||
s/'\''/'\''\\'\'\''/g
|
s/'\''/'\''\\'\'\''/g
|
||||||
h
|
h
|
||||||
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
||||||
s/'\''/'\''\'\'\''/g
|
|
||||||
s/.*/GIT_AUTHOR_NAME='\''&'\''/p
|
s/.*/GIT_AUTHOR_NAME='\''&'\''/p
|
||||||
|
|
||||||
g
|
g
|
||||||
s/^author [^<]* <\([^>]*\)> .*$/\1/
|
s/^author [^<]* <\([^>]*\)> .*$/\1/
|
||||||
s/'\''/'\''\'\'\''/g
|
|
||||||
s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
|
s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
|
||||||
|
|
||||||
g
|
g
|
||||||
s/^author [^<]* <[^>]*> \(.*\)$/\1/
|
s/^author [^<]* <[^>]*> \(.*\)$/\1/
|
||||||
s/'\''/'\''\'\'\''/g
|
|
||||||
s/.*/GIT_AUTHOR_DATE='\''&'\''/p
|
s/.*/GIT_AUTHOR_DATE='\''&'\''/p
|
||||||
|
|
||||||
q
|
q
|
||||||
|
Loading…
Reference in New Issue
Block a user