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

Re: [PATCH] Makefile: conditionally include GIT-VERSION-FILE

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Dec 17, 2020, 19:14 UTC
Message-ID
<20201217191447.xrijupbmqulnp3ym@yadavpratyush.com>
In-Reply-To
<ceacd2f6-c9c7-ef93-8bc2-0749770a260f@ramsayjones.plus.com>
On 07/12/20 12:39AM, Ramsay Jones wrote:
Show 28 quoted lines
> 
> The 'clean' target is noticeably slow on cygwin, even for a 'do-nothing'
> invocation of 'make clean'. For example, the second 'make clean' given
> below:
> 
>   $ make clean >/dev/null 2>&1
>   $ make clean
>   GITGUI_VERSION = 0.21.0.85.g3e5c
>   rm -rf git-gui lib/tclIndex po/*.msg
>   rm -rf GIT-VERSION-FILE GIT-GUI-VARS
>   $
> 
> has been timed at 1.934s on my laptop (an old core i5-4200M @ 2.50GHz,
> 8GB RAM, 1TB HDD).
> 
> Notice that the Makefile, as part of processing the 'clean' target, is
> updating the 'GIT-VERSION-FILE' file.  This is to ensure that the
> $(GITGUI_VERSION) make variable is set, once that file had been included.
> However, the 'clean' target does not use the $(GITGUI_VERSION) variable,
> so this is wasted effort.
> 
> In order to eliminate such wasted effort, use the value of the internal
> $(MAKECMDGOALS) variable to only '-include GIT-VERSION-FILE' when the
> target is not 'clean'. (This drops the time down to 0.676s, on my laptop,
> giving an improvement of 65.05%).
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
Applied to git-gui/master. Thanks.
-- 
Regards,
Pratyush Yadav
Previous: Ramsay Jones
Message 2 of 2 in “Makefile: conditionally include GIT-VERSION-FILE”
  1. Makefile: conditionally include GIT-VERSION-FILERamsay Jones, Dec 7, 2020
  2. Pratyush YadavDec 17, 2020

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.