From: Junio C Hamano <junkio@cox.net>
To: Carl Baldwin <cnb@fc.hp.com>
Cc: git@vger.kernel.org
Subject: Re: Making note, in the repository, of push/pull relationships
Date: Mon, 15 Aug 2005 17:18:43 -0700 [thread overview]
Message-ID: <7vzmrispi4.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 20050815162519.GB9719@hpsvcnb.fc.hp.com
Carl Baldwin <cnb@fc.hp.com> writes:
> Somewhere in the thread something was mentioned about maintaining
> <local branch>:<remote branch> pairs in the git repository when pushes
> and pulls are performed. I think the argument was actually against
> keeping this information and ultimately against allowing pushes to a
> branch of a different name.
If you are referring to what I said about the user having some
control over both ends hence it should be possible to arrange to
use the same name on both ends to reduce mental burden, Pasky
and others convinced me otherwise during later discussions, and
the current core knows how to do renaming pushes.
One proposal which has not been pursued yet, due to lack of time
on my end if anything else, is to have a set of files that is an
extension of current $GIT_DIR/branches/* file (which can record
the URL and optionally one filename under refs/heads/ over there
to mean "which branch to pull from by default"). Instead, the
proposal introduces $GIT_DIR/remotes/* files, whose contents
would look like this:
$ cat .git/remotes/ko
URL: master.kernel.org:/pub/scm/git/git.git/
Push: master pu rc
Pull: master:ko-master pu:ko-pu rc:ko-rc
The expected workflow with the above example "remotes" file is
for me to be able to do this:
(1) fetch from master.kernel.org (that is the source of the
mirroring for everybody to see on {www,rsync}.kernel.org)
before starting my day. The current "git fetch" does not
do this, but make it:
$ git fetch ko
to mean "fetch from those three branches on the 'Pull:'
line, fast-forward local ko-master, ko-pu and ko-rc with
these heads".
Then I can see where my private heads and publicly visibile
ones stand to make sure things are in good order. E.g. I
can do "git show-branches ko ko-master rc rc-master".
(2) after doing work in my private repository, push to
master.kernel.org with:
$ git push ko
This does not happen to involve renaming push, because both
ends are owned and controlled by me, but you could put
renaming refspec on "Push:" line in the .git/remotes line
to make it rename.
Note that I am _not_ expecting for "git push/pull/fetch"
commands to dynamically update .git/remotes/ file whenever it
gets a new set of heads and renaming refspecs on the command
line. Explicit refspecs on the command line will just override
what is recorded in .git/remotes/* files instead. So:
$ git push ko pu:refs/heads/testing
would not push usual "master pu rc" but create a new "testing"
branch there, starting at the commit which is the head commit of
the local "pu" branch. This is a one-shot override, so next
time around, "git push ko" will do the usual three heads that is
recorded in the .git/remotes/ko file.
next prev parent reply other threads:[~2005-08-16 0:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-15 16:25 Making note, in the repository, of push/pull relationships Carl Baldwin
2005-08-15 22:49 ` Johannes Schindelin
2005-08-16 16:03 ` Carl Baldwin
2005-08-16 20:45 ` Johannes Schindelin
2005-08-16 0:18 ` Junio C Hamano [this message]
2005-08-16 17:11 ` Carl Baldwin
2005-08-16 21:09 ` Junio C Hamano
2005-08-16 23:01 ` Carl Baldwin
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=7vzmrispi4.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=cnb@fc.hp.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).