git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git push <branch-name>
@ 2010-10-05 20:29 Eric Raible
  2010-10-05 22:35 ` Sverre Rabbelier
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Raible @ 2010-10-05 20:29 UTC (permalink / raw)
  To: Git Mailing List

A newbie colleague asked why: "git push <branch>" didn't work.

Although I know that "git push <repo> <branch>" is the correct
syntax, I think that he has a point.  If branch.<branch>.remote
is defined it seems unambiguous to me.

So I can't see any reason NOT to dwimify

    git push <branch>

into

    git push $(git config branch.<branch>.remote) <branch>

What am I missing?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
@ 2010-10-05 22:11 Daniel Johnson
  2010-10-05 22:28 ` Eric Raible
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Johnson @ 2010-10-05 22:11 UTC (permalink / raw)
  To: Eric Raible; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

On Tuesday 05 October 2010 16:29:50 you wrote:
> A newbie colleague asked why: "git push <branch>" didn't work.
> 
> Although I know that "git push <repo> <branch>" is the correct
> syntax, I think that he has a point.  If branch.<branch>.remote
> is defined it seems unambiguous to me.
> 
> So I can't see any reason NOT to dwimify
> 
>     git push <branch>
Isn't that syntax reserved for remotes?
for example:

git push origin

I feel like it would be a bad idea to have these 2 types of invocations 
overlap in syntax like that.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-05 22:11 Daniel Johnson
@ 2010-10-05 22:28 ` Eric Raible
  2010-10-06 13:41   ` Sebastian Harl
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Raible @ 2010-10-05 22:28 UTC (permalink / raw)
  To: Daniel Johnson; +Cc: git

On Tue, Oct 5, 2010 at 3:11 PM, Daniel Johnson <computerdruid@gmail.com> wrote:
> Isn't that syntax reserved for remotes?
> for example:
>
> git push origin
>
> I feel like it would be a bad idea to have these 2 types of invocations
> overlap in syntax like that.

The idea is that given "git push <branch>" if <branch> is NOT a remote but
IS a branch name then git could unambiguously provide the correct remote.

Naturally if there's a branch and a remote of the same name then for backwards
compatibility the remote would be chosen.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-05 20:29 git push <branch-name> Eric Raible
@ 2010-10-05 22:35 ` Sverre Rabbelier
  2010-10-06  0:52   ` Eric Raible
  0 siblings, 1 reply; 9+ messages in thread
From: Sverre Rabbelier @ 2010-10-05 22:35 UTC (permalink / raw)
  To: Eric Raible; +Cc: Git Mailing List

Heya,

On Tue, Oct 5, 2010 at 22:29, Eric Raible <raible@gmail.com> wrote:
>    git push $(git config branch.<branch>.remote) <branch>

Since it is such a simple command expansion, why not create an alias
that does just that?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-05 22:35 ` Sverre Rabbelier
@ 2010-10-06  0:52   ` Eric Raible
  2010-10-07 10:50     ` Michael J Gruber
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Raible @ 2010-10-06  0:52 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Git Mailing List

On Tue, Oct 5, 2010 at 3:35 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Since it is such a simple command expansion, why not create an alias
> that does just that?

Because I don't want an alias, I want to extend git-push.

According to the man page, "git push"

"Works like git push <remote>, where <remote> is the current branch's remote
 (or origin, if no remote is configured for the current branch)."

What I'm advocating is that "git push <branch>" would be described with:

"Works like git push <remote> <branch>, where <remote> is the <branch>'s remote
 (or origin, if no remote is configured for <branch>)."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-05 22:28 ` Eric Raible
@ 2010-10-06 13:41   ` Sebastian Harl
  0 siblings, 0 replies; 9+ messages in thread
From: Sebastian Harl @ 2010-10-06 13:41 UTC (permalink / raw)
  To: Eric Raible; +Cc: Daniel Johnson, git

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

Hi,

On Tue, Oct 05, 2010 at 03:28:56PM -0700, Eric Raible wrote:
> On Tue, Oct 5, 2010 at 3:11 PM, Daniel Johnson <computerdruid@gmail.com> wrote:
> > Isn't that syntax reserved for remotes?
> > for example:
> >
> > git push origin
> >
> > I feel like it would be a bad idea to have these 2 types of invocations
> > overlap in syntax like that.
> 
> The idea is that given "git push <branch>" if <branch> is NOT a remote but
> IS a branch name then git could unambiguously provide the correct remote.
> 
> Naturally if there's a branch and a remote of the same name then for backwards
> compatibility the remote would be chosen.

Please don't do that. Imho, this introduces too much magic in the
behavior of git-pull, making it less intuitive to understand and, thus
error-prone.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-06  0:52   ` Eric Raible
@ 2010-10-07 10:50     ` Michael J Gruber
  2010-10-07 17:41       ` Eric Raible
  0 siblings, 1 reply; 9+ messages in thread
From: Michael J Gruber @ 2010-10-07 10:50 UTC (permalink / raw)
  To: Eric Raible; +Cc: Sverre Rabbelier, Git Mailing List

Eric Raible venit, vidit, dixit 06.10.2010 02:52:
> On Tue, Oct 5, 2010 at 3:35 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
>> Since it is such a simple command expansion, why not create an alias
>> that does just that?
> 
> Because I don't want an alias, I want to extend git-push.
> 
> According to the man page, "git push"
> 
> "Works like git push <remote>, where <remote> is the current branch's remote
>  (or origin, if no remote is configured for the current branch)."
> 
> What I'm advocating is that "git push <branch>" would be described with:
> 
> "Works like git push <remote> <branch>, where <remote> is the <branch>'s remote
>  (or origin, if no remote is configured for <branch>)."

Now, if I have a remote foo and a branch foo, what is

git push foo

supposed to do?

Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-07 10:50     ` Michael J Gruber
@ 2010-10-07 17:41       ` Eric Raible
  2010-10-08  6:17         ` Michael J Gruber
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Raible @ 2010-10-07 17:41 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Sverre Rabbelier, Git Mailing List

On Thu, Oct 7, 2010 at 3:50 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
>
> Now, if I have a remote foo and a branch foo, what is
>
> git push foo
>
> supposed to do?

http://thread.gmane.org/gmane.comp.version-control.git/158235/focus=158254

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git push <branch-name>
  2010-10-07 17:41       ` Eric Raible
@ 2010-10-08  6:17         ` Michael J Gruber
  0 siblings, 0 replies; 9+ messages in thread
From: Michael J Gruber @ 2010-10-08  6:17 UTC (permalink / raw)
  To: Eric Raible; +Cc: Sverre Rabbelier, Git Mailing List

Eric Raible venit, vidit, dixit 07.10.2010 19:41:
> On Thu, Oct 7, 2010 at 3:50 AM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>>
>> Now, if I have a remote foo and a branch foo, what is
>>
>> git push foo
>>
>> supposed to do?
> 
> http://thread.gmane.org/gmane.comp.version-control.git/158235/focus=158254

Yep, I saw it later only - Daniel had broken the thread.

Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-10-08  6:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-05 20:29 git push <branch-name> Eric Raible
2010-10-05 22:35 ` Sverre Rabbelier
2010-10-06  0:52   ` Eric Raible
2010-10-07 10:50     ` Michael J Gruber
2010-10-07 17:41       ` Eric Raible
2010-10-08  6:17         ` Michael J Gruber
  -- strict thread matches above, loose matches on Subject: below --
2010-10-05 22:11 Daniel Johnson
2010-10-05 22:28 ` Eric Raible
2010-10-06 13:41   ` Sebastian Harl

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).