git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Transform log message during migration svn -> git (using git-svn)

From
Lars Schneider <larsxschneider@gmail.com>
Date
Jun 20, 2017, 12:46 UTC
Message-ID
<BDA6D349-0DF9-49F3-B2B6-0B1AE3BBD052@gmail.com>
In-Reply-To
<90ee80a910884e1e98fa8a5001ae850c@GTLBML3EX0005.bagmail.net>
Show 8 quoted lines
> On 20 Jun 2017, at 14:32, <paul.mattke@s4m.com> <paul.mattke@s4m.com> wrote:
> 
> Well this is a possibility, of course. Our problem is that our SVN
> repository contains about 220.000 revisions currently. As a colleague of
> mine said that the command you suggest might take about 4 seconds per
> revision, it would take about 10 days to do this for our whole repository.
> So of course it could save a lot of time generally if such operation could
> be done immediately during git-svn.

You colleague is most likely correct. I suggested it as this is a one time operation and therefore still somewhat practical from my point of view.

If you don't like the solution then you need to change the git-svn code. Probably here somewhere (I am not familiar with this code): https://github.com/git/git/blob/master/git-svn.perl#L1836

- Lars
PS: Please don't top post on this mailing list :-)
https://en.wikipedia.org/wiki/Posting_style#Top-posting
Show 62 quoted lines
> 
> Paul Mattke
> Software Developer
> -------------------------------------------------
> Arvato Systems S4M GmbH
> Am Coloneum 3
> 50829 Köln
>  
> Phone: +49 221 28555-443
> Fax: +49 221 28555-210
> E-Mail: paul.mattke@s4m.com
> www.s4m.arvato-systems.com
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Lars Schneider [mailto:larsxschneider@gmail.com] 
> Gesendet: Dienstag, 20. Juni 2017 11:32
> An: Mattke, Paul, NMM-BPDD <paul.mattke@s4m.com>
> Cc: git@vger.kernel.org
> Betreff: Re: Transform log message during migration svn -> git (using
> git-svn)
> 
> 
>> 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
Previous: paul.mattke@s4m.comNext: Jeff King
Message 4 of 6 in “Transform log message during migration svn -> git (using git-svn)”
  1. paul.mattke@s4m.comJun 20, 2017
  2. Lars SchneiderJun 20, 2017
  3. AW: Transform log message during migration svn -> git (using git-svn)paul.mattke@s4m.com, Jun 20, 2017
  4. Lars SchneiderJun 20, 2017
  5. Jeff KingJun 20, 2017
  6. Andreas HeidukJun 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.