git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: gitster@pobox.com, git@vger.kernel.org, peff@peff.net,
	j.sixt@viscovery.net, Brandon Casey <drafnel@gmail.com>
Subject: Re: [PATCH v3 5/5] attr.c: respect core.ignorecase when matching attribute patterns
Date: Sun, 09 Oct 2011 17:16:24 +0200	[thread overview]
Message-ID: <4E91BAC8.9060606@alum.mit.edu> (raw)
In-Reply-To: <U4wiHVyDLLG1PhI-8iY3YhHT7CEcTMEfg9MCDSaeuwAkg0N1a5wRE5NXaKAVQx8kpEYt75REVpRavoc-HiKe6rLk2AUepzHWptkevo08MRbGyWxqBHT_rySLemcbi66NKLRXwFGtaRQ@cipher.nrlssc.navy.mil>

On 10/06/2011 08:22 PM, Brandon Casey wrote:
> The last set of tests is performed only on a case-insensitive filesystem.
> Those tests make sure that git handles the case where the .gitignore file
> resides in a subdirectory and the user supplies a path that does not match
> the case in the filesystem.  In that case^H^H^H^Hsituation, part of the
> path supplied by the user is effectively interpreted case-insensitively,
> and part of it is dependent on the setting of core.ignorecase.  git should
> only match the portion of the path below the directory holding the
> .gitignore file according to the setting of core.ignorecase.

Isn't this a rather perverse scenario?  It is hard to imagine that
anybody *wants* part of a single filename to be matched
case-insensitively and another part to be matched case-sensitively.
ISTM that a person who is using a case-insensitive filesystem and has
core-ignorecase=false is (1) a glutton for punishment and (2) probably
very careful to make sure that the case of all pathnames is correct.  So
such a person is not likely to benefit from this schizophrenic behavior.

> [...]  If git instead built the attr
> stack by scanning the repository, then the paths in the origin field would
> not necessarily match the paths supplied by the user.  If someone makes a
> change like that in the future, these tests will notice.

Your decision to treat path names as partly case-insensitive will make
this kind of improvement considerably more complicated.

Therefore, weighing the negligible benefit of declaring this
schizophrenic behavior against the potential big pain of remaining
backwards-compatible with this behavior, I suggest that we either (1)
declare that when core.ignorecase=false then the *whole* filenames
(including the path leading up to the .gitignore file) must match
case-sensitively, or (2) declare the behavior in this situation to be
undefined so that nobody thinks they should depend on it.

But given that I'm a potential implementer but not a potential Windows
user, perhaps my judgment is biased...

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

  reply	other threads:[~2011-10-09 15:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VYN8m1JCy102-eaWWa-bsunEvt3zeXLJkVg7FZKZCtXT-Ww0vg7a8xA7NTvrZTiovKTnJ9Hlom0@cipher.nrlssc.navy.mil>
2011-10-06 18:22 ` [PATCH v3 1/5] attr.c: avoid inappropriate access to strbuf "buf" member Brandon Casey
2011-10-06 18:22 ` [PATCH v3 2/5] cleanup: use internal memory allocation wrapper functions everywhere Brandon Casey
2011-10-06 18:22 ` [PATCH v3 3/5] builtin/mv.c: plug miniscule memory leak Brandon Casey
2011-10-06 18:22 ` [PATCH v3 4/5] attr: read core.attributesfile from git_default_core_config Brandon Casey
2011-10-06 18:22 ` [PATCH v3 5/5] attr.c: respect core.ignorecase when matching attribute patterns Brandon Casey
2011-10-09 15:16   ` Michael Haggerty [this message]
2011-10-10 18:01     ` Brandon Casey
2011-10-11  3:44       ` Michael Haggerty
2011-10-11 15:53         ` [PATCH v4] " Brandon Casey
2011-10-11 16:54           ` Junio C Hamano
2011-10-12 20:18             ` Brandon Casey
2011-10-12 20:24               ` Junio C Hamano
2011-10-11  0:00     ` [PATCH v3 5/5] " Junio C Hamano

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=4E91BAC8.9060606@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=casey@nrlssc.navy.mil \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=peff@peff.net \
    /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).