Re: [PATCH 2/2] date: make "local" orthogonal to date format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 31, 2015 at 10:27:54PM +0100, John Keeping wrote:

> This fails t6300 with:
> 
> fatal: unknown date-mode modifier: my date is %Y-%m-%d
> not ok 83 - Check format of strftime date fields
> #
> #               echo "my date is 2006-07-03" >expected &&
> #               git for-each-ref \
> #                 --format="%(authordate:format:my date is %Y-%m-%d)" \
> #                 refs/heads >actual &&
> #               test_cmp expected actual
> #

Whoops. I obviously did not actually run the test suite. I think when
writing the commit message, my brain said "we are not changing anything,
so no need to run the tests", forgetting that I did not run them the
first time when posting an untested "eh, how about this" patch.

> The following squash-in fixes it:
> 
> diff --git a/date.c b/date.c
> index aa57cad..3aa8002 100644
> --- a/date.c
> +++ b/date.c
> @@ -817,9 +817,7 @@ void parse_date_format(const char *format, struct date_mode *mode)
>  		if (!skip_prefix(p, ":", &p))
>  			die("date format missing colon separator: %s", format);
>  		mode->strftime_fmt = xstrdup(p);
> -	}
> -
> -	if (*p)
> +	} else if (*p)
>  		die("unknown date-mode modifier: %s", p);

Yeah, that works. We could also advance "p" in the DATE_STRFTIME
conditional, but I think your solution is less ugly.

Thanks for debugging my mess.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]