Subject: Re: [PATCH v2 2/3] Documentation: explain how safe.directory works when running under sudo

From: Junio C Hamano <[email-masked]>
Date: Fri, 29 Apr 2022 23:39:51 -0700

Bagas Sanjaya <[email-masked]> writes:

> On Thu, Apr 28, 2022 at 03:58:51AM -0700, Carlo Marcelo Arenas Belón wrote:
>> In a previous patch, the behavior of git was changed so it will be able
>> to find the "effective uid" that is required when git was invoked with
>> sudo to root, for example the internal calls made to git when calling
>> the following in git's own repository:
>> 
>>   $ sudo make install
>>
>
> That is building Git, right?

Why do you want to know?  In other words, if Carlo answers "yes" (or
"no" for that matter), what are you going to do with that piece of
information?  E-mailed communications with people on other
continents are inherently high latency, so it is more efficient to
try reducing number of round trips.  One trick is to make sure that
other side does not have to wonder "what do you need to know it
for?" by telling them upfront why you want to know.  Then they can
guess better what kind of information to what detail you need, in
order to move forward.  If they agree where you want to go with the
information is a good thing, it may even give them an incentive to
give as high quality information as they can as quickly as they can
to you.

Having said all that.

If you re-read the sentence before that sample command line, it
would be clear that the answer is "yes, as that sentence said, it is
building and installing Git".  Especially "when calling the
following in Git's own repository".

But Git in that message is merely an example.  Any piece of software
that wants to run "git" as part of the "make install" procedure
(e.g. to compute the version number, it may run "git describe", when
it knows the build is being run in a Git managed repository, instead
of being in a tarball extract) is affected.