Re: .gitattributes lookup doesn't respect GIT_WORK_TREE
On Mon, Apr 16, 2018 at 12:40 AM, Andreas Schwabwrote: > On Apr 16 2018, Junio C Hamano wrote: > >> I may be mistaken (I do not have the code in front of me right now) >> but IIRC after the setup.c code runs (which happens quite early in >> the sequence that starts from git.c::cmd_main()), the Git process >> moves to the top level of the working tree, > > git log/show don't appear to do that. Yeah we lazily set up worktree in some cases. Elsewhere in the chdir-notify thread, I suggested that we set up worktree unconditionally (but do not die setup fails; only die when a command specifically requests for worktree). That work would help make this work in most cases. But it's not materialized yet. -- Duy
Re: .gitattributes lookup doesn't respect GIT_WORK_TREE
On Apr 16 2018, Junio C Hamanowrote: > I may be mistaken (I do not have the code in front of me right now) > but IIRC after the setup.c code runs (which happens quite early in > the sequence that starts from git.c::cmd_main()), the Git process > moves to the top level of the working tree, git log/show don't appear to do that. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: .gitattributes lookup doesn't respect GIT_WORK_TREE
Andreas Schwabwrites: > The functions in attr.c do not look at $GIT_WORK_TREE when trying to > find the .gitattributes file. Thus if you are not inside the work tree, > but have GIT_WORK_TREE set attribute lookup will be wrong. I may be mistaken (I do not have the code in front of me right now) but IIRC after the setup.c code runs (which happens quite early in the sequence that starts from git.c::cmd_main()), the Git process moves to the top level of the working tree, and at that point there is no reason to pay attention to $GIT_WORK_TREE or other mechanisms that places the working tree at a non-standard location, because the attributes (or any in-tree files like .gitignore or .gitmodules) will be found relative to the current working directory no matter what. Did we break that recently?