wt-status: Teach how to discard changes in the working directory
This is a question that comes up a lot in #git. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Anders Melchiorsen committed
Sep 8, 2008 at 00:05 UTC
4d6e4c4d34435c777bd844fe5ee0ec1ca06ffa4a
2 files changed
+11
t/t7502-status.sh
+10
@@ -46,6 +46,7 @@ cat > expect << \EOF
46
#
47
# Changed but not updated:
48
# (use "git add <file>..." to update what will be committed)
49
+# (use "git checkout -- <file>..." to discard changes in working directory)
50
#
51
# modified: dir1/modified
52
#
@@ -76,6 +77,7 @@ cat >expect <<EOF
77
#
78
# Changed but not updated:
79
# (use "git add <file>..." to update what will be committed)
80
+# (use "git checkout -- <file>..." to discard changes in working directory)
81
#
82
# modified: dir1/modified
83
#
@@ -104,6 +106,7 @@ cat >expect <<EOF
106
#
107
# Changed but not updated:
108
# (use "git add <file>..." to update what will be committed)
109
+# (use "git checkout -- <file>..." to discard changes in working directory)
110
#
111
# modified: dir1/modified
112
#
@@ -138,6 +141,7 @@ cat >expect <<EOF
141
#
142
# Changed but not updated:
143
# (use "git add <file>..." to update what will be committed)
144
+# (use "git checkout -- <file>..." to discard changes in working directory)
145
#
146
# modified: dir1/modified
147
#
@@ -174,6 +178,7 @@ cat > expect << \EOF
178
#
179
# Changed but not updated:
180
# (use "git add <file>..." to update what will be committed)
181
+# (use "git checkout -- <file>..." to discard changes in working directory)
182
#
183
# modified: modified
184
#
@@ -204,6 +209,7 @@ cat > expect << \EOF
209
#
210
# Changed but not updated:
211
# (use "git add <file>..." to update what will be committed)
212
+# (use "git checkout -- <file>..." to discard changes in working directory)
213
#
214
# modified: dir1/modified
215
#
@@ -267,6 +273,7 @@ cat >expect <<EOF
273
#
274
# Changed but not updated:
275
# (use "git add <file>..." to update what will be committed)
276
+# (use "git checkout -- <file>..." to discard changes in working directory)
277
#
278
# modified: dir1/modified
279
#
@@ -297,6 +304,7 @@ cat >expect <<EOF
304
#
305
# Changed but not updated:
306
# (use "git add <file>..." to update what will be committed)
307
+# (use "git checkout -- <file>..." to discard changes in working directory)
308
#
309
# modified: dir1/modified
310
#
@@ -326,6 +334,7 @@ cat >expect <<EOF
334
# On branch master
335
# Changed but not updated:
336
# (use "git add <file>..." to update what will be committed)
337
+# (use "git checkout -- <file>..." to discard changes in working directory)
338
#
339
# modified: dir1/modified
340
#
@@ -357,6 +366,7 @@ cat >expect <<EOF
366
#
367
# Changed but not updated:
368
# (use "git add <file>..." to update what will be committed)
369
+# (use "git checkout -- <file>..." to discard changes in working directory)
370
#
371
# modified: dir1/modified
372
#
wt-status.c
+1
@@ -79,6 +79,7 @@ static void wt_status_print_dirty_header(struct wt_status *s,
79
color_fprintf_ln(s->fp, c, "# (use \"git add <file>...\" to update what will be committed)");
80
else
81
color_fprintf_ln(s->fp, c, "# (use \"git add/rm <file>...\" to update what will be committed)");
82
+ color_fprintf_ln(s->fp, c, "# (use \"git checkout -- <file>...\" to discard changes in working directory)");
83
color_fprintf_ln(s->fp, c, "#");
84
}
85