From: Marius Storm-Olsen <marius@trolltech.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [TESTCASE] Failing 'git am' when core.autocrlf=true
Date: Thu, 23 Aug 2007 22:11:21 +0200 [thread overview]
Message-ID: <46CDE9E9.8070702@trolltech.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0708231153150.30176@woody.linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]
Linus Torvalds wrote:
> So the call-chain for this is:
>
> cmd_write_tree ->
> write_tree ->
> write_index ->
> ce_smudge_racily_clean_entry ->
> ce_modified_check_fs ->
> ce_compare_data ->
> index_fd ->
> convert_to_git ->
> ** wrong answer unless auto_crlf is set **
>
> and now "ce_smudge_racily_clean_entry()" will do
> ce->ce_size = htonl(0);
>
> and the one-liner fix I sent out is actually the right fix.
>
> This was harder to find than it should have been, because it
> actually depends on the datestamp of the index file matching the
> datestamp of the file in question!
Thanks for the detailed analysis of the chain of events. It
really helps understand the inner-workings of Git.
I also tried to track this down after your initial patch, but
couldn't find it. The fact that the index is smudged at the time of
the second commit, so the third failed, made me look in the wrong
place.
How about adding a trace for the smudged case, so it's easier to
find similar issues in the future?
--
.marius
From b858610ff4cd42f57a05c815a3e3b43428d67f99 Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
Date: Thu, 23 Aug 2007 22:03:35 +0200
Subject: [PATCH] Add a trace to more easily show that the index has been smudged.
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
---
read-cache.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index 849e8d6..000451c 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1088,6 +1088,7 @@ static void ce_smudge_racily_clean_entry(struct cache_entry *ce)
* for "frotz" stays 6 which does not match the filesystem.
*/
ce->ce_size = htonl(0);
+ trace_printf("trace: index: Index object for '%s' smudged due to being racily clean\n", ce->name);
}
}
--
1.5.3.rc4.mingw.2.3.g3318a-dirty
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
prev parent reply other threads:[~2007-08-23 20:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-23 14:07 [TESTCASE] Failing 'git am' when core.autocrlf=true Marius Storm-Olsen
2007-08-23 17:18 ` Linus Torvalds
2007-08-23 17:45 ` Marius Storm-Olsen
2007-08-23 18:41 ` Junio C Hamano
2007-08-23 19:25 ` Linus Torvalds
2007-08-23 19:23 ` Linus Torvalds
2007-08-23 19:44 ` Junio C Hamano
2007-08-23 20:11 ` Marius Storm-Olsen [this message]
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=46CDE9E9.8070702@trolltech.com \
--to=marius@trolltech.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@linux-foundation.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 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).