From: Anders Melchiorsen Date: Sun, 7 Sep 2008 22:05:03 +0000 (+0200) Subject: wt-status: Teach how to discard changes in the working directory X-Git-Tag: v1.6.1-rc1~204^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d6e4c4d34435c777bd844fe5ee0ec1ca06ffa4a;p=git.git 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 --- diff --git a/t/t7502-status.sh b/t/t7502-status.sh index c8e4c2e7b..1905fb34c 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -46,6 +46,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -76,6 +77,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -104,6 +106,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -138,6 +141,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -174,6 +178,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: modified # @@ -204,6 +209,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -267,6 +273,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -297,6 +304,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -326,6 +334,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -357,6 +366,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # diff --git a/wt-status.c b/wt-status.c index 23702a25c..7cf890f24 100644 --- a/wt-status.c +++ b/wt-status.c @@ -79,6 +79,7 @@ static void wt_status_print_dirty_header(struct wt_status *s, color_fprintf_ln(s->fp, c, "# (use \"git add ...\" to update what will be committed)"); else color_fprintf_ln(s->fp, c, "# (use \"git add/rm ...\" to update what will be committed)"); + color_fprintf_ln(s->fp, c, "# (use \"git checkout -- ...\" to discard changes in working directory)"); color_fprintf_ln(s->fp, c, "#"); }