Re: [PATCH] Add core.trustlowlevelstat for diffs in dev,ino,uid and gid
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:40
Subsystem:
the rest · Maintainer:
Linus Torvalds
Robin Rosenberg [off-list ref] writes:
söndag 26 april 2009 12:55:17 skrev Robin Rosenberg:quoted
This reason we may want to ignore these fields is that the Java implementation of Git cannot set these fields properly. To mark this JGit sets these fields to to UINT_MAX (all bits set).Oopps, you won't be able to apply this one,...
Yeah, I noticed your ~0u hack, but it is clear what is going on in the patch. I had a similar patch that disables inum checking in my private tree for different reasons of my own; the set of fields your patch ignores is a compatible superset of, and I think makes more sense than, what I was planning to do, so no objections from me on this _optional_ feature. It might be easier (with proper re-indentation, which I omitted from this patch with "diff -w") and more efficient to do this, though...
diff --git a/read-cache.c b/read-cache.c
index 3f58711..03ecd11 100644
--- a/read-cache.c
+++ b/read-cache.c@@ -210,6 +210,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st) changed |= CTIME_CHANGED; #endif + if (trust_lowlevel_stat) { + if (ce->ce_uid != (unsigned int) st->st_uid || ce->ce_gid != (unsigned int) st->st_gid) changed |= OWNER_CHANGED;
@@ -226,6 +228,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st) changed |= INODE_CHANGED; #endif + } if (ce->ce_size != (unsigned int) st->st_size) changed |= DATA_CHANGED;