git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2008, 07:07 UTC
Message-ID
<7v4p8s6spa.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0805191523060.19665@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 6 quoted lines
> On Mon, 19 May 2008, Junio C Hamano wrote:
>
>> 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)
Previous: Daniel BarkalowNext: Wincent Colaiuta
Message 21 of 24 in “"not uptodate" changed to "has local changes"”
  1. "not uptodate" changed to "has local changes"Tim Harper, May 3, 2008
  2. Mike RalphsonMay 6, 2008
  3. André Goddard RosaMay 16, 2008
  4. Johannes SchindelinMay 16, 2008
  5. Holger SchurigMay 16, 2008
  6. Francis MoreauMay 16, 2008
  7. Johannes SchindelinMay 16, 2008
  8. Kevin BallardMay 16, 2008
  9. André Goddard RosaMay 17, 2008
  10. Johannes SchindelinMay 17, 2008
  11. Steven WalterMay 17, 2008
  12. Sverre RabbelierMay 17, 2008
  13. Johannes SchindelinMay 17, 2008
  14. Sverre RabbelierMay 17, 2008
  15. Re* [PATCH] "not uptodate" changed to "has local changes"Junio C Hamano, May 17, 2008
  16. Sverre RabbelierMay 17, 2008
  17. Wincent ColaiutaMay 19, 2008
  18. Junio C HamanoMay 19, 2008
  19. Sverre RabbelierMay 19, 2008
  20. Daniel BarkalowMay 19, 2008
  21. Junio C HamanoMay 21, 2008
  22. Wincent ColaiutaMay 17, 2008
  23. Matthieu MoyMay 17, 2008
  24. Sverre RabbelierMay 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.