git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: "Pratyush Yadav" <me@yadavpratyush.com>,
	"Emily Shaffer" <emilyshaffer@google.com>,
	"Bryan Turner" <bturner@atlassian.com>,
	"Giuseppe Crinò" <giuscri@gmail.com>,
	"Git Users" <git@vger.kernel.org>
Subject: Re: [BUG] You can't have single quote in your username
Date: Mon, 26 Aug 2019 15:14:55 -0400	[thread overview]
Message-ID: <20190826191455.GA25695@sigill.intra.peff.net> (raw)
In-Reply-To: <20190823082900.GG20404@szeder.dev>

On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote:

> On Fri, Aug 23, 2019 at 12:13:12AM +0530, Pratyush Yadav wrote:
> > > Does it make more sense to replace this strbuf_addstr_without_crud()
> > > setup with something more intelligent (i.e. checking for matching crud
> > > on either end, like ^[$crudchars].*\1$? We already check for matched <>.
> > 
> > Sounds like something easy enough to implement. There are two types of 
> > characters that crud() removes: there are the ones which _should_ appear 
> > on both the start and end (', ", <, >), and the ones which don't 
> > necessarily have to (., ,, :, ;, \).
> > 
> > So we'd need to handle two cases. For the former type, remove a 
> > character both at the start and at the end. For the latter, remove only 
> > where they appear.
> 
> If we go down this route, then someone might want to write ő as o" or
> ű as u", which still supposed to be used in pairs, but what if someone
> wants to write ä as a:, ö as o:, ü as u:, ç as "c,", ş as "s,", etc.
> 
> What I wonder is whether we really have to remove crud from the user
> name if it comes from the configuration.

Probably not. I think most of this crud-handling is really about pulling
names out of email. Digging around in the archive, one of the few
entries that actually talks about this crud-removal being helpful is:

  https://public-inbox.org/git/alpine.LFD.2.00.0812010836280.3256@nehalem.linux-foundation.org/

So it might make sense to push these rules into "git mailinfo" instead
of applying them everywhere. But we'd still need something at least for
GECOS, where "Your Name,,,," is common.

Unfortunately since these rules have been in place for ages, we don't
really know how often they're helping. Loosening it just for user.name,
etc is probably the most conservative choice.

We'd still want to keep the low-level removal of "<>\n", since those are
syntactically significant to Git (i.e., if they sneak in you end up with
a broken commit object). There's some discussion in this thread (which
is also about trailing single-quotes!):

  https://public-inbox.org/git/20120629124122.GG1258@camk.edu.pl/

Another real-world case that would be helped is: "Your Name, Jr.":

  https://public-inbox.org/git/CAMP44s2OoxUVFE57e8C2Km7rcGn88KkLXxdaA3s5RE6nZ7TU=A@mail.gmail.com/

-Peff

  parent reply	other threads:[~2019-08-26 19:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 12:32 [BUG] You can't have single quote in your username Giuseppe Crinò
2019-08-22 15:06 ` Pratyush Yadav
2019-08-22 16:24   ` Junio C Hamano
2019-08-23  7:20     ` Giuseppe Crinò
2019-08-23  7:29       ` Michal Suchánek
2019-08-22 16:06 ` René Scharfe
2019-08-22 16:58 ` Bryan Turner
2019-08-22 17:08   ` Emily Shaffer
2019-08-22 18:43     ` Pratyush Yadav
2019-08-23  8:29       ` SZEDER Gábor
2019-08-23  9:35         ` Giuseppe Crinò
2019-08-23 10:15           ` SZEDER Gábor
2019-08-24 17:49         ` Giuseppe Crinò
2019-08-25  8:09           ` Giuseppe Crinò
2019-08-26 19:14         ` Jeff King [this message]
2019-08-27 13:51           ` Giuseppe Crino'
2019-08-27 14:33             ` Michal Suchánek
2019-08-28 14:33           ` Giuseppe Crino'
2019-08-28 14:56             ` Jeff King
2019-08-31 13:17           ` Giuseppe Crinò
2019-09-02 15:47             ` Jeff King
2019-09-02 19:25               ` Junio C Hamano
2019-09-02 19:50                 ` Michal Suchánek
2019-09-03  7:51                   ` Giuseppe Crinò
2019-09-03  9:03                     ` Michal Suchánek
2019-08-23  8:26     ` SZEDER Gábor

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=20190826191455.GA25695@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bturner@atlassian.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=giuscri@gmail.com \
    --cc=me@yadavpratyush.com \
    --cc=szeder.dev@gmail.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).