git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* RFC: optionally reject case-clone branch names
@ 2014-05-27 22:56 David Turner
  2014-05-28 17:14 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: David Turner @ 2014-05-27 22:56 UTC (permalink / raw
  To: git mailing list

At present, it is possible to have two branches which are the same but
for case.  This works great on the case-sensitive filesystems, but not
so well on case-insensitive filesystems.  It is fairly typical to have
case-insensitive clients (Macs, say) with a case-sensitive server
(GNU/Linux).  

Should you attempt to pull on a Mac when you have case-clone branches
with differing contents, you'll get an error message containing
something like "Ref refs/remotes/origin/lower is at
[sha-of-lowercase-branch] but expected [sha-of-uppercase-branch]....
(unable to update local ref)"

Fortunately, nobody uses Macs for git servers, because on a Mac server,
if you push a branch called capital-M Master (that differs from
lowercase-m-master), nobody else can push to (lowercase-m) master until
the branch is removed.  Once the branch has been removed, it can no
longer be recreated.

I think a git client that used only packed-refs would not have any
problems with case-sensitivity of branch names, but I assume that there
are good reasons this hasn't yet been done.  At any rate, there are
plenty of older clients out there.

RFC follows:

1. On a case-insensitive server, git receive-pack ought to always reject
branches which are same-but-for-case of existing branches.
2. On a case-sensitive server, the same rule by default, with an option
to allow the old behavior.

Let me know if, should I write these patches, they would be likely to be
accepted.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: optionally reject case-clone branch names
  2014-05-27 22:56 RFC: optionally reject case-clone branch names David Turner
@ 2014-05-28 17:14 ` Junio C Hamano
  2014-05-28 17:56   ` David Turner
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2014-05-28 17:14 UTC (permalink / raw
  To: David Turner; +Cc: git mailing list

David Turner <dturner@twopensource.com> writes:

> RFC follows:
>
> 1. On a case-insensitive server, git receive-pack ought to always reject
> branches which are same-but-for-case of existing branches.
> 2. On a case-sensitive server, the same rule by default, with an option
> to allow the old behavior.
>
> Let me know if, should I write these patches, they would be likely to be
> accepted.

There is another a lot simpler possiblity, no?

3. On any server whose administrator chooses to enforce "one case
   variant only" rule, install a pre-receive hook that enforces the
   rule.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: optionally reject case-clone branch names
  2014-05-28 17:14 ` Junio C Hamano
@ 2014-05-28 17:56   ` David Turner
  2014-05-28 21:58     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: David Turner @ 2014-05-28 17:56 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git mailing list

On Wed, 2014-05-28 at 10:14 -0700, Junio C Hamano wrote:
> David Turner <dturner@twopensource.com> writes:
> 
> > RFC follows:
> >
> > 1. On a case-insensitive server, git receive-pack ought to always reject
> > branches which are same-but-for-case of existing branches.
> > 2. On a case-sensitive server, the same rule by default, with an option
> > to allow the old behavior.
> >
> > Let me know if, should I write these patches, they would be likely to be
> > accepted.
> 
> There is another a lot simpler possiblity, no?
> 
> 3. On any server whose administrator chooses to enforce "one case
>    variant only" rule, install a pre-receive hook that enforces the
>    rule.

The reason I discovered this issue is that a user came to me to complain
that suddenly their pulls were failing.  Then I had to track down what
the actual problem was (a colleague actually pointed it out to me).

We could add some hooks, but we have a lot of repos, some of which
already have unique hooks that we would have to edit.  And this approach
wouldn't help the next person who gets into this situation, who would
have to again figure out what went wrong, and add the appropriate hook.

Basically, I'm trying to take a poka-yoke approach. Does this seem
reasonable?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: optionally reject case-clone branch names
  2014-05-28 17:56   ` David Turner
@ 2014-05-28 21:58     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2014-05-28 21:58 UTC (permalink / raw
  To: David Turner; +Cc: git mailing list

David Turner <dturner@twopensource.com> writes:

> On Wed, 2014-05-28 at 10:14 -0700, Junio C Hamano wrote:
>> David Turner <dturner@twopensource.com> writes:
>> 
>> > RFC follows:
>> >
>> > 1. On a case-insensitive server, git receive-pack ought to always reject
>> > branches which are same-but-for-case of existing branches.
>> > 2. On a case-sensitive server, the same rule by default, with an option
>> > to allow the old behavior.
>> >
>> > Let me know if, should I write these patches, they would be likely to be
>> > accepted.
>> 
>> There is another a lot simpler possiblity, no?
>> 
>> 3. On any server whose administrator chooses to enforce "one case
>>    variant only" rule, install a pre-receive hook that enforces the
>>    rule.
>
> The reason I discovered this issue is that a user came to me to complain
> that suddenly their pulls were failing.  Then I had to track down what
> the actual problem was (a colleague actually pointed it out to me).
>
> We could add some hooks, but we have a lot of repos, some of which
> already have unique hooks that we would have to edit.  And this approach
> wouldn't help the next person who gets into this situation, who would
> have to again figure out what went wrong, and add the appropriate hook.
>
> Basically, I'm trying to take a poka-yoke approach. Does this seem
> reasonable?

Sort of.  I think #1 is uncontroversial; there is nothing else that
can be done that is more sensible.  As to #2, as your Subject line
says, I think it should be "optionally reject", that is, "the old
behaviour by default, with an option to allow the same ruleas #1".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-28 21:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 22:56 RFC: optionally reject case-clone branch names David Turner
2014-05-28 17:14 ` Junio C Hamano
2014-05-28 17:56   ` David Turner
2014-05-28 21:58     ` Junio C Hamano

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).