Subject: Re: [PATCH] [Outreachy] patch-ids: fix NEEDSWORK timezone parsing in fast-import.c

From: "Kristoffer Haugsbakk" <[email-masked]>
Date: Fri, 10 Oct 2025 01:57:18 +0200

On Fri, Oct 10, 2025, at 01:49, Okhuomon Ajayi wrote:
> Signed-off-by: Okhuomon Ajayi <[email-masked]>
> ---
>  builtin/fast-import.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/builtin/fast-import.c b/builtin/fast-import.c
> index 606c6aea82..695e1a0ae1 100644
> --- a/builtin/fast-import.c
> +++ b/builtin/fast-import.c
> @@ -1959,14 +1959,15 @@ static int validate_raw_date(const char *src,
> struct strbuf *result, int strict)
>  		return -1;
>
>  	num = strtoul(src + 1, &endp, 10);
> -	/*
> -	 * NEEDSWORK: check for brokenness other than num > 1400, such as
> -	 *            (num % 100) >= 60, or ((num % 100) % 15) != 0 ?
> -	 */
> -	if (errno || endp == src + 1 || *endp || /* did not parse */
> -	    (strict && (1400 < num))             /* parsed a broken timezone */
> -	   )
> +
> +

These two new blank lines should probably not be here.

> +        unsigned int hours = num / 100;
> +        unsigned int minutes = num % 100;
> +

You’re mixing spaces-for-indentation right here with tabs (next).  The
project uses tabs for indentation.

Try to run `./ci/check-whitespace.sh @^`

> +	if (errno || endp == src + 1 || *endp ||
> +	    (strict && (num > 1400 || minutes >=60 || minutes % 15 != 0))){
>  		return -1;
> +	}
>
>  	strbuf_addstr(result, orig_src);
>  	return 0;
> --
> 2.43.0