Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: Re* [PATCH] "not uptodate" changed to "has local changes"

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:37
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Daniel Barkalow [off-list ref] writes:
On Mon, 19 May 2008, Junio C Hamano wrote:
quoted
Why does *everybody* keep missing the whole point of this patch?
That section needs a comment stating that it's the scripting API, not just 
an arbitrary set of messages.
Yeah, that is a very good explanation.  Thanks for a constructive
suggestion for improvements.

Here is an incremental on top of the one I sent out, in case people want
to improve on it.

 unpack-trees.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index da3bdc8..0de5a31 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -8,7 +8,15 @@
 #include "progress.h"
 #include "refs.h"
 
-static struct unpack_trees_error_msgs unpack_default_errors = {
+/*
+ * Error messages expected by scripts out of plumbing commands such as
+ * read-tree.  Non-scripted Porcelain is not required to use these messages
+ * and in fact are encouraged to reword them to better suit their particular
+ * situation better.  See how "git checkout" replaces not_uptodate_file to
+ * explain why it does not allow switching between branches when you have
+ * local changes, for example.
+ */
+static struct unpack_trees_error_msgs unpack_plumbing_errors = {
 	/* would_overwrite */
 	"Entry '%s' would be overwritten by merge. Cannot merge.",
 
@@ -28,7 +36,7 @@ static struct unpack_trees_error_msgs unpack_default_errors = {
 #define ERRORMSG(o,fld) \
 	( ((o) && (o)->msgs.fld) \
 	? ((o)->msgs.fld) \
-	: (unpack_default_errors.fld) )
+	: (unpack_plumbing_errors.fld) )
 
 static void add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
 	unsigned int set, unsigned int clear)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help