From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [RFD] making separate-remote layout easier to use
Date: Sun, 26 Nov 2006 02:39:42 -0500 [thread overview]
Message-ID: <20061126073942.GA30518@spearce.org> (raw)
In-Reply-To: <7vk61iyeq4.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
> > So now we're at a point of:
> >
> > * how do we get this branch information from the remote?
> > * how does the remote store this branch information?
>
> For the former, I was hoping that we could do a new action
> against remote repository that is "get remote information".
Yes, that is completely sane. :)
> As an implementation detail, I think it is one possibility to
> store this information in the config of the repository being
> cloned from. We should be able to use repo-config to
> parse that file in config-like syntax to extract what we would
> want, so we do not have to come up with a new syntax nor a new
> parser, which is a big plus.
Also quite sane. Nobody wants to write new code if we don't really
have to. :)
> Side note: repo-config, especially the updating side of
> it, is one of the programs I find the most brittle in
> the whole system, and it always makes me hesitate when
> somebody proposes to use config file in any important
> way read-write for this reason. But this "reading out
> per-branch information from the file" is read-only so I
> would not worry too much about it.
Now you tell me. git-gui uses repo-config for all of its option
data. It writes back to the config file to save user configured
options, including window layout at quit. It also uses both the
user global and the local repository config files. :)
We can safely update the index, symrefs and refs. Why can't we
also safely update the config file? The biggest problem is its
also a hand-modified file complete with support for comments,
so users expect the file to stay intact during edits. Aside from
that little issue its really a fairly simple format...
> Strictly speaking, however, the config file is a wrong place to
> store it. For one thing it has core.sharedrepository and
> receive.denynonfastforwards that are true configuration to
> control the behaviour of git _at_ _the_ _repository_ the
> configuration is at. The new "branch property" are primarily to
> help the other end, and the "filtering rewinding ones" we want
> at the clone/fetch side wants that information only and not
> interested in the true configuration information at that
> repository.
Yes, of course. I never suggested copy the entire configuration
as is. What we really want to do is take the branch data from the
remote and rewrite it for every branch we fetched into a ref, e.g.:
remote:
[branch "master"]
rewinds = false
description = blah blah
local:
[branch "remotes/origin/master"]
rewinds = false
description = blah blah
while skipping other configuration sections and options that have
no meaning for the local repository. core.sharedrepository is just
one of *many* configuration options that the local repository should
not inherit. remote.<name>.url is another... etc.
> So my preference is:
>
> * store it in a fixed filename under $GIT_DIR/$something, in a
> format that is similar to the true config file.
At which point you might as well put it into $GIT_DIR/config.
People are going to use git-repo-config to edit that file, even if
you say its brittle and maybe shouldn't be used for heavy editing.
Its just damn handy.
Besides of which, lets not forget that something like:
[branch "master"]
rewinds = false
[branch "pu"]
rewinds = true
is not only data for the client to examine. It can be useful in
say git-receive-pack as a much more fine-grained alternative to
receive.denynonfastforwards. If the server's policy is to not
rewind a branch then receive-pack shouldn't let a remote user
rewind it. At which point its useful to have that branch data
in $GIT_DIR/config. :-)
--
next prev parent reply other threads:[~2006-11-26 7:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-25 21:53 [RFD] making separate-remote layout easier to use Junio C Hamano
2006-11-25 22:25 ` Jakub Narebski
2006-11-25 23:19 ` Junio C Hamano
2006-11-25 23:34 ` Jakub Narebski
2006-11-26 3:37 ` Junio C Hamano
2006-11-26 5:30 ` Junio C Hamano
2006-11-26 3:14 ` Shawn Pearce
2006-11-26 3:48 ` Junio C Hamano
2006-11-26 3:34 ` Shawn Pearce
2006-11-26 3:58 ` Junio C Hamano
2006-11-26 4:23 ` Shawn Pearce
2006-11-26 5:11 ` Junio C Hamano
2006-11-26 7:39 ` Shawn Pearce [this message]
2006-11-26 9:13 ` Junio C Hamano
2006-11-26 9:43 ` Jakub Narebski
2006-11-27 0:59 ` Josef Weidendorfer
2006-11-27 1:21 ` Junio C Hamano
2006-11-30 18:16 ` Jon Loeliger
2006-11-30 21:22 ` Junio C Hamano
2006-11-26 9:32 ` Jakub Narebski
2006-11-27 0:41 ` Josef Weidendorfer
2006-11-29 21:32 ` Jon Loeliger
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=20061126073942.GA30518@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 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).