Subject: Re: [PATCH v2 2/2] sha1dc: optionally use sha1collisiondetection as a submodule

From: Junio C Hamano <[email-masked]>
Date: Mon, 22 May 2017 17:48:33 +0900

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

> I thought this should have something like this:
> ...
> the right thing, even though this is set unconditionally. There must
> be some Makefile magic I'm missing here.

The magic you are missing is that to ifdef in $(MAKE), a variable
that is not mentioned (undefined) and set to empty string are both
the same.  You'll fall into its else clause.

> But in any case it would make sense to squash something like this into
> your patch:
>
> diff --git a/Makefile b/Makefile
> index 8d33936a12..4d9c49ae17 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -148,7 +148,8 @@ all::
>  # sha1collisiondetection shipped as a submodule instead of the
>  # non-submodule copy in sha1dc/. This is an experimental option used
>  # by the git project to migrate to using sha1collisiondetection as a
> -# submodule.
> +# submodule. Supplied implicitly if the sha1collisiondetection/
> +# directory is found to be populated.

Yeah, if it is populated, defaults to true, if it is not, defaults
to false.  Either case can be overriden from the command line or
config.mak