Re: [PATCH 06/16] diff: always try to set up the repository

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

 



On Tue, Sep 13, 2016 at 03:00:17PM -0700, Stefan Beller wrote:

> On Mon, Sep 12, 2016 at 8:23 PM, Jeff King <peff@xxxxxxxx> wrote:
> 
> >   2. If you're in a subdirectory of a repository, then we
> >      still try to read ".git/config", but it generally
> >      doesn't exist. So "diff --no-index" there does not
> >      respect repo config.
> 
> Nit:
> So IIUC your cover letter even this /used/ to work but
> broke only recently? So I feel like the message is a bit
> misleading (i.e. you argue for a change in behavior instead of
> calling it a bug fix for a regression. I think a bug fix for a regression
> is harder to revert as compared to a "new" behavior)

No, this has always been broken. What broke recently is the tests
covered in patch 14 related to git-init.

IOW, we have always done this "blind read" of .git/config, ever since
the early days. It was always wrong, but was mostly overlooked because
it worked often enough and usually didn't cause other problems. But
because of the caching and lazy-reading done by git_config() these days
(and get_shared_repository() which builds on it), you can get quite
confusing and buggy effects if you lazy-read at the wrong time.

-Peff



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