Re: [PATCH] Include a git-push example for creating a remote branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Include a git-push example for creating a remote branch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:33

"Miles Bader" [off-list ref] writes:
Maybe I"m weird, but I tend to think of the refs/... syntax as being
for "only if you're doing something funny" cases.
The "refs/" syntax is there as the lowest level that is
universally usable to create and any ref.  It can be used to
push to branches, tags, or even remotes (aka "simulated fetch in
reverse").

It is just nobody felt strong enough reason to sugarcoat the
normalized syntax with something like:

	git push --create remote foo v1.2.0

You can be a hero by updating git-push to take such, and make it
interpret as if the user passed the normalized syntax which is:

	git push remote foo:refs/heads/foo v1.2.0:refs/tags/v1.2.0

Re: [PATCH] Include a git-push example for creating a remote branch

From: Carl Worth <hidden>
Date: 2016-06-15 22:43:33

On Wed, 05 Sep 2007 23:30:31 -0700, Junio C Hamano wrote:
It is just nobody felt strong enough reason to sugarcoat the
normalized syntax with something like:

	git push --create remote foo v1.2.0
Couldn't we just use an initial + to indicate this as well?

I would imagine an exchange like this:

    $ git push remote foo
    git: No branch 'foo' exists in the remote server, to create it use:

	git push remote +foo

But regardless of the syntax, it would be nice if the error message
were explicit about how to achieve the goal the user wants. It's just
that forcing the user to say "foo:refs/heads/foo" seems a way to force
the user to get plumbing grime on their clean hands.

-Carl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help