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

2015-12-10 Thread Jeff King
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

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

2015-12-10 Thread Taylor Braun-Jones
On Thu, Dec 10, 2015 at 1:43 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> 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. > > Hmm, I am not

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

2015-12-10 Thread Junio C Hamano
Jeff King writes: > 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

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

2015-12-10 Thread Jeff King
On Thu, Dec 10, 2015 at 11:57:41AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > 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

[PATCH 0/3] git-clone fails when current user is not in /etc/passwd

2015-12-10 Thread Jeff King
On Thu, Dec 10, 2015 at 03:40:35PM -0500, Jeff King wrote: > > All true. The adding of "(none)" in add_domainname() I used as an > > excuse to make the function stop barfing is a symptom coming from > > the above. That one should die when asked to do a strict thing > > (there is a corresponding

Re: [PATCH 0/3] git-clone fails when current user is not in /etc/passwd

2015-12-10 Thread Junio C Hamano
Jeff King writes: > I don't think we want to pass down a "be strict" flag to the low-level > code filling in default_{name,email}. We might be strict in one call, > and non-strict in another within the same program. Worse, we actually > call ident_default_name() even when we don't

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

2015-12-10 Thread Junio C Hamano
Duy Nguyen writes: > 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. Hmm, I am not quite sure about that. In the codepath that computes ident_default_email(), which is

Re: [PATCH 0/3] git-clone fails when current user is not in /etc/passwd

2015-12-10 Thread Taylor Braun-Jones
On Thu, Dec 10, 2015 at 4:32 PM, Jeff King wrote: > So here's my solution, which instead carries the "is it bogus" flag > along with the default strings. > > [1/3]: ident: make xgetpwuid_self() a static local helper > [2/3]: ident: keep a flag for bogus default_email >

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

2015-12-10 Thread Taylor Braun-Jones
On Wed, Dec 9, 2015 at 5:35 PM, Taylor Braun-Jones wrote: > > On Wed, Dec 9, 2015 at 1:24 PM, Duy Nguyen wrote: > > On Wed, Dec 9, 2015 at 5:08 PM, Duy Nguyen wrote: > >> On Wed, Dec 2, 2015 at 9:10 PM, Taylor Braun-Jones > >>

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

2015-12-09 Thread Duy Nguyen
On Wed, Dec 2, 2015 at 9:10 PM, Taylor Braun-Jones wrote: > My use case it running git clone inside a docker container with > `docker run --user $(id -u):$(id -g) --volume /foo:/foo ...`. I want > all /foo/* file creation/access from inside the Docker container to be >

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

2015-12-09 Thread Taylor Braun-Jones
What's the feeling on this one? If there's agreement in principle that git-clone should not fail when the current UID cannot be found in /etc/passwd then I'm happy to submit a patch to fix it. Thanks, Taylor On Wed, Dec 2, 2015 at 3:10 PM, Taylor Braun-Jones wrote: > My

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

2015-12-09 Thread Duy Nguyen
On Wed, Dec 9, 2015 at 5:08 PM, Duy Nguyen wrote: > On Wed, Dec 2, 2015 at 9:10 PM, Taylor Braun-Jones > wrote: >> My use case it running git clone inside a docker container with >> `docker run --user $(id -u):$(id -g) --volume /foo:/foo ...`. I want >>

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

2015-12-09 Thread Taylor Braun-Jones
On Wed, Dec 9, 2015 at 1:24 PM, Duy Nguyen wrote: > On Wed, Dec 9, 2015 at 5:08 PM, Duy Nguyen wrote: >> On Wed, Dec 2, 2015 at 9:10 PM, Taylor Braun-Jones >> wrote: >>> My use case it running git clone inside a docker container with

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

2015-12-02 Thread Taylor Braun-Jones
My use case it running git clone inside a docker container with `docker run --user $(id -u):$(id -g) --volume /foo:/foo ...`. I want all /foo/* file creation/access from inside the Docker container to be done as the current uid/gid of the host system. Steps to reproduce: mkdir /tmp/docker-git