Re: [PATCH 2/2] read-cache.c: fix timestamp comparison

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Junio C Hamano <gitster@...>, <git@...>
Date: Monday, January 21, 2008 - 3:47 pm

On Mon, 21 Jan 2008, Johannes Schindelin wrote:

Well, the thing is, it's not a special case any more, and you can now see 
the code, and say "that's obviously correct".

The whole point of that function is to compare a index entry with the stat 
information, and it does that by validating it in special ways. It used to 
be that the "ce_mode = 0" was a special case. Now it isn't.

A deleted entry can obviously never match an entry that is still on disk 
(regardless of *any* other issues). So now the

	if (ce->ce_flags & CE_REMOVE)
		return MODE_CHANGED | DATA_CHANGED | TYPE_CHANGED;

statement is in no way a special case - rather the reverse, it's a lot 
more obvious than testing for inode ownership changes etc.

So I removed the comment, because it doesn't make sense any more.

Of course, I could have - instead of deleting it - changed it from 
"Special case: .." to something like "A deleted index entry doesn't match 
any on-disk file", but does that actually add any information to the above 
two lines? Sure, we can comment things, but shouldn't we comment the ones 
that are subtle or odd, rather than the obvious ones?

This was why the CE_REMOVE bit was done in the first place: to remove the 
rather special case of ce_mode being zero meaning something special.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
What's not in 'master', and likely not to be in, until 1.5.4, Junio C Hamano, (Sun Jan 20, 10:37 pm)
[PATCH 2/2] read-cache.c: fix timestamp comparison, Junio C Hamano, (Mon Jan 21, 4:46 am)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Mon Jan 21, 2:47 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Mon Jan 21, 3:09 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Mon Jan 21, 3:24 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Junio C Hamano, (Mon Jan 21, 4:38 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Mon Jan 21, 5:22 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Tue Jan 22, 6:00 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Junio C Hamano, (Tue Jan 22, 11:34 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Tue Jan 22, 11:53 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Junio C Hamano, (Tue Jan 22, 5:47 am)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Tue Jan 22, 1:25 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Junio C Hamano, (Mon Jan 21, 6:02 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Johannes Schindelin, (Mon Jan 21, 3:26 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Linus Torvalds, (Mon Jan 21, 3:47 pm)
Re: [PATCH 2/2] read-cache.c: fix timestamp comparison, Johannes Schindelin, (Mon Jan 21, 3:06 pm)