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>
Uwe Kleine-König committed
Sep 23, 2010 at 11:22 UTC
9facb3b05b6a2fbfcd2525d5946cd5505488126b
1 file changed
-3
git-sh-setup.sh
-3
@@ -151,17 +151,14 @@ get_author_ident_from_commit () {
151
s/'\''/'\''\\'\'\''/g
152
h
153
s/^author \([^<]*\) <[^>]*> .*$/\1/
154
- s/'\''/'\''\'\'\''/g
154
s/.*/GIT_AUTHOR_NAME='\''&'\''/p
155
156
g
157
s/^author [^<]* <\([^>]*\)> .*$/\1/
159
- s/'\''/'\''\'\'\''/g
158
s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p
159
160
g
161
s/^author [^<]* <[^>]*> \(.*\)$/\1/
164
- s/'\''/'\''\'\'\''/g
162
s/.*/GIT_AUTHOR_DATE='\''&'\''/p
163
164
q