From: Linus Torvalds <torvalds@osdl.org>
To: Petr Baudis <pasky@ucw.cz>
Cc: Pavel Roskin <proski@gnu.org>, Timo Hirvonen <tihirvon@gmail.com>,
Anand Kumria <wildfire@progsoc.uts.edu.au>,
git@vger.kernel.org
Subject: Re: ~/.git/config ?
Date: Fri, 26 May 2006 20:20:14 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0605262007230.5623@g5.osdl.org> (raw)
In-Reply-To: <20060527025750.GM11941@pasky.or.cz>
On Sat, 27 May 2006, Petr Baudis wrote:
>
> ~/.gitrc might get useful for actually doing what ~/.cvsrc or ~/.cgrc
> does, that is providing default options for git commands. ~/.gitconfig
> would just give you per-user defaults for the repository config file.
I don't think the two are necessarily any different.
I do think that
(a) we might as well use the same syntax. There's no point in having
different syntax for the files, even if they end up having slightly
different usage.
(b) a "user-wide" config file would tend to have different things in it
than a per-repository one, but some of the things it would have in it
are the things that we currently put in the per-repository one.
Notably exactly the "user.name" and "user.email" values.
(c) having a user- (and perhaps a system-) wide config file would make
some things that we do not _yet_ support in the .git/config file
format more natural, but that doesn't necessarily mean that having
them on a per-repo basis would be wrong either.
As an example of (c), let's say that somebody wants to use the CVS aliases
with git. They've used cvs for years, and as a result their brain has
atrophied, and they have a really hard time teaching their fingers to
write "git commit" when they want to write "cvs ci".
So they would do "alias cvs git" in a desperate attempt to save themselves
from CVS, and then add
[alias "co"]
cmd = commit -a
to their .gitrc file. Now, the only thing we'd need to do is to teach
"git.c" to parse that simple "alias.$1.command" variable, and that really
sounds pretty damn easy, no?
And that really does make more sense in a user-wide ".gitrc" file. But at
the same time, there's really no reason to _disallow_ it from the
repo-private .git/config file either. For example, you could do
[alias "publish"]
cmd = push public.site.com:/pub/scm/my-public-repo
and that is somethign that actually makes sense as a per-repository
command alias, so that "git publish" does the right thing for just _that_
repository.
So I would argue that yes, ".gitrc" makes sense, and no, we shouldn't have
a separate ".gitrc" and ".gitconfig", because I think what we really would
want is a way to do default .git/config entries, and that it is _also_ a
very natural way to add some things that we don't do yet.
Linus
PS. I really like my [alias "cmd"] idea. _All_ my ideas are great, of
course, but this one seems even better than some others. No?
next prev parent reply other threads:[~2006-05-27 3:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-26 15:28 ~/.git/config ? Anand Kumria
2006-05-26 16:33 ` Timo Hirvonen
2006-05-26 16:37 ` Jakub Narebski
2006-05-26 16:38 ` Petr Baudis
2006-05-26 17:05 ` Timo Hirvonen
2006-05-26 17:11 ` Petr Baudis
2006-05-27 2:36 ` Pavel Roskin
2006-05-27 2:57 ` Petr Baudis
2006-05-27 3:20 ` Linus Torvalds [this message]
2006-05-27 3:36 ` Linus Torvalds
2006-05-27 4:43 ` Junio C Hamano
2006-05-27 3:40 ` Jakub Narebski
2006-05-27 9:11 ` Junio C Hamano
2006-05-27 12:52 ` Horst von Brand
2006-05-28 21:59 ` [PATCH] Support for configurable git command aliases Petr Baudis
2006-05-28 22:57 ` Jakub Narebski
2006-05-29 3:58 ` Jeff King
2006-05-29 2:01 ` Junio C Hamano
2006-05-29 8:02 ` Petr Baudis
2006-05-27 8:50 ` ~/.git/config ? Nikolai Weibull
2006-05-27 9:09 ` Timo Hirvonen
2006-05-26 17:38 ` Junio C Hamano
2006-05-28 22:26 ` [PATCH] Read configuration also from ~/.gitrc Petr Baudis
2006-05-29 7:20 ` Johannes Schindelin
2006-05-29 14:00 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0605262007230.5623@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
--cc=proski@gnu.org \
--cc=tihirvon@gmail.com \
--cc=wildfire@progsoc.uts.edu.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).