git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] Add an explicit GIT_DIR to the list of excludes

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 4, 2014, 13:52 UTC
Message-ID
<CACsJy8A_CtC_05mja3L-udM_CYwGA46UoN122Xp6kxaUGkFYSw@mail.gmail.com>
In-Reply-To
<CAKpPgvcv10-DNM4xetfmcckG6ancfEn_y7i8EJ3mWQLaELDdUQ@mail.gmail.com>
On Wed, Jun 4, 2014 at 3:55 AM, Pasha Bolokhov <pasha.bolokhov@gmail.com> wrote:
Show 13 quoted lines
>> The case when $GIT_DIR points to a _file_ seems uncovered.
>> setup_git_directory() will transform the file to the directory
>> internally and we never know the .git file's path (so we can't exclude
>> it). So people could accidentally add the .git file in, then remove it
>> from from work tree and suddenly the work tree becomes repo-less. It's
>> not as bad as .git _directory_ because we don't lose valuable data. I
>> don't know if you want to cover this too.
>
> That's right, there is no way of knowing what the original .git file
> was. I guess the only way to work around this problem is to modify
> "read_gitfile()" so it saves the name of the original file. Then we
> can add both that .git-file and GIT_DIR to the exclude list. Not a big
> problem with me, but need to see what you guys think

My view is this non-standard $(basename $GIT_DIR) is a corner case. Unless people who care about it (e.g. you) do something that affects the common ".git" case, or really mess up the code, I don't think it's a problem if you decide to ignore some smaller cases.

-- 
Duy
Previous: Pasha Bolokhov
Message 6 of 6 in “Add an explicit GIT_DIR to the list of excludes”
  1. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, May 27, 2014
  2. Duy NguyenMay 28, 2014
  3. Pasha BolokhovMay 28, 2014
  4. Duy NguyenMay 29, 2014
  5. Pasha BolokhovJun 3, 2014
  6. Duy NguyenJun 4, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.