git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lars Hjemli" <hjemli@gmail.com>
To: "Fredrik Kuivinen" <frekui@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] Teach git-branch howto rename a branch
Date: Sat, 25 Nov 2006 12:00:08 +0100	[thread overview]
Message-ID: <8c5c35580611250300q521c5723t2d356d73d4c4fdb6@mail.gmail.com> (raw)
In-Reply-To: <4c8ef70611250239h4e03b9c7k971b60187aa0f56d@mail.gmail.com>

On 11/25/06, Fredrik Kuivinen <frekui@gmail.com> wrote:
> On 11/25/06, Lars Hjemli <hjemli@gmail.com> wrote:
> > This adds a '--rename' option to git branch. If specified, branch
> > creation becomes branch renaming.
> >
> > With a single branchname, the current branch is renamed and .git/HEAD is
> > updated.
> >
> > With two branchnames, the second name is renamed to the first.
>
> Nice idea. But wouldn't it be more sensible to rename the first branch to the
> second instead of the other way around? That is, the syntax would be
>
>     git branch --rename FROM TO
>
> which is more similar to how "mv" works.
>

Possibly, but then we would have

  git branch newbranch [oldbranch]

when creating a new branch, and

  git branch --rename [oldbranch] newbranch

for rename/move.

I'd prefer to be "internally consistent", but it does look and feel a
little strange...

Another option would be:

  git branch [--rename] [--from <branch>] newbranch

and deprecate the usage of two unnamed argumens for create/rename

-- 

  reply	other threads:[~2006-11-25 11:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 23:03 [RFC] Teach git-branch howto rename a branch Lars Hjemli
2006-11-25  5:40 ` Junio C Hamano
2006-11-25  6:49   ` Shawn Pearce
2006-11-25  8:53     ` Jakub Narebski
2006-11-25  8:57       ` Shawn Pearce
2006-11-25  9:16         ` Lars Hjemli
2006-11-25 10:35           ` Junio C Hamano
2006-11-25 10:52             ` Lars Hjemli
2006-11-25  7:12   ` [PATCH] git-branch -D: make it work even when on a yet-to-be-born branch Junio C Hamano
2006-11-25  8:52   ` [RFC] Teach git-branch howto rename a branch Lars Hjemli
2006-11-25 10:39 ` Fredrik Kuivinen
2006-11-25 11:00   ` Lars Hjemli [this message]
2006-11-26 23:56 ` Josef Weidendorfer

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=8c5c35580611250300q521c5723t2d356d73d4c4fdb6@mail.gmail.com \
    --to=hjemli@gmail.com \
    --cc=frekui@gmail.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).