From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [RFD] making separate-remote layout easier to use
Date: Sat, 25 Nov 2006 23:25:35 +0100 [thread overview]
Message-ID: <ekafpm$fs7$1@sea.gmane.org> (raw)
In-Reply-To: 7v1wnr19do.fsf@assigned-by-dhcp.cox.net
Junio C Hamano wrote:
> Now separate-remote layout is the default for newly cloned
> repositories, I think it is a good time to make further effort
> to make things easier to use. Here are some of the ideas off
> the top of my head.
[...]
> * Change the default contents of $GIT_DIR/remotes/origin
The question is: do we continue to use remotes/ file, or do we
save remotes info in the config file: remote.<name>.url,
remote.<name>.fetch, remote.<name>.push and branch.<name>.merge
(in our case '[remote "origin"]' section)?
> Currently we list all the remote branches that exist when the
> clone is made, making sure that the branch pointed at by HEAD at
> the remote is listed first. The intent is to track every branch
> at the remote but merge in the "primary" branch to us.
>
> Two issues that have been raised about this is:
>
> - the intent to track every branch is good, but the current
> implementation means we would not notice new branches at the
> remote.
>
> - merging the "primary" branch is good only when the user is on
> the corresponding "primary" branch. It is usually a wrong
> thing to do when on another branch.
>
> The first issue can be solved, with the help of recent "glob
> pattern refspec in fetch" from Andy. I am thinking about making
> the default contents of $GIT_DIR/remotes/origin to be:
>
> URL: <url of the cloned repository>
> Pull: +refs/heads/<primary>:refs/remotes/<origin>/<primary>
> Pull: +refs/heads/*:refs/remotes/<origin>/*
>
> to address this issue.
I hope that it also works with the remote.origin config file
section instead of $GIT_DIR/remotes/origin
> Side note: <primary> is what HEAD pointed at at the
> remote when the clone was made, and <origin> is usually
> 'origin' but "git clone -o $origin" can override it.
>
> Forcing with '+' is debatable, but with separate-remote layout,
> remotes/*/ hierarchy is to track what the remote has, and you
> cannot do much else other than noticing and warning when the
> remote end does funny things to its refs anyway, so I think
> having '+' might be a better default.
Perhaps, perhaps not. It would be nice to have configuration option
that would tell that history of given branch is being changed, and
the ability to ask about it remotely, so git-clone would be able
to add this + _when needed_ automatically.
But it's a fact that with separate remote the need to use fast-forward
check is lessened, and it might be more important to not confuse first
time user with having to modify $GIT_DIR/remotes/origin or remote.origin
config section to fetch from the repository he/she cloned from.
> The right thing to do to address the second issue is less clear.
> If the "upstream" has two more-or-less equally prominent
> branches, say 'main' and 'test', it may make sense to use
> corresponding two branches on the local side and merge 'main'
> from the remote when on local 'main' and merge 'test' when on
> local 'test'. Even when dealing with a specific topic branch,
> that would hold true for most of the time. A topic branch
> refs/heads/bug#2073 to work on the bug 2073 can be published at
> the central distribution point. The proposed updates to
> $GIT_DIR/remotes/origin file would track it with
> refs/remotes/origin/bug#2073 and interested people can create a
> local branch refs/heads/bug#2073 from it and work on it, which
> makes it easy to polish a topic branch in a collaborative way.
>
> I am not sure if 'merge in corresponding branch' is the only
> valid workflow, however. I am reluctant to make the system
> automatically do so if the solution makes other workflows more
> painful to follow. Automatically merging remotes/origin/$foo
> when on $foo branch is not good enough, in other words (also,
> there may be a hierarchy under remotes/ other than origin). It
> might make sense to introduce "Merge: " in remotes/ file and if
> they are present use "Pull: " only to decide what are fetched
> and use "Merge: " to decide what is merged (if we were doing the
> system from scratch, the former would have been named "Fetch: "
> but it is too late now).
If you add "Merge: " in remotes/, then please add it also in
remote section in config file. Config file has now
branch.<branchname>.merge (and it would be nice if clone would
set ou this for local branches corresponding to remote branches),
but it is not the same.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-11-25 22:24 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 [this message]
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
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='ekafpm$fs7$1@sea.gmane.org' \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.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).