From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Moving initialization of log_all_ref_updates
Date: Sun, 7 Jan 2007 04:37:26 -0500 [thread overview]
Message-ID: <20070107093725.GB10351@spearce.org> (raw)
In-Reply-To: <7vbqlb2nqe.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> The patches to prevent Porcelainish that require working tree
> from doing any damage in a bare repository make a lot of sense,
> and I want to make the is_bare_git_dir() function more reliable.
>
> In order to allow the repository owner override the heuristic
> implemented in is_bare_git_dir() if/when it misidentifies a
> particular repository, it would make sense to introduce a new
> configuration variable "[core] bare = true/false", and make
> is_bare_git_dir() notice it.
Yes, this is an excellent idea.
> The scripts would do a 'repo-config --bool --get core.bare' and
> iff the command fails (i.e. there is no such variable in the
> configuration file), it would do the heuristic you implemented
> in your RFC patch [*1*].
Which will come up right most of the time. And when it doesn't,
core.bare is there to bail the user out. I like it.
Do we want to consider having init-db/clone set core.bare based on
what they are being asked to do?
> However, setup_git_env() which is called a lot earlier than we
> even read from the repository configuration currently makes a
> call to is_bare_git_dir(), in order to change the default
> setting for log_all_ref_updates. It somehow feels that this is
> a hack, and I am considering the following patch. What do you
> think?
Ack'd. There's little we can do here then to change the order things
get invoked. That's harder and uglier to change than to just declare
"we don't know what this right now" and guess later. I'd go with
the patch you have now. Maybe post 1.5.0 we can cleanup some of the
init order to get the config file parsing for at least some really
very core properties to occur at the same time as setup_git_env().
One thing I don't like about the config file parsing is that
applications can easily skip doing the core.* property setup.
With my sp/mmap changes this means core.packedGit{Limit,WindowSize}
may not be changed away from their defaults, and yet the application
will perform pack file access. IMHO core.* is core; if you are
going after pack files or loose objects you better also recognize
and honor what core.* says!
> By the way, [*1*] is another thing I hate about the current
> config mechanism. "git-repo-config --get" does not know what
> the possible configuration variables are, let alone what the
> default values for them are. It allows us not to maintain a
> centralized configuration table, which makes it easy to
> introduce ad-hoc variables and gives a warm fuzzy feeling of
> being modular, but my feeling is that it is turning out to be a
> rather high price to pay for scripts.
I was thinking the other day (after reading an earlier email from
you stating the exact same thing) that perhaps we should do a
config registry within the repository. E.g. if you want to access
a property in the config file you should also load its documentation
into a file like config.desc:
$ cat .git/config.desc
[core "bare"]
default =
package = core-git
documentation = "Indicates ...."
[gui "fontdiff"]
default = -family VT100 -size 9 -weight normal
package = git-gui
documentation = "The font for display of a file diff."
I'm not entirely happy with the above format; its just an example.
Obviously we can't change the current repo-config behavior, but
we could add a new "--declared" option which requires that the
property being get/set is also described in .git/config.desc,
failing if it isn't.
--
Shawn.
next prev parent reply other threads:[~2007-01-07 9:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-07 9:24 Moving initialization of log_all_ref_updates Junio C Hamano
2007-01-07 9:37 ` Shawn O. Pearce [this message]
2007-01-07 9:54 ` Junio C Hamano
2007-01-07 10:05 ` Shawn O. Pearce
2007-01-07 10:19 ` [PATCH] git-fetch: allow updating the current branch in a bare repository 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=20070107093725.GB10351@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.