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

Re: [PATCH 1/4] Makefile: don't error out under DC_SHA1_EXTERNAL if DC_SHA1_SUBMODULE=auto

From
Jeff King <peff@peff.net>
Date
Dec 5, 2017, 06:53 UTC
Message-ID
<20171205065329.GA4788@sigill.intra.peff.net>
In-Reply-To
<20171128213214.12477-2-avarab@gmail.com>
On Tue, Nov 28, 2017 at 09:32:11PM +0000, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> Fix a logic error in the initial introduction of DC_SHA1_EXTERNAL. If
> git.git has a sha1collisiondetection submodule checked out the logic
> to set DC_SHA1_SUBMODULE=auto would interact badly with the check for
> whether DC_SHA1_SUBMODULE was set.
> 
> It would error out, meaning that there's no way to build git with
> DC_SHA1_EXTERNAL=YesPlease without deinit-ing the submodule.
> 
> Instead, adjust the logic to only fire if the variable is to something
> else than "auto" which would mean it's a mistake on the part of
> whoever's building git, not just the Makefile tripping over its own
> logic.
This all makes sense, and I agree your patch is an improvement.
One minor whitespace nit:
Show 12 quoted lines
> diff --git a/Makefile b/Makefile
> index e53750ca01..8fe8278126 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1497,7 +1497,9 @@ else
>  	LIB_OBJS += sha1dc_git.o
>  ifdef DC_SHA1_EXTERNAL
>  	ifdef DC_SHA1_SUBMODULE
> +ifneq ($(DC_SHA1_SUBMODULE),auto)
>  $(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)
> +endif
>  	endif

The indentation here is funky. Unfortunately I think $(error) can't be tab-indented, so it has to either stay at the left-most side, or we have to use spaces.

But the ifneq/endif pair can be indented. Ordinarily I'd say it's fine to keep it at the outermost (because of the weird error indent), but note that we're _inside_ an already-indented ifdef/endif pair. We should either stay inside there, or we should put the outer one to the left for consistency.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 27 in “SHA1DC fixes & fully moving to a git.git submodule”
  1. 0/4 SHA1DC fixes & fully moving to a git.git submoduleÆvar Arnfjörð Bjarmason, Nov 28, 2017
  2. 1/4 Makefile: don't error out under DC_SHA1_EXTERNAL if DC_SHA1_SUBMODULE=autoÆvar Arnfjörð Bjarmason, Nov 28, 2017
  3. Jeff KingDec 5, 2017
  4. 2/4 sha1dc_git.h: re-arrange an ifdef chain for a subsequent changeÆvar Arnfjörð Bjarmason, Nov 28, 2017
  5. Jeff KingDec 5, 2017
  6. 3/4 Makefile: use the sha1collisiondetection submodule by defaultÆvar Arnfjörð Bjarmason, Nov 28, 2017
  7. Jeff KingDec 5, 2017
  8. Ævar Arnfjörð BjarmasonDec 5, 2017
  9. Junio C HamanoDec 5, 2017
  10. Ævar Arnfjörð BjarmasonDec 5, 2017
  11. Kevin DaudtDec 9, 2017
  12. Kevin DaudtDec 9, 2017
  13. Junio C HamanoDec 5, 2017
  14. 0/5 SHA1DC fixes & fully moving to a git.git submoduleÆvar Arnfjörð Bjarmason, Dec 8, 2017
  15. 1/5 Makefile: don't error out under DC_SHA1_EXTERNAL if DC_SHA1_SUBMODULE=autoÆvar Arnfjörð Bjarmason, Dec 8, 2017
  16. 3/5 sha1dc_git.h: re-arrange an ifdef chain for a subsequent changeÆvar Arnfjörð Bjarmason, Dec 8, 2017
  17. 2/5 Makefile: under "make dist", include the sha1collisiondetection submoduleÆvar Arnfjörð Bjarmason, Dec 8, 2017
  18. Junio C HamanoDec 8, 2017
  19. Ævar Arnfjörð BjarmasonDec 8, 2017
  20. Junio C HamanoDec 19, 2017
  21. 4/5 Makefile: use the sha1collisiondetection submodule by defaultÆvar Arnfjörð Bjarmason, Dec 8, 2017
  22. Junio C HamanoDec 8, 2017
  23. Junio C HamanoDec 8, 2017
  24. Jeff KingDec 9, 2017
  25. Ævar Arnfjörð BjarmasonDec 8, 2017
  26. Kevin DaudtDec 9, 2017
  27. Jeff KingDec 5, 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.