Re: git-clone fails when current user is not in /etc/passwd

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

 



On Wed, Dec 09, 2015 at 05:35:52PM -0500, Taylor Braun-Jones wrote:

> > Well.. reflog needs it. So either you disable reflog at clone time or
> > define name/email via config file. I don't see anything wrong with
> > this behavior.
> 
> Can't git just use "unknown" and "unknown@localhost" if the name or
> email can not be determined from xgetpwuid? This seems to be the way
> that Mercurial behaves.

Yeah, I think there is a mismatch here in the ident code. When we are
making a commit (which is likely to get published and is set in stone),
we ask for "IDENT_STRICT", which will barf if we can't come up with
something sensible. For reflogs, we are OK putting whatever
auto-generated crap in there we can come up with.

But before we even hit the strict-check, we call xgetpwuid_self(), which
unconditionally dies on failure. I think that function needs to be
taught a "gently" form which we use for non-strict ident lookups.
Unfortunately it's a little non-trivial because the strictness will need
to get passed all the way down to ident_default_name() (and we need to
make sure that a non-strict check followed by a strict one does not
fail; i.e., that the first does not pollute the contents of
git_default_name).

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]