Re: [PATCH v5 1/4] git: make super-prefix option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 28, 2016 at 2:50 PM, Brandon Williams <bmwill@xxxxxxxxxx> wrote:

>
>  DESCRIPTION
> @@ -601,6 +602,11 @@ foo.bar= ...`) sets `foo.bar` to the empty string.
>         details.  Equivalent to setting the `GIT_NAMESPACE` environment
>         variable.
>
> +--super-prefix=<path>::
> +       Set a prefix which gives a path from above a repository down to its
> +       root.  One use is to give submodules context about the superproject that
> +       invoked it.  Currently for internal use only.

I would put the "Currently for internal use only." at the beginning, so end
users don't have to bother reading though the description, when they want to
only use kosher flags. (Well, checking `man git fetch` and searching
for 'internal',
there doesn't seem to be a consistent way how to document internal flags :(.
It doesn't however advertise the flag in the SYNOPSIS. Ok it doesn't advertise
a lot of flags in its SYNOPSIS)

> +const char *get_super_prefix()
> +{
> +       if (!super_prefix)
> +               super_prefix = getenv(GIT_SUPER_PREFIX_ENVIRONMENT);

The getenv() function returns a pointer to the value in the
environment, or NULL if there is no match.

So in case this is not set (when e.g. the user did not specify the
super prefix),
we would probe it a couple of times.

The caching effect only occurs when the string is set. So this looks
like we save repetitive
calls, but we do not always do that.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]