git/list[1] front-page[2] threads[3] people[4] search[5] about
 

quoting in get_author_ident_from_commit

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Sep 22, 2010, 21:23 UTC
Message-ID
<20100922212302.GA22368@pengutronix.de>
Hello,

I wonder about the quoting done in get_author_ident_from_commit's sed script.

It first does 's/'\''/'\''\\'\'\''/g', then 's/'\''/'\''\'\'\''/g' (the latter once for each resulting line). What sed actually sees is:

	s/'/'\\''/g
	s/'/'\''/g 

The second instruction only substitutes a single quote by three single quotes because \' is just interpreted as '.

So I think just removing the three occurences of the second substitute command just can be removed, as ''' effectively is the same as '.

Do I miss something?

(The first command was introduced in aa66c7ec77d474b737da607d6cb2d07f56628def, the second was introduced with git commit -m in fec3ef101c0f18bbf2400423dc70e686e9d25b0)

Thanks Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Next: Uwe Kleine-König
Message 1 of 3 in “quoting in get_author_ident_from_commit”
  1. Uwe Kleine-KönigSep 22, 2010
  2. get_author_ident_from_commit(): remove useless quotingUwe Kleine-König, Sep 23, 2010
  3. Junio C HamanoSep 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.