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

Re: [RFC PATCH] Move SHA-1 implementation selection into a header file

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2017, 17:54 UTC
Message-ID
<xmqqfuiiv0s7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170312130149.czir5hcbosqlmkhb@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> diff --git a/Makefile b/Makefile
> index 9f0eae428..0d65d50e9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -690,6 +690,7 @@ XDIFF_LIB = xdiff/lib.a
>  VCSSVN_LIB = vcs-svn/lib.a
>  
>  GENERATED_H += common-cmds.h
> +GENERATED_H += hash.h
> ...
> -BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
> -	$(COMPAT_CFLAGS)
> +BASIC_CFLAGS += $(COMPAT_CFLAGS)
>   ...
> +hash.h:
> +	$(QUIET_GEN)echo '#include $(SHA1_HEADER)' >$@+ && \
> +	{ cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; }
> +

That looks sensible. We do not have to adjust the code to update GIT-BUILD-OPTIONS and friends in this patch because the current way to force rebuilding when SHA1_HEADER changes is by letting GIT-CFLAGS file notice the change, and the new "hash.h" itself will let the $(MAKE) notice if a different hash implementation is chosen for the build.

Previous: Jeff KingNext: Jonathan Nieder
Message 5 of 16 in “Move SHA-1 implementation selection into a header file”
  1. Move SHA-1 implementation selection into a header filebrian m. carlson, Mar 11, 2017
  2. Jeff KingMar 12, 2017
  3. brian m. carlsonMar 12, 2017
  4. Jeff KingMar 12, 2017
  5. Junio C HamanoMar 12, 2017
  6. Jonathan NiederMar 14, 2017
  7. Jeff KingMar 14, 2017
  8. Junio C HamanoMar 14, 2017
  9. Jeff KingMar 14, 2017
  10. Jonathan NiederMar 14, 2017
  11. Ramsay JonesMar 14, 2017
  12. brian m. carlsonMar 14, 2017
  13. Ramsay JonesMar 15, 2017
  14. Junio C HamanoMar 15, 2017
  15. Ramsay JonesMar 15, 2017
  16. Jonathan NiederMar 14, 2017

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.