From: Anders Melchiorsen <mail@cup.kalibalik.dk>
To: git@vger.kernel.org
Cc: Anders Melchiorsen <mail@cup.kalibalik.dk>
Subject: [RFC PATCH 2/2] wt-status: Teach how to discard changes in the working directory
Date: Mon, 8 Sep 2008 00:05:03 +0200 [thread overview]
Message-ID: <1220825103-19599-3-git-send-email-mail@cup.kalibalik.dk> (raw)
In-Reply-To: <1220825103-19599-2-git-send-email-mail@cup.kalibalik.dk>
This is a question that comes up a lot in #git.
---
t/t7502-status.sh | 10 ++++++++++
wt-status.c | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index ceb3a1e..5bc3e36 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -80,6 +80,7 @@ static void wt_status_print_dirty_header(struct wt_status *s,
} else {
color_fprintf_ln(s->fp, c, "# (use \"git add/rm <file>...\" to update what will be committed)");
}
+ color_fprintf_ln(s->fp, c, "# (use \"git checkout -- <file>...\" to discard changes in working directory)");
color_fprintf_ln(s->fp, c, "#");
}
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index 38a48b5..efa1239 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 <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -76,6 +77,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -104,6 +106,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -138,6 +141,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -174,6 +178,7 @@ cat > expect << \EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: modified
#
@@ -204,6 +209,7 @@ cat > expect << \EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -267,6 +273,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -297,6 +304,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -326,6 +334,7 @@ cat >expect <<EOF
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
@@ -357,7 +366,7 @@ cat >expect <<EOF
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
+# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dir1/modified
#
--
1.6.0.1.dirty
next prev parent reply other threads:[~2008-09-07 22:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-07 22:05 [RFC PATCH 0/2] Teach how to discard changes in the working directory Anders Melchiorsen
2008-09-07 22:05 ` [RFC PATCH 1/2] wt-status: Split header generation into three functions Anders Melchiorsen
2008-09-07 22:05 ` Anders Melchiorsen [this message]
2008-09-07 22:48 ` [RFC PATCH 0/2] Teach how to discard changes in the working directory Junio C Hamano
2008-09-07 23:09 ` Pieter de Bie
2008-09-07 23:32 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220825103-19599-3-git-send-email-mail@cup.kalibalik.dk \
--to=mail@cup.kalibalik.dk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).