git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, Michael Haggerty <mhagger@alum.mit.edu>,
	Ronnie Sahlberg <sahlberg@google.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs
Date: Fri, 13 Jun 2014 10:08:52 -0700	[thread overview]
Message-ID: <xmqq7g4k4tzv.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1402615835.5629.34.camel@stross> (David Turner's message of "Thu, 12 Jun 2014 19:30:35 -0400")

David Turner <dturner@twopensource.com> writes:

> On Thu, 2014-06-12 at 12:47 -0700, Junio C Hamano wrote:
>> David Turner <dturner@twopensource.com> writes:
>> 
>> > This issue bit us again recently.
>> >
>> > In talking with some colleagues, I realized that the previous version
>> > of this patch, in addition to being potentially slow, was incomplete.
>> > Specifically, it didn't handle the case of refs/heads/case/one vs
>> > refs/heads/CASE/two; these are case clones even though they strcasecmp
>> > different.
>> 
>> Good catch to realize that two refs that share leading paths that
>> are the same except for cases are also problematic, but that makes
>> this feature even less about "case clones", doesn't it?
>
> I agree: word "clone" is less good now.  Maybe "case conflicts"?

Sounds better but I'd like to hear from the ref people first, as
they have thought about it longer than I have ;-)

>> Also it somehow feels that the patch attempts to solve the issue at
>> a wrong level.  On a platform that cannot represent two refs like
>> these (e.g. trying to create "FOO" when "foo" already exists, or
>> trying to create "a/c" when "A/b" already exists---ending up with
>> "A/c" instead, which is not what the user wanted to create), would
>> it be more sensible to fail the ref creation without touching the
>> users of ref API such as receive-pack?  That way, you would also
>> catch other uses of refs that are not supported on your system,
>> e.g. "git branch a/c" when there already is a branch called "A/b",
>> no?
>
> So we would change is_refname_available?  And to do this, we would
> change the ref_dir functions to take case into account?
> ...
> In other
> words, if the user has A/b and a/c already, and we find A/b first, then
> we reject a/d but allow A/d.   This is arbitrary, but workable.  We
> could warn about this situation when we load up the refs, too.  
>
> Does this match what you are suggesting? 

Yes.  But again, I'd like to hear from the ref people first.  They
may have better ideas.

  parent reply	other threads:[~2014-06-13 17:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 22:30 [PATCH v4 0/1] receive-pack: optionally deny case clone refs David Turner
2014-06-11 22:30 ` [PATCH v4 1/1] " David Turner
2014-06-13  4:03   ` Torsten Bögershausen
2014-06-12 19:47 ` [PATCH v4 0/1] " Junio C Hamano
2014-06-12 23:30   ` David Turner
2014-06-13  4:03     ` Torsten Bögershausen
2014-06-13 17:12       ` Junio C Hamano
2014-06-13 17:08     ` Junio C Hamano [this message]
2014-06-13 18:20   ` Ronnie Sahlberg
2014-06-13 19:05     ` Ronnie Sahlberg
2014-06-13 21:11       ` Junio C Hamano
2014-06-13 22:24         ` Ronnie Sahlberg
2014-06-15  7:10       ` David Turner
2014-06-13 21:25     ` Junio C Hamano
2014-06-18 11:33       ` Michael Haggerty
2014-06-18 15:03         ` Ronnie Sahlberg
2014-08-13 16:20 ` Ronnie Sahlberg
2014-08-13 19:28   ` David Turner

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq7g4k4tzv.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=sahlberg@google.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).