Re: [PATCH] reset: Better warning message on git reset --mixed <paths>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 15, 2010 at 11:43:59AM +0900, Miles Bader wrote:
> On a similar note, how about a more helpful error message for
> "git reset --hard PATH"?  It took me _ages_ to figure out that I
> needed to do "git checkout PATH" to get that effect...

There's also the mixed reset in a bare repository message that could
use an update.

-- 
David Fries <david@xxxxxxxxx>
http://fries.net/~david/ (PGP encryption key available)

>From fe5837d9222a621c081e22685db65adab32207f6 Mon Sep 17 00:00:00 2001
From: David Fries <david@xxxxxxxxx>
Date: Fri, 2 Jul 2010 09:12:47 -0500
Subject: [PATCH] reset --mixed message update, tell the user what will work

Instead of,
fatal: mixed reset is not allowed in a bare repository
print,
fatal: mixed reset is not allowed in a bare repository, use --soft
To tell the user what they can do, instead of just what they can't.
---
 builtin/reset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 1283068..ebbefe0 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.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]