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

Re: [PATCH V4] config: add --expiry-date

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2017, 03:37 UTC
Message-ID
<xmqq8tf4qmu8.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171118022727.30179-1-hsed@unimetic.com>
hsed@unimetic.com writes:
Show 18 quoted lines
> diff --git a/config.c b/config.c
> index 903abf953..64f8aa42b 100644
> --- a/config.c
> +++ b/config.c
> @@ -990,6 +990,16 @@ int git_config_pathname(const char **dest, const char *var, const char *value)
>  	return 0;
>  }
>  
> +int git_config_expiry_date(timestamp_t *timestamp, const char *var, const char *value)
> +{
> +	if (!value)
> +		return config_error_nonbool(var);
> +	if (parse_expiry_date(value, timestamp))
> +		return error(_("'%s' for '%s' is not a valid timestamp"),
> +			     value, var);
> +	return 0;
> +}
> +

I think this is more correct even within the context of this function than dying, which suggests the need for a slightly related (which is not within the scope of this change) clean-up within this file as a #leftoverbits task. I think dying in these value parsers goes against the point of having die_on_error bit in the config-source structure; Heiko and Peff CC'ed for b2dc0945 ("do not die when error in config parsing of buf occurs", 2013-07-12).

Thanks; will queue.
Previous: hsed@unimetic.comNext: hsed@unimetic.com
Message 14 of 21 in “config: added --expiry-date type support”
  1. config: added --expiry-date type supportHaaris, Nov 12, 2017
  2. Kevin DaudtNov 12, 2017
  3. Jeff KingNov 12, 2017
  4. Jeff KingNov 12, 2017
  5. config: add --expiry-datehsed@unimetic.com, Nov 14, 2017
  6. Christian CouderNov 14, 2017
  7. Marc BranchaudNov 14, 2017
  8. Junio C HamanoNov 14, 2017
  9. hsed@unimetic.comNov 15, 2017
  10. config: add --expiry-datehsed@unimetic.com, Nov 16, 2017
  11. Junio C HamanoNov 16, 2017
  12. hsed@unimetic.comNov 17, 2017
  13. config: add --expiry-datehsed@unimetic.com, Nov 18, 2017
  14. Junio C HamanoNov 18, 2017
  15. hsed@unimetic.comNov 20, 2017
  16. Jeff KingNov 20, 2017
  17. Stefan BellerNov 20, 2017
  18. Jeff KingNov 20, 2017
  19. Heiko VoigtNov 30, 2017
  20. Jeff KingNov 30, 2017
  21. hsed@unimetic.comNov 12, 2017

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.