All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Joshua Jensen <jjensen@workspacewhiz.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Mike Hommey <mh@glandium.org>,
	git@vger.kernel.org
Subject: Re: fast-import should not care about core.ignorecase
Date: Tue, 09 Dec 2014 12:19:52 -0800	[thread overview]
Message-ID: <xmqqoarclgnr.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54866A94.2040305@workspacewhiz.com> (Joshua Jensen's message of "Mon, 08 Dec 2014 20:20:52 -0700")

Joshua Jensen <jjensen@workspacewhiz.com> writes:

> Jonathan Nieder wrote on 12/8/2014 6:31 PM:
>> Joshua Jensen wrote:
>>> I think it has been discussed before, but maybe Git needs a
>>> core.casefold in addition to core.ignorecase.)
>> Would it work for --casefold to be a commandline flag to fast-import,
>> instead of a global option affecting multiple Git commands?
> Given that core.ignorecase=true means to fold filename case in quite a
> number of places within Git right now, I would expect the same
> behavior within a repository where fast-import is being run against
> core.ignorecase=true.
>
> So, I don't know what core.ignorecase should mean, but I'm pretty sure
> I know what core.foldcase should mean.
>
> Would --casefold work?  Sure, but it would be a special case against
> the existing core.ignorecase behavior that I don't think makes much
> sense.

I would recommend doing this:

 - Add file-scope static variable fast_import_casefold to fast-import.c

 - Patch fast-import.c where it calls strncmp_icase(a, b) to read

    fast_import_casefold ? strcasecmp(a, b) : strcmp(a, b);

 - Initialize fast_import_casefold to the same value as ignore_case.

 - Add a new command line option "--[no-]casefold" to modify the
   value of fast_import_casefold.

Once all of the above is in place, optionally do this:

 - Add fastImport.casefold configuration variable.  The
   initialization logic for fast_import_casefold would then become:

    1. If the configuration is set, use that value; otherwise
    2. Use the same value as ignore_case.

 - Start warning when fast_import_casefold is set to true only
   because ignore_case is set (i.e. no "--[no-casefold]" is given
   from the command line or from the config), saying that this is
   true for now only as a backward compatibility measure and in a
   later version of Git we will flip the default _not_ to fold on
   any system.

 - Wait a bit and then flip the default.

  reply	other threads:[~2014-12-09 20:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09  0:12 fast-import should not care about core.ignorecase Mike Hommey
2014-12-09  0:22 ` Mike Hommey
2014-12-09  1:07 ` Joshua Jensen
2014-12-09  1:31   ` Jonathan Nieder
2014-12-09  3:20     ` Joshua Jensen
2014-12-09 20:19       ` Junio C Hamano [this message]
2015-04-17 11:52         ` [PATCH] fast-import: add options to enable/disable case folding Mike Hommey
2015-04-17 16:56           ` Torsten Bögershausen
2015-04-17 18:44             ` Junio C Hamano
2015-04-18  7:36               ` Mike Hommey
2015-04-24  9:42                 ` Luke Diamand
2015-04-17 19:57             ` Eric Sunshine

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=xmqqoarclgnr.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jjensen@workspacewhiz.com \
    --cc=jrnieder@gmail.com \
    --cc=mh@glandium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.