summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-20 07:21:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-21 00:21:32 (GMT)
commitd14e7407b34b8c11b407358b9677c283c381a71c (patch)
tree2ea98209de908a49d8841a7fc6ccb1e5b186795e /read-cache.c
parent559e840b74dbbf39633aa68627937a5f7a6d4145 (diff)
downloadgit-d14e7407b34b8c11b407358b9677c283c381a71c.zip
git-d14e7407b34b8c11b407358b9677c283c381a71c.tar.gz
git-d14e7407b34b8c11b407358b9677c283c381a71c.tar.bz2
"needs update" considered harmful
"git update-index --refresh", "git reset" and "git add --refresh" have reported paths that have local modifications as "needs update" since the beginning of git. Although this is logically correct in that you need to update the index at that path before you can commit that change, it is now becoming more and more clear, especially with the continuous push for user friendliness since 1.5.0 series, that the message is suboptimal. After all, the change may be something the user might want to get rid of, and "updating" would be absolutely a wrong thing to do if that is the case. I prepared two alternatives to solve this. Both aim to reword the message to more neutral "locally modified". This patch is a more intrusive variant that changes the message for only Porcelain commands ("add" and "reset") while keeping the plumbing "update-index" intact. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 1648428..a50a851 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -980,7 +980,10 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
int not_new = (flags & REFRESH_IGNORE_MISSING) != 0;
int ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;
unsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;
+ const char *needs_update_message;
+ needs_update_message = ((flags & REFRESH_SAY_CHANGED)
+ ? "locally modified" : "needs update");
for (i = 0; i < istate->cache_nr; i++) {
struct cache_entry *ce, *new;
int cache_errno = 0;
@@ -1019,7 +1022,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
}
if (quiet)
continue;
- printf("%s: needs update\n", ce->name);
+ printf("%s: %s\n", ce->name, needs_update_message);
has_errors = 1;
continue;
}