git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: quoting in get_author_ident_from_commit
Date: Wed, 22 Sep 2010 23:23:02 +0200	[thread overview]
Message-ID: <20100922212302.GA22368@pengutronix.de> (raw)

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/  |

             reply	other threads:[~2010-09-22 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 21:23 Uwe Kleine-König [this message]
2010-09-23  9:22 ` [PATCH] get_author_ident_from_commit(): remove useless quoting Uwe Kleine-König
2010-09-27  4:15   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100922212302.GA22368@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).