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

Re: git config -> "fatal: bad config file"

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 14, 2009, 14:28 UTC
Message-ID
<m3ocqio4gz.fsf@localhost.localdomain>
In-Reply-To
<4A85724C.5060406@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> David Reitter venit, vidit, dixit 14.08.2009 15:38:
Show 17 quoted lines
> > I made a mistake editing my config file using "git config -e".  This  
> > caused git commands to fail.
> > 
> > Trying to fix the problem, I did
> > 
> > git config -e
> > fatal: bad config file line 7 in .git/config
> > 
> > I think the refusal to edit a broken config file is not a good idea.   
> > It's easy to fix for me of course by editing .git/config directly, but  
> > git-config should probably not read the config file at all.
> > 
> > Thanks for your consideration.
> > 
> 
> git needs to read the file because the editor could be configured there!
> The only option would be to make git config -e continue past that error.

Well, it shows you which file the error is, but I think as a special case "git config [file] --edit" should show also (absolute?) pathname of the file it tired to open.

core.editor can be in any place.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: David ReitterNext: Michael J Gruber
Message 4 of 14 in “git config -> "fatal: bad config file"”
  1. David ReitterAug 14, 2009
  2. Michael J GruberAug 14, 2009
  3. David ReitterAug 14, 2009
  4. Jakub NarebskiAug 14, 2009
  5. git-config: Parse config files lenientlyMichael J Gruber, Aug 14, 2009
  6. Junio C HamanoAug 14, 2009
  7. Michael J GruberAug 17, 2009
  8. Junio C HamanoAug 17, 2009
  9. [PATCHv2] git-config: Parse config files lenientlyMichael J Gruber, Sep 2, 2009
  10. Junio C HamanoSep 3, 2009
  11. Michael J GruberSep 3, 2009
  12. Junio C HamanoSep 3, 2009
  13. Michael J GruberSep 4, 2009
  14. Junio C HamanoSep 4, 2009

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.