git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Case insensitive Git attributes
@ 2016-10-17  1:04 Lars Schneider
  2016-10-17  3:07 ` Stefan Beller
  2016-10-17  8:55 ` Johannes Schindelin
  0 siblings, 2 replies; 15+ messages in thread
From: Lars Schneider @ 2016-10-17  1:04 UTC (permalink / raw)
  To: git

Hi,

Git attributes for path names are generally case sensitive. However, on 
a case insensitive file system (e.g. macOS/Windows) they appear to be
case insensitive (`*.bar` would match `foo.bar` and `foo.BAR`). That 
works great until a Git users joins the party with a case sensitive file 
system. For this Git user only files that match the exact case of the 
attribute pattern get the attributes (only `foo.bar`).

This inconsistent behavior can confuse Git users. An advanced Git user
could use a glob pattern (e.g. `*.[bB][aA][rR]) to match files in a
case insensitive way. However, this can get confusing quickly, too.

I wonder if we can do something about this. One idea could be to add an
attribute "case-sensitive" (or "caseSensitive") and set it to false 
(if desired) for all files in .gitattributes for a given repo.

### .gitattributes example ###

* case-sensitive=false
*.bar something

###

I haven't looked into the feasibility of an implementation, yet. However,
would that be an acceptable approach?

Thanks,
Lars




^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [RFC] Case insensitive Git attributes
@ 2017-01-22 19:25 Dakota Hawkins
  2017-01-23 18:35 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Dakota Hawkins @ 2017-01-22 19:25 UTC (permalink / raw)
  To: Junio C Hamano, Duy Nguyen
  Cc: Johannes Schindelin, Stefan Beller, Lars Schneider, git

Apologies for the delayed bump. I think because we're talking about
affecting the behavior of .gitattributes that it would be better to
have a distinct .gitattributes option, whether or not you also have a
similar config option.

Since .gitattributes is versioned and config options are not, I think
this takes it out of the realm of personal preference. It's already
too easy for somebody to screw up and not have a "required" filter
driver (e.g. git lfs) configured and damage a repo by getting
unnoticed and unfiltered content committed.

I would love a .gitconfig option I could set that would let me stop
manually ignoring case in globs for git commands, but this might
actually make things worse for people if it were included as a config
option only -- suddenly attributes could be applied to different files
for different people.

Of course, if git supported a subset of config options you could
actually version and ensure everybody else has, this wouldn't be a
problem ;)

So, I think the correct (for today) solution is to have two options.
One for .gitattributes globs and one for everything else. I realize
that this might be somewhat controversial, so I wanted to see what
everybody thought.

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

end of thread, other threads:[~2017-01-24  9:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17  1:04 [RFC] Case insensitive Git attributes Lars Schneider
2016-10-17  3:07 ` Stefan Beller
2016-10-17  4:24   ` Torsten Bögershausen
2016-10-17  8:57   ` Johannes Schindelin
2016-10-17  9:12     ` Duy Nguyen
2016-10-17 10:46       ` Johannes Schindelin
2016-10-17 11:02         ` Duy Nguyen
2016-10-17 17:50           ` Junio C Hamano
2016-10-17  8:55 ` Johannes Schindelin
2017-01-22 19:25 Dakota Hawkins
2017-01-23 18:35 ` Junio C Hamano
2017-01-23 18:42   ` Lars Schneider
2017-01-23 19:25     ` Junio C Hamano
2017-01-23 19:38       ` Junio C Hamano
2017-01-24  9:49         ` Lars Schneider

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