git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sergei Organov <osv@javad.com>, git@vger.kernel.org
Subject: Re: Plumbing to rename a ref?
Date: Fri, 23 May 2014 18:14:07 +0100	[thread overview]
Message-ID: <20140523171407.GB2249@serenity.lan> (raw)
In-Reply-To: <xmqqvbswjuaa.fsf@gitster.dls.corp.google.com>

On Fri, May 23, 2014 at 10:10:05AM -0700, Junio C Hamano wrote:
> John Keeping <john@keeping.me.uk> writes:
> 
> > On Fri, May 23, 2014 at 02:11:55PM +0400, Sergei Organov wrote:
> >> Hello,
> >> 
> >> After convertion of a project from CVS to git, I'd like to rename some
> >> references in the created git repository (before it's published, so no
> >> problems here). Is there a plumbing that would do:
> >> 
> >> git rename-ref <old_name> <new_name>
> >> 
> >> for me?
> >
> > I think the best you can get is two invocations of `git update-ref`:
> >
> > 	git update-ref <new_name> <old_name> &&
> > 	git update-ref -d <old_name>
> >
> > Although if you're scripting it the `--stdin` mode may be easier:
> >
> > 	git update-ref --stdin <<-\EOF
> > 	create <new_name> <old_name>
> > 	delete <old_name>
> > 	EOF
> >
> > Note that "<new_name>" must be a fully-qualified ref (that is, it must
> > start with "refs/", so "refs/heads/new_name" for a branch or
> > "refs/tags/new_name" for a tag).
> 
> Shouldn't <old_name> also be a full ref?

I tested this before sending the email, and it seemed to do the right
thing specifying only the branch name; so it probably /should/ be a full
ref, but it seems like it doesn't /need/ to be.

      reply	other threads:[~2014-05-23 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 10:11 Plumbing to rename a ref? Sergei Organov
2014-05-23 10:50 ` John Keeping
2014-05-23 11:35   ` Sergei Organov
2014-05-23 12:35     ` Jeff King
2014-05-23 17:11       ` Junio C Hamano
2014-05-23 19:41         ` Jeff King
2014-05-23 17:10   ` Junio C Hamano
2014-05-23 17:14     ` John Keeping [this message]

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=20140523171407.GB2249@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=osv@javad.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).