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

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2014, 17:08 UTC
Message-ID
<xmqq7g4k4tzv.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1402615835.5629.34.camel@stross>
David Turner <dturner@twopensource.com> writes:
Show 16 quoted lines
> 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 ;-)

Show 20 quoted lines
>> 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.

Previous: Junio C HamanoNext: Ronnie Sahlberg
Message 8 of 18 in “receive-pack: optionally deny case clone refs”
  1. 0/1 receive-pack: optionally deny case clone refsDavid Turner, Jun 11, 2014
  2. 1/1 receive-pack: optionally deny case clone refsDavid Turner, Jun 11, 2014
  3. Torsten BögershausenJun 13, 2014
  4. Junio C HamanoJun 12, 2014
  5. David TurnerJun 12, 2014
  6. Torsten BögershausenJun 13, 2014
  7. Junio C HamanoJun 13, 2014
  8. Junio C HamanoJun 13, 2014
  9. Ronnie SahlbergJun 13, 2014
  10. Ronnie SahlbergJun 13, 2014
  11. Junio C HamanoJun 13, 2014
  12. Ronnie SahlbergJun 13, 2014
  13. David TurnerJun 15, 2014
  14. Junio C HamanoJun 13, 2014
  15. Michael HaggertyJun 18, 2014
  16. Ronnie SahlbergJun 18, 2014
  17. Ronnie SahlbergAug 13, 2014
  18. David TurnerAug 13, 2014

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.