All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Lortie <desrt@desrt.ca>
To: Junio C Hamano <gitster@pobox.com>
Cc: Thomas Rast <trast@student.ethz.ch>, git@vger.kernel.org
Subject: Re: 'git branch' when origin branch with same name exists
Date: Tue, 19 Jun 2012 16:44:03 -0400	[thread overview]
Message-ID: <4FE0E493.1010308@desrt.ca> (raw)
In-Reply-To: <7v8vfj17de.fsf@alter.siamese.dyndns.org>

hi,

On 12-06-19 02:31 PM, Junio C Hamano wrote:
> But I do not think "git branch" can sensibly and
> correctly make that decision for the user---at least I do not sense
> any of the people who is in this thread has clear idea on what to
> base that decision on, and "the same name appears in an existing
> remote" is not it.  "The same name appears, and the new branch is
> not set to integrate with it" may be closer, but that may forbid
> valid use cases too much.

My originally intended point was that it should be prevented in the case 
where 'git branch' is given no additional arguments (ie: implicitly 
creating the branch from HEAD).  Obviously it should be possible to 
create a 'gtk-3-4' branch that is based on the origin one.  In any case, 
I should have made that more clear.

So to restate the feature request more clearly: "git branch X" with no 
explicitly specified start-point should prevent the branch "X" from 
being created when a branch with the same name already exists on a 
remote (perhaps only considering 'origin').

When stated in this more explicit way, it becomes clear that a --force 
option would not even be required; you could just say:

   git branch gtk-3-4 HEAD

to make it clear that this was your intention.

Nobody making a casual mistake would type that in full.


Cheers

  reply	other threads:[~2012-06-19 20:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 14:51 'git branch' when origin branch with same name exists Ryan Lortie
2012-06-19 15:18 ` jaseem abid
2012-06-19 15:35 ` Michael Schubert
2012-06-19 15:54   ` Ryan Lortie
2012-06-19 16:17     ` Philippe Vaucher
2012-06-19 15:57   ` Angus Hammond
2012-06-19 16:06 ` Konstantin Khomoutov
2012-06-19 17:06   ` Ryan Lortie
2012-06-20  8:31     ` Andreas Ericsson
2012-06-19 17:21 ` Thomas Rast
2012-06-19 18:31   ` Junio C Hamano
2012-06-19 20:44     ` Ryan Lortie [this message]
2012-06-19 21:32       ` Junio C Hamano
2012-06-19 21:50         ` Ryan Lortie
2012-06-19 23:21       ` Phil Hord
2012-06-20 17:32         ` Junio C Hamano
2012-06-20 17:51           ` Matthieu Moy
2012-06-20 18:07             ` Junio C Hamano
2012-06-19 18:22 ` 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=4FE0E493.1010308@desrt.ca \
    --to=desrt@desrt.ca \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@student.ethz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.