Re: [PATCH V2] config: add --expiry-date
- From
- hsed@unimetic.com <hsed@unimetic.com>
- Date
- Nov 15, 2017, 22:10 UTC
- Message-ID
- <d1c0558cd56b4509c3e34daa48fd528d@unimetic.com>
- In-Reply-To
- <xmqqshdh2wln.fsf@gitster.mtv.corp.google.com>
On 2017-11-14 06:38, Junio C Hamano wrote:
Show 38 quoted lines
> hsed@unimetic.com writes: > >> From: Haaris <hsed@unimetic.com> >> >> Description: >> This patch adds a new option to the config command. >> >> ... >> >> Motivation: >> A parse_expiry_date() function already existed for api calls, >> this patch simply allows the function to be used from the command >> line. >> >> Signed-off-by: Haaris <hsed@unimetic.com> >> --- > > Please drop all these section headers; they are irritating. Learn > from "git log --no-merges" how the log messages in this project is > written and imitate them. Documentation/SubmittingPatches would be > helpful. > > Add --expiry-date as a new type 'git config --get' takes, > similar to existing --int, --bool, etc. types, so that > scripts can learn values of configuration variables like > gc.reflogexpire (e.g. "2.weeks") in a more useful way > (e.g. the timesamp as of two weeks ago, expressed in number > of seconds since epoch). > > As a helper function necessary to do this already exists in > the implementation of builtin/reflog.c, the implementation > is just the matter of moving it to config.c and using it > from bultin/config.c, but shuffle the order of the parameter > so that the pointer to the output variable comes first. > This is to match the convention used by git_config_pathname() > and other helper functions. > > or something like that?
Hi, I am sorry for not following the format properly. I will change this for next patch update.
Show 6 quoted lines
>
>> + } else if (types == TYPE_EXPIRY_DATE) {
>> + timestamp_t t;
>> + if(git_config_expiry_date(&t, key_, value_) < 0)
>
> Style.Sure.
Show 8 quoted lines
> > if (git_config_expiry_date(&t, key_, value_) < 0) > >> + return -1; >> + strbuf_addf(buf, "%"PRItime, t); >> ... > > Thanks.
Kind Regards, Haaris