Re: git-config: replaces ~/.gitconfig symlink with real file
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 17, 2007, 20:48 UTC
- Message-ID
- <Pine.LNX.4.64.0707172145590.14781@racer.site>
- In-Reply-To
- <m3wswyojj2.fsf@pc7.dolda2000.com>
Hi,
On Tue, 17 Jul 2007, Fredrik Tolf wrote:
Show 15 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > On Mon, 16 Jul 2007, Bradford Smith wrote: > > > >> So, I guess I need to add a GIT_CONFIG_HOME environment variable. If I > >> get that done, I'll send a patch to the list including doc updates. > > > > Alternatively, you could actually not ignore my hint at readlink(2) and > > have a proper fix, instead of playing games with environment variables. > > Wouldn't it be nicer to avoid a lot of the complexity in checking > symlinks, environment variables and what not, and just overwrite the > file in place (with open(..., O_TRUNC | O_CREAT))? Does it happen > terribly often that git-config crashes in the middle and leaves the file > broken?
No, it does not. But when it does, I am not only annoyed. I am PISSED!
The way we do it is the only safe way to do it, and I gladly spend some extra cycles for that. Too often, a small hard disk glitch (or just an empty laptop battery!) took some important data into the void. Too often, I _cursed_ at the machine, even if it was the programmers' fault.
Ciao, Dscho