From: David Fries <david@fries.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] (trivial) add helpful "use --soft" for bare reset
Date: Sun, 26 Jun 2011 17:14:28 -0500 [thread overview]
Message-ID: <20110626221428.GA26780@spacedout.fries.net> (raw)
Add a helpful "use --soft" message for git-reset (mixed) in a bare
repository. This tells the user what they can do, instead of just what
they can't.
Signed-off-by: David Fries <David@Fries.net>
---
When I was first learning how to use git and I needed to reset my bare
repository I would make it a full repository just so I could use
git-reset, a message like the above would have saved me a lot of
effort back then.
I'm not the only one, I received an e-mail yesterday confused on what
to do, found my patch via google "it saved my bacon."
builtin/reset.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/reset.c b/builtin/reset.c
index 98bca04..dd0cc1e 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -332,7 +332,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
setup_work_tree();
if (reset_type == MIXED && is_bare_repository())
- die(_("%s reset is not allowed in a bare repository"),
+ die(_("%s reset is not allowed in a bare repository, use --soft"),
_(reset_type_names[reset_type]));
/* Soft reset does not touch the index file nor the working tree
--
1.7.2.3
next reply other threads:[~2011-06-26 22:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-26 22:14 David Fries [this message]
2011-06-30 17:21 ` [PATCH] (trivial) add helpful "use --soft" for bare reset Junio C Hamano
2011-06-30 19:06 ` David Fries
2011-06-30 20:06 ` Junio C Hamano
2011-06-30 22:08 ` David Fries
2011-07-01 16:39 ` 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=20110626221428.GA26780@spacedout.fries.net \
--to=david@fries.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).