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

Re: bugreport: "git config --global" fails if an invalid .git file present

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 18, 2022, 16:28 UTC
Message-ID
<xmqq35dtseht.fsf@gitster.g>
In-Reply-To
<Yv3ZKcD0L0dSIavr@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> And that would make your case Just Work. But it's also more dangerous;
> if a misconfiguration or transient error caused us to set up an
> unexpected environment, then the results could be quite wrong and
> confusing. Maybe less so for "git config", but for destructive
> operations it's a scarier concept.

That is a good point, especially if destructive command is run in a repository the user didn't mean to run it in, it would not be pretty.

> In your case, the right resolution is probably to delete the bogus .git
> file.

Yup, that was what I said in a draft I wrote a few days ago and still in my outbox ;-)

Previous: Jeff KingNext: Jinwook Jeong
Message 3 of 4 in “bugreport: "git config --global" fails if an invalid .git file present”
  1. Jinwook JeongAug 16, 2022
  2. Jeff KingAug 18, 2022
  3. Junio C HamanoAug 18, 2022
  4. Jinwook JeongAug 24, 2022

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.