From: Junio C Hamano <junkio@cox.net>
To: Shawn Pearce <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [RFD] making separate-remote layout easier to use
Date: Sun, 26 Nov 2006 01:13:28 -0800 [thread overview]
Message-ID: <7v1wnqwoxz.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 20061126073942.GA30518@spearce.org
Shawn Pearce <spearce@spearce.org> writes:
>> 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.
I never misunderstood your plan as such. I was more worried
about a case where you clone from a not-so-public repository and
the config file has some information of sensitive nature.
Currently we do not have any such variable, so I am probably
being a bit paranoid here, but using the config for the purpose
of what we are discussing right now closes the door to store
sensitive information and declare that the config file at the
remote is "none of the cloner's business".
However,...
> 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. :-)
This is a good point. If we want to ever have a 'not to be
leaked' configuration per repository, we can have a separate,
private, configuration file to store that, so I probably should
not worry too much about this at this point. I'm Ok with having
this in the usual config -- the convenience outweighs the
purity.
To summarize:
* A repository can have branch."foo".rewinds configuration to
mark the "foo" branch to be subject to rewinding. This
configuration variable defaults to false.
* Receive.denynonfastforwards is currently a boolean but a new
value, "per-branch", is also allowed. When it is set to
"per-branch", non fast-forward update is allowed only when
branch."foo".rewinds is true for the branch.
* A cloner creates "Pull: refs/heads/*:refs/remotes/origin/*"
(or config equivalent) upon cloning. When it clones, it
downloads the config from the remote in order to see which
are marked as "rewinds". It makes tracking branches for only
the ones that are not marked as "rewinds" by default. We
might have an option to do '+' variant glob, and clone all
branches.
* Subsequent fetch, when the glob is not '+' variant, would
download the config from the remote in order to see which are
marked as "rewinds", and ignores the branches that are marked
as such.
I am a bit unhappy that subsequent fetches have to re-read the
remote config every time. I can sort-of-see we can cram the
"this is expected to be rewound" information as part of
peek-remote exchange to avoid the overhead, but I do not think
it is easily doable for dumb transports without breaking the
backward compatibility.
To avoid this, we need to remember what remote branches we have
seen but decided not to track, perhaps because they were marked
as "rewinds". Subsequent fetches first learn what are on the
remote side, and only when it sees a branch that we do not track
and we have not seen, it needs to re-read the remote config to
see if that is to be tracked (in which case we would create a
new tracking branch) or ignored (in which case we would remember
that we will ignore this branch in the future fetches).
next prev parent reply other threads:[~2006-11-26 9:13 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
2006-11-26 9:13 ` Junio C Hamano [this message]
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=7v1wnqwoxz.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/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).