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

Re: Overriding ~/.gitconfig using GIT_CONFIG

From
RPRichard Purdie <rpurdie@rpsys.net>
Date
Aug 29, 2011, 12:16 UTC
Message-ID
<1314620166.5939.282.camel@rex>
In-Reply-To
<20110828130555.GA56765@gmail.com>
On Sun, 2011-08-28 at 06:05 -0700, David Aguilar wrote:
Show 18 quoted lines
> On Fri, Aug 12, 2011 at 09:44:13PM +0100, Richard Purdie wrote:
> > My problem isn't that I want to specify a specific .gitconfig file, I
> > just need it to ignore the one in $HOME. I'm happy for the .git/config
> > file to be used, in fact I need it to be.
> 
> If you're writing a tool then it should restrict itself to
> git's plumbing commands.  You should be able to do just about
> anything without needing to worry about differences in
> configuraiton.  Git commands almost always provide a way to
> override configuration through the use of flags.
> 
> The plumbing commands are listed in the main git manpage.
> See "Low-level commands (plumbing)" here:
> http://www.kernel.org/pub/software/scm/git/docs/
> 
> What is the specific problem solved by overriding the
> configuration?  It may be possible to solve it without needing
> to get too complicated.
I'm not sure writing my own porcelain makes sense in this case.

The tool in question is a build system which is primarily interested in building software. Sometimes the software we want to build is "bleeding edge" and hence rather than download tarballs, we want to interact directly with SCMs like git to obtain it.

The commands I'm using are the likes of "git clone" and "git fetch" although we do use commands listed under the plumbing section too such as ls-remote and read-tree. We do "cache" checkouts and support automatically noticing changes and updating/building.

What I do want to be able to say is "ignore whatever the user might have put in their ~/.gitconfig file" since I've open bug reports about people putting things in there that break builds.

The fetch/clone commands do what I need, apart from being influenced by userconfig so reimplementing them myself doesn't seem like a good approach.

Cheers,
Richard
-- 
Linux Foundation
http://www.yoctoproject.org/
Previous: David AguilarNext: David Aguilar
Message 6 of 12 in “Overriding ~/.gitconfig using GIT_CONFIG”
  1. Richard PurdieAug 12, 2011
  2. Junio C HamanoAug 12, 2011
  3. Junio C HamanoAug 12, 2011
  4. Richard PurdieAug 12, 2011
  5. David AguilarAug 28, 2011
  6. Richard PurdieAug 29, 2011
  7. David AguilarAug 30, 2011
  8. Richard PurdieAug 30, 2011
  9. Jeff KingAug 30, 2011
  10. Richard PurdieAug 30, 2011
  11. Jeff KingAug 30, 2011
  12. Richard PurdieSep 5, 2011

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.