git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: <esr@thyrsus.com>
Cc: <git@vger.kernel.org>
Subject: Re: Three issues from a Subversion-to-git migration
Date: Mon, 29 Mar 2010 11:32:53 +0200	[thread overview]
Message-ID: <201003291132.53415.trast@student.ethz.ch> (raw)
In-Reply-To: <20100329091056.GC10538@thyrsus.com>

Eric Raymond wrote:
> > I've used the following hack to make real tags out of SVN "tags":
> > 
> > git for-each-ref --format="%(refname)" refs/remotes/tags/ |
> > while read tag; do
> >     GIT_COMMITTER_DATE="$(git log -1 --pretty=format:"%ad" "$tag")" \
> >     GIT_COMMITTER_EMAIL="$(git log -1 --pretty=format:"%ce" "$tag")" \
> >     GIT_COMMITTER_NAME="$(git log -1 --pretty=format:"%cn" "$tag")" \
> >     git tag -m "$(git log -1 --pretty=format:"%s%n%b" "$tag")" \
> >     "${tag#refs/remotes/tags/}" "$tag"
> > done
> > 
> > Disclaimer: it worked last time I used it.  Haven't checked if it got
> > dusty since.
> 
> Wow, that's ugly. But it does look like it ought to work.

BTW, you'll also want to use some treatment that removes the empty
commit that is generated from the 'svn copy' SVN commit for tagging.
One option is to use 'git filter-branch --prune-empty ...', which will
also drop other no-op commits.  If you want to remove only the ones
that come from tagging, creative use of git-diff-tree in the above
loop will work.

I suppose I was never bothered by the lack of automatic tagging
because I rarely found a git-svn import to be immediately fit for
publishing.  Usually it took some grafting and other filtering to
bring the history into shape anyway.  Maybe now that the svn:mergeinfo
support obviates the need for grafting, it's worth thinking about the
rest.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2010-03-29  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 12:09 Three issues from a Subversion-to-git migration Eric Raymond
2010-03-29  9:00 ` Thomas Rast
2010-03-29  9:10   ` Eric Raymond
2010-03-29  9:32     ` Thomas Rast [this message]
2010-03-29 10:26       ` Eric Raymond
2010-03-29 15:57     ` Gabriel Filion
2010-03-29 18:01       ` Eric Raymond

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=201003291132.53415.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=esr@thyrsus.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).