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

Re: [PATCH] pretty format string support for reflog times

From
Jeff King <peff@peff.net>
Date
Jul 27, 2016, 17:58 UTC
Message-ID
<20160727175800.GB32219@sigill.intra.peff.net>
In-Reply-To
<xmqqk2g7vurb.fsf@gitster.mtv.corp.google.com>
On Wed, Jul 27, 2016 at 10:46:48AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> I am not sure about the latter, i.e. the return value from the
> get_reflog_time_t() function (which I think is misnamed, in that the
> function returns "unsigned long", not "time_t", and should be
> renamed to get_reflog_time()) uses the epoch as a fallback value.
> [...]
> @@ -330,7 +330,7 @@ unsigned long get_reflog_time_t(struct reflog_walk_info *reflog_info)
>  	struct reflog_info *info = get_reflog_info(reflog_info);
>  
>  	if (!info)
> -		return NULL;
> +		return 0;
>  	return gm_time_t(info->timestamp, info->tz);
>  }

Our mails just crossed, but I think returning even "0" is not ideal. We should probably write nothing to match things like "%gd" and "%gs", which just eat the placeholder and show nothing when they cannot access the reflog.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 10 of 20 in “pretty format string support for reflog times”
  1. pretty format string support for reflog timesPhil Pennock, Jul 27, 2016
  2. Phil PennockJul 27, 2016
  3. Jeff KingJul 27, 2016
  4. Phil PennockJul 27, 2016
  5. Junio C HamanoJul 27, 2016
  6. Jeff KingJul 27, 2016
  7. Junio C HamanoJul 27, 2016
  8. Jeff KingJul 27, 2016
  9. Junio C HamanoJul 27, 2016
  10. Jeff KingJul 27, 2016
  11. Jeff KingJul 27, 2016
  12. Phil PennockJul 27, 2016
  13. Jeff KingJul 27, 2016
  14. 0/2 t4205 style fixesJeff King, Jul 27, 2016
  15. 1/2 t4205: drop top-level &&-chainingJeff King, Jul 27, 2016
  16. 2/2 t4205: indent here documentsJeff King, Jul 27, 2016
  17. Junio C HamanoJul 27, 2016
  18. Jeff KingJul 27, 2016
  19. Phil PennockJul 27, 2016
  20. Jeff KingJul 27, 2016

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.