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

Re: [PATCH 1/2] revert: refactor code that prints success or failure message

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 13, 2010, 22:16 UTC
Message-ID
<20100713221620.GA4763@burratino>
In-Reply-To
<201007132302.59324.chriscool@tuxfamily.org>
Christian Couder wrote:
Show 11 quoted lines
> I don't know about sh -x but there is this code in test-lib.sh to warn about 
> GIT_TRACE use:
> 
> case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
> 	1|2|true)
> 		echo "* warning: Some tests will not work if GIT_TRACE" \
> 			"is set as to trace on STDERR ! *"
> 		echo "* warning: Please set GIT_TRACE to something" \
> 			"other than 1, 2 or true ! *"
> 		;;
> esac
Oh!  I just remembered
  http://thread.gmane.org/gmane.comp.version-control.git/146767

I guess the answer is we half-support it. Maybe a test_cmp_err() helper to strip out xtrace[1] and GIT_TRACE[2] output is needed.

>> Summary: I was misled by the commit message.
[...]
> Ok, I will improve it.
Thanks, and sorry for the unfocused review.
Jonathan

[1] Sadly, it is not obvious to me that the format of output produced by set -x is portable. Any sufficiently unixy system (e.g., any system supporting the Posix User Portability Utilities option) will use $PS4 which defaults to ‘+ ’ at the beginning of trace lines, but even for Posix that is only optional.

[2] All trace output starts with ‘trace: ’, with one exception.
diff --git a/exec_cmd.c b/exec_cmd.c
index bf22570..75d2930 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -28,7 +28,7 @@ const char *system_path(const char *path)
 	    !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
 	    !(prefix = strip_path_suffix(argv0_path, "git"))) {
 		prefix = PREFIX;
-		trace_printf("RUNTIME_PREFIX requested, "
+		trace_printf("trace: RUNTIME_PREFIX requested, "
 				"but prefix computation failed.  "
 				"Using static fallback '%s'.\n", prefix);
 	}
Previous: Christian CouderNext: Christian Couder
Message 4 of 7 in “revert: refactor code that prints success or failure message”
  1. 1/2 revert: refactor code that prints success or failure messageChristian Couder, Jul 12, 2010
  2. Jonathan NiederJul 12, 2010
  3. Christian CouderJul 13, 2010
  4. Jonathan NiederJul 13, 2010
  5. Christian CouderJul 15, 2010
  6. Ramkumar RamachandraJul 12, 2010
  7. Christian CouderJul 13, 2010

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.