From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Cc: Frank <streamlake@tiscali.it>, Dmitry Potapov <dpotapov@gmail.com>
Subject: [PATCH 0/7] Final words
Date: Sat, 22 Mar 2008 11:06:20 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.00.0803221049090.3020@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.1.00.0803221038320.3020@woody.linux-foundation.org>
So the whole patch series looks like this:
Makefile | 1 +
builtin-read-tree.c | 2 +-
cache.h | 36 +++++++++-------
config.c | 5 ++
dir.c | 2 +-
environment.c | 1 +
name-hash.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++
read-cache.c | 65 +--------------------------
unpack-trees.c | 43 ++++++++++++++++---
unpack-trees.h | 22 +++++-----
10 files changed, 199 insertions(+), 97 deletions(-)
create mode 100644 name-hash.c
and clearly does add more lines than it deletes, but it all really is
pretty simple, and none of this is rocket science or even very intrusive.
What took me longest to do was not the actual code itself, but to get
_just_ the right approach so that the end result would be as simple and
nonintrusive as possible. That core patch 6/7 was redone at least ten
times before I was happy with it.
Anyway, perhaps exactly because I tried very hard to make it all make
sense, I'm actually very very happy with the patch. I suspect it's too
late for v1.5.5 even if I think all the patches are really simple, but I'm
hoping it can go into at least "pu" and have people actually *test* it.
Talking about testing, the kind of safety I wanted to get with this patch
is perhaps best described by the tests I did not on case-insensitive
filesystems, but on regular *good* filesystems together with setting the
"core.ignorecase" config variable.
Here's an example of how that patch 6/7 works and tries to be really
careful even on a case-sensitive filesystem:
mkdir test-case
cd test-case
git init
git config core.ignorecase true
echo "File" > File
git add File
git commit -m "Create 'File'"
git checkout -b other
git rm File
echo "file" > file
git add file
git commit -m "Create 'file'"
echo "File" > File
git checkout master
and now it complains about
error: Untracked working tree file 'File' would be overwritten by merge.
which is correct, because while it is doing its case-insensitivity checks,
it also noticed that "File" did *not* match the stat information for
'file', so it really _is_ an untracked working tree file.
So it's actually trying to be a lot more careful than just saying "ok, we
already know about 'File'". See what happens next:
rm File
ln file File
git checkout master
and now it very happily did the switch to master, even though 'File' got
overwritten, because now it again found that untracked file 'File', but
now it could match it up *exactly* against the case-insensitive file
'file', so git was happy that it wasn't actually throwing away any info,
and the fact that it overwrite 'File' was ok, because it considered it the
same file as 'file'.
So the whole thing is not only able to handle these name aliases, it
actually handles them by checking that it's safe.
Final note: I also did notice that I didn't fix the 'git add" case like I
thought I did, it currently only fixes "git status". So I still want to
fix "git add" and "git mv" to do the right thing when there are case-
insensitive aliases, but that's a separate issue from this particular
series..
Linus
next prev parent reply other threads:[~2008-03-22 18:07 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-22 17:21 [PATCH 0/7] Case-insensitive filesystem support, take 1 Linus Torvalds
2008-03-22 17:22 ` [PATCH 1/7] Make unpack_trees_options bit flags actual bitfields Linus Torvalds
2008-03-22 17:25 ` [PATCH 2/7] Move name hashing functions into a file of its own Linus Torvalds
2008-03-22 17:28 ` [PATCH 3/7] Make "index_name_exists()" return the cache_entry it found Linus Torvalds
2008-03-22 17:30 ` [PATCH 4/7] Make hash_name_lookup able to do case-independent lookups Linus Torvalds
2008-03-22 17:33 ` [PATCH 5/7] Add 'core.ignorecase' option Linus Torvalds
2008-03-22 17:38 ` [PATCH 6/7] Make branch merging aware of underlying case-insensitive filsystems Linus Torvalds
2008-03-22 17:45 ` [PATCH 7/7] Make unpack-tree update removed files before any updated files Linus Torvalds
2008-03-22 18:06 ` Linus Torvalds [this message]
2008-03-22 18:28 ` [PATCH 0/7] Final words Linus Torvalds
2008-03-22 21:19 ` [PATCH 8/7] When adding files to the index, add support for case-independent matches Linus Torvalds
2008-03-22 21:22 ` [PATCH 9/7] Make git-add behave more sensibly in a case-insensitive environment Linus Torvalds
2008-03-23 5:49 ` [PATCH 7/7] Make unpack-tree update removed files before any updated files Junio C Hamano
2008-03-23 6:13 ` [PATCH 6/7] Make branch merging aware of underlying case-insensitive filsystems Junio C Hamano
2008-03-23 15:41 ` Linus Torvalds
2008-03-22 17:36 ` [PATCH 1/7] Make unpack_trees_options bit flags actual bitfields Johannes Schindelin
2008-03-22 17:47 ` Linus Torvalds
2008-03-22 17:57 ` Johannes Schindelin
2008-03-22 22:01 ` [PATCH] t0050: Set core.ignorecase case to activate case insensitivity Steffen Prohaska
2008-03-25 6:57 ` [PATCH] git-init: autodetect core.ignorecase Dmitry Potapov
2008-03-25 9:59 ` Johannes Schindelin
2008-03-25 10:49 ` [PATCH v2] " Dmitry Potapov
2008-03-25 11:03 ` [PATCH] " Dmitry Potapov
2008-03-25 8:14 ` [PATCH 0/7] Case-insensitive filesystem support, take 1 Dmitry Potapov
2008-03-25 21:04 ` Linus Torvalds
2008-03-26 2:46 ` Dmitry Potapov
2008-03-26 3:37 ` Linus Torvalds
2008-03-25 11:39 ` Derek Fawcus
2008-03-25 18:26 ` Jan Hudec
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.1.00.0803221049090.3020@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=streamlake@tiscali.it \
/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.
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).