|
From: Ethan A M. <me...@uw...> - 2020-07-02 04:00:13
|
On Wednesday, 1 July 2020 17:31:03 PDT Henri Menke wrote:
> ---
> I've changed the commit format from %cs to %cd which is supported in
> older git versions as well. I'd like to avoid using %ci because this
> requires an extra pipe to strip off the unnecessary time of day and
> timezone information which makes the code even more ugly and unreadable.
Looks good to me.
Ethan
> src/Makefile.am | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 1b0d8136e..0b261ea47 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -107,12 +107,12 @@ endif
>
> DISTCLEANFILES = timestamp.h
> BUILT_SOURCES = timestamp.h
> -git_current := $(shell cut -c6- $(top_srcdir)/.git/HEAD)
> -timestamp.h: $(top_srcdir)/.git/${git_current} Makefile
> +.PHONY: timestamp.h
> +timestamp.h: Makefile
> @echo Making $@
> @echo "#ifndef GNUPLOT_TIMEBASE_H_INCLUDED" >$@t
> @echo "#define GNUPLOT_TIMEBASE_H_INCLUDED" >>$@t
> - @echo "const char gnuplot_date[] = \"`git --git-dir '$(top_srcdir)/.git' log -1 --format=%ci | cut -b-11`\";" >>$@t
> + @echo "const char gnuplot_date[] = \"`git --git-dir '$(top_srcdir)/.git' log -1 --date=short --format=%cd || stat -c '%.10y' Makefile.am`\";" >>$@t
> @echo "#endif /* GNUPLOT_TIMEBASE_H_INCLUDED */" >> $@t
> @if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi
|