From: Karl Chen <quarl@cs.berkeley.edu>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Support "core.excludesfile = ~/.gitignore"
Date: Sun, 24 Aug 2008 01:40:41 -0700 [thread overview]
Message-ID: <quack.20080824T0140.lth3aku956e@roar.cs.berkeley.edu> (raw)
In-Reply-To: <7vsksw92nh.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Fri\, 22 Aug 2008 14\:10\:42 -0700")
>>>>> On 2008-08-22 14:10 PDT, Junio C Hamano writes:
Junio> Karl Chen <quarl@cs.berkeley.edu> writes:
>> Another idea is to have a non-absolute path be interpreted
>> relative to the location of .gitconfig.
Junio> If we were to support relative paths, I think it would
Junio> be useful and consistent if a relative path found in
Junio> ".git/config" is relative to the work tree root, in
Junio> "config" in a bare repository relative to the bare
Junio> repository, and in "$HOME/.gitconfig" relative to
Junio> $HOME.
Makes sense to support it everywhere. For .git/config, isn't it
more consistent for it to be relative to .git?
Junio> I am not sure what a relative path in "/etc/gitconfig"
Junio> should be relative to, though.
Why not just relative to the location of that file? Normally
/etc, but if some distro customizes the location of /etc/gitconfig
(/etc/git/config), or on non-Linux/posix systems it's somewhere
else, or git is installed in /usr/local or /opt or $HOME, then
it's still relative to the location of system gitconfig.
Junio> However, this has a technical difficulty. When
Junio> configuration values are read, the code that knows what
Junio> the value means does not in general know which
Junio> configuration file is being read from.
Sounds like a refactoring issue.
Junio> It is quite likely that somebody would want you to
Junio> interpret "~name/" if you advertize that you support
Junio> "~/", so you would need to call getpwuid() eventually
Junio> if you go down this path. I wonder how this would
Junio> affect Windows folks.
I would be happy either way. Though since git uses getenv("HOME")
to find ~/.gitconfig, I can see arguments for looking for the
ignore file there also, in case it's different.
Junio> we would need a "--path" option to "git config" (the
Junio> idea is similar to existing "--bool" option) so that
Junio> calling scripts can ask the same "magic" performed to
Junio> configuration variables' values before being reported.
Sounds fine.
So, being new to git development, am I correctly assessing your
response as "with refinement this can be included in git"?
Relative paths and ~ (and $HOME) are all mutually compatible so
they could all be implemented. If $HOME were supported directly
(either just "$HOME" or parsing all $ENVVARS) then it'd be easier
to decide to use getpwuid for ~. Personally I'd use: 1) relative
path, 2) $HOME (as "~" or "$HOME"), 3) getpwuid (as "~")
Karl
next prev parent reply other threads:[~2008-08-24 8:41 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 4:14 [PATCH] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-22 16:58 ` Eric Raible
2008-08-22 17:56 ` Bert Wesarg
2008-08-22 21:10 ` Junio C Hamano
2008-08-24 8:40 ` Karl Chen [this message]
2008-08-24 18:11 ` Junio C Hamano
2008-08-24 22:08 ` Jeff King
2008-08-24 22:59 ` Junio C Hamano
2008-08-24 23:13 ` Jeff King
2008-08-24 23:40 ` Junio C Hamano
2008-08-24 23:51 ` limiting relationship of git dir and worktree (was Re: [PATCH] Support "core.excludesfile = ~/.gitignore") Jeff King
2008-08-25 0:30 ` Dropping core.worktree and GIT_WORK_TREE support (was Re: limiting relationship of git dir and worktree) Junio C Hamano
2008-08-25 2:00 ` Miklos Vajna
2008-08-25 3:05 ` Dropping core.worktree and GIT_WORK_TREE support Junio C Hamano
2008-08-25 12:52 ` Miklos Vajna
2008-08-25 13:52 ` Nguyen Thai Ngoc Duy
2008-08-25 14:43 ` [PATCH] git diff/diff-index/diff-files: call setup_work_tree() Miklos Vajna
2008-08-25 14:46 ` Nguyen Thai Ngoc Duy
2008-08-25 14:50 ` Miklos Vajna
2008-08-25 15:11 ` Miklos Vajna
2008-08-25 15:26 ` Nguyen Thai Ngoc Duy
2008-08-26 23:58 ` Junio C Hamano
2008-08-28 13:02 ` [PATCH] diff*: fix worktree setup Nguyễn Thái Ngọc Duy
2008-08-25 21:21 ` Dropping core.worktree and GIT_WORK_TREE support Junio C Hamano
2008-08-25 21:37 ` Miklos Vajna
2008-08-26 7:35 ` Dropping core.worktree and GIT_WORK_TREE support (was Re: limiting relationship of git dir and worktree) Michael J Gruber
2008-08-27 0:49 ` Jeff King
2008-08-25 19:07 ` [PATCH v2] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-26 6:42 ` Johannes Sixt
2008-08-27 0:25 ` Jeff King
2008-08-27 3:12 ` Karl Chen
2008-08-27 5:01 ` Junio C Hamano
2008-08-28 9:09 ` [PATCH v3] Expand ~ and ~user in core.excludesfile, commit.template Karl Chen
2008-08-29 3:26 ` Jeff King
2008-08-29 4:08 ` Junio C Hamano
2008-08-29 9:29 ` [PATCH v4] " Karl Chen
2008-08-29 16:08 ` Junio C Hamano
2008-08-29 19:01 ` Karl Chen
2008-08-29 19:28 ` Junio C Hamano
2008-08-29 22:34 ` Karl Chen
2008-08-30 5:31 ` Junio C Hamano
2008-08-30 6:02 ` Jeff King
2008-08-29 7:00 ` [PATCH v3] " Johannes Sixt
2008-08-27 3:18 ` [PATCH v2] Support "core.excludesfile = ~/.gitignore" Karl Chen
2008-08-27 4:50 ` Junio C Hamano
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=quack.20080824T0140.lth3aku956e@roar.cs.berkeley.edu \
--to=quarl@cs.berkeley.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).