From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Cc: Nick Hengeveld <nickh@reactrix.com>
Subject: [RFD] what should "git push remote.host:path" do?
Date: Thu, 12 Jan 2006 01:13:30 -0800 [thread overview]
Message-ID: <7vslrtq05h.fsf@assigned-by-dhcp.cox.net> (raw)
The underlying "git send-pack remote.host:path" pushes all the
matching refs that both local and remote has, and "git push"
blindly inherits this property.
This is bad. A typical cloned repository (e.g. a subsystem
maintainer repository cloned from Linus repository) has at least
two branches, "master" to keep the subsystem and "origin" that
records tip of Linus "master" when the repository was cloned.
If this is the public repository, then subsystem developers
would clone from this one, and then cloned ones have "master"
and "origin". When developers use this public subsystem
repository as a shared repository, "git push subsys:path" would
try to push the matching refs, "master" and "origin".
One workaround is to delete "origin" branch from the public
repository, because having "origin" there is meaningless.
Nobody is supposed to pull directly into it from Linus after
cloning; rather, changes in upstream would trickle in by a
developer who cloned from this subsystem repository and then
pulled from Linus into his repository and then pushed his merge
result into this public repository.
Nevertheless, exposing the default behaviour of "git send-pack"
to "git push" was probably a mistake. I'd propose to require at
least one refspec to be specified, either on the command line or
via $GIT_DIR/remotes mechanism. So my answer to the "Subject: "
line question is "Barf".
Unlike pull that can happen pretty much promiscuously, people
will push into the same set of a limited number of remote
repositories repeatedly over the life of the project, so it is
reasonable to assume they would want to keep a $GIT_DIR/remotes/
entry for those repositories to save typing. Then always
requiring one or more refspecs for push is not too much to ask
for.
Opinions?
BTW, Nick, what does http-push do with "git push http://foo"
without refspecs?
next reply other threads:[~2006-01-12 9:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-12 9:13 Junio C Hamano [this message]
[not found] ` <56282.10.10.10.28.1137061121.squirrel@linux1>
2006-01-12 10:18 ` [RFD] what should "git push remote.host:path" do? Sean
2006-01-12 19:00 ` Junio C Hamano
2006-01-12 16:31 ` Nick Hengeveld
2006-01-12 18:10 ` Linus Torvalds
2006-01-12 18:53 ` Junio C Hamano
2006-01-13 1:54 ` [PATCH] git-push: avoid falling back on pushing "matching" refs 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=7vslrtq05h.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=nickh@reactrix.com \
/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).