git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Lars Schneider <larsxschneider@gmail.com>
To: paul.mattke@s4m.com
Cc: git@vger.kernel.org
Subject: Re: Transform log message during migration svn -> git (using git-svn)
Date: Tue, 20 Jun 2017 11:32:08 +0200	[thread overview]
Message-ID: <EAA4B747-FA00-4A3B-88CD-AF8EBE1F8586@gmail.com> (raw)
In-Reply-To: <8ce2bf074fcf4d6181a29eb3e7fff132@GTLBML3EX0005.bagmail.net>


> On 20 Jun 2017, at 09:32, paul.mattke@s4m.com wrote:
> 
> Hi there,
> 
> this is actually not really a bug report, but much more a feature request
> (if I did not oversee an already existing feature like this):
> 
> We want to migrate our SVN repository to GIT and will be using git-svn for
> that of course. Currently in SVN, all our commit log messages start either
> with:
> 
> 123456 (a number, representing the Bug Id in our old legacy bug tracker)
> 
> or
> 
> T123456 (a number, but prefixed with T, referring a TFS item in this case)
> 
> During conversion to GIT, we want to replace the T in such log messages with
> a #, so commits, referring a TFS item will start with #123456 in the future.
> We don’t care about log messages which do not start with a T, only the
> TXXXXXX messages need to be transformed here.
> 
> I guess an operation like this is currently not possible with git-svn, isn’t
> it? So it would be nice, if a feature could be implemented that gives the
> user the possibility to specify some kind of script file for example, which
> transforms the log message in any way we want it.

You can migrate your repo from SVN to Git as is. Afterwards you can
fix up the commit messages with the following command:

git filter-branch -f --msg-filter 'perl -lape "s/^T(\d+)/#\$1/"'

(this might take a while on a large repo)

- Lars

  reply	other threads:[~2017-06-20  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20  7:32 Transform log message during migration svn -> git (using git-svn) paul.mattke
2017-06-20  9:32 ` Lars Schneider [this message]
2017-06-20 12:32   ` AW: " paul.mattke
2017-06-20 12:46     ` Lars Schneider
2017-06-20 14:51       ` Jeff King
2017-06-20 18:50     ` Andreas Heiduk

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EAA4B747-FA00-4A3B-88CD-AF8EBE1F8586@gmail.com \
    --to=larsxschneider@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paul.mattke@s4m.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.
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).