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

Re: fatal output from git-show really wants a terminal

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2008, 08:23 UTC
Message-ID
<7vwse1yhgl.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7v3agpzwet.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
>> Isn't the issue about 61b8050 (sending errors to stdout under $PAGER,
>> 2008-02-16)?  With that commit, we changed things so that when we send the
>> standard output to the $PAGER, we dup stderr to the $PAGER as well,
>> because otherwise any output to stderr will be wiped out by whatever the
>> pager does and the user will not notice the breakage.  E.g.
>>
>> 	$ git log
>>
>> will just show reams of output, and you won't see any errors and warnings
>> even if there were any encountered during the process.
>>
>> Unfortunately we did it unconditionally.

By the by, I noticed that the example shown in the commit message of 61b8050 has been broken since 4f3dcc2 (Fix 'git show' on signed tag of signed tag of commit, 2008-07-01).

Here is a fix.
 builtin-log.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git c/builtin-log.c w/builtin-log.c
index 840daf9..99d1137 100644
--- c/builtin-log.c
+++ w/builtin-log.c
@@ -340,7 +340,13 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 					t->tag,
 					diff_get_color_opt(&rev.diffopt, DIFF_RESET));
 			ret = show_object(o->sha1, 1, &rev);
-			objects[i].item = parse_object(t->tagged->sha1);
+			if (ret)
+				break;
+			o = parse_object(t->tagged->sha1);
+			if (!o)
+				ret = error("Could not read object %s",
+					    sha1_to_hex(t->tagged->sha1));
+			objects[i].item = o;
 			i--;
 			break;
 		}
Previous: Junio C HamanoNext: Jeff King
Message 12 of 13 in “fatal output from git-show really wants a terminal”
  1. Tim OlsenDec 10, 2008
  2. Boyd Stephen Smith Jr.Dec 10, 2008
  3. Johannes SixtDec 10, 2008
  4. Tim OlsenDec 10, 2008
  5. Boyd Stephen Smith Jr.Dec 10, 2008
  6. Boyd Stephen Smith Jr.Dec 11, 2008
  7. Jeff KingDec 11, 2008
  8. Boyd Stephen Smith Jr.Dec 11, 2008
  9. Jeff KingDec 11, 2008
  10. Junio C HamanoDec 11, 2008
  11. Junio C HamanoDec 15, 2008
  12. Junio C HamanoDec 15, 2008
  13. Jeff KingDec 15, 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.