lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Converting a proprietary svn repository to git


From: Greg Chicares
Subject: Re: [lmi] Converting a proprietary svn repository to git
Date: Sat, 27 Feb 2016 02:11:51 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

On 2016-02-26 12:55, Greg Chicares wrote:
> [...] I think I will try this:
>   http://www.tt-solutions.com/downloads/msgfilter-rev2sha
> instead of '--no-metadata' (and compare the result to a '--no-metadata'
> migration).

I repeated the 'git svn clone' command shown earlier, but this time
 - without the '--no-metadata' flag, and
 - with a different clone destination (last argument):

/home/greg/tainted/migration[0]$git svn clone \
  file:///home/greg/tainted/migration/repository \
  --authors-file=authors.txt --trunk=/ ./rev2sha

Then I used 'msgfilter-rev2sha':

  cd rev2sha
  PATH=$PATH:/home/greg/tainted/migration git filter-branch --msg-filter 
msgfilter-rev2sha --tag-name-filter cat -- --date-order --all

[apparently git really does require the script to be on PATH, but
I'm averse to using superuser powers when I can avoid it]

and I got:

  Rewrite 4ba7e0eea0dda84722d5719ee55a09ab9102832a (1/237)Must run from git svn 
repository.
  msg filter failed: msgfilter-rev2sha

But I am running from a git repository:

  /home/greg/tainted/migration/rev2sha[0]$ls -A
  .git  data  src  test

The error message is issued here in 'msgfilter-rev2sha':
  die "Must run from git svn repository.\n" unless -d 
"$git_dir/svn/refs/remotes/svn";
and I seem to have a "git svn repository" that lacks remotes/svn :

  /home/greg/tainted/migration/rev2sha[0]$ls -R .git/svn/refs/remotes/
  .git/svn/refs/remotes/:
  trunk

  .git/svn/refs/remotes/trunk:
  unhandled.log

Yet remotes/svn doesn't seem to be used except on that line, so I
hypothesize that the test is too restrictive for my case, so...
bringing my entire knowledge of perl to bear, I forge boldly ahead:

/home/greg/tainted/migration/rev2sha[0]$sed -i ../msgfilter-rev2sha -e 
's/^die/# die/'
/home/greg/tainted/migration/rev2sha[0]$PATH=$PATH:/home/greg/tainted/migration 
git filter-branch --msg-filter msgfilter-rev2sha --tag-name-filter cat -- 
--date-order --all

Rewrite 248c5530142dde7ad67fcad348fcbd38ba6c9895 (57/237)fatal: ambiguous 
argument 'svn/trunk': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
rev-list --first-parent --pretty=medium svn/trunk: command returned error: 128

Revision 5667 not found in svn history while rewriting 
248c5530142dde7ad67fcad348fcbd38ba6c9895.
Rewrite 774ef855828c73a87e8c37d4d4abb738a526adca (237/237)
Ref 'refs/heads/master' was rewritten
Ref 'refs/remotes/trunk' was rewritten

I find "5667" in src/ChangeLog for 20130313T1058Z:

    ../data/*.database
    my_db.cpp
  Align data files with lmi revision 5667.

Okay: the script correctly flags that "revision 5667".

Let's compare the '--no-metadata' and '--msg-filter msgfilter-rev2sha' results:

/home/greg/tainted/migration[0]$diff --brief --recursive --new-file rev2sha 
proprietary
Files rev2sha/.git/config and proprietary/.git/config differ
Files rev2sha/.git/index and proprietary/.git/index differ
Files rev2sha/.git/logs/HEAD and proprietary/.git/logs/HEAD differ
Files rev2sha/.git/logs/refs/heads/master and 
proprietary/.git/logs/refs/heads/master differ
Files rev2sha/.git/logs/refs/remotes/trunk and 
proprietary/.git/logs/refs/remotes/trunk differ
Files rev2sha/.git/objects/01/8a9ead457589ed2e284a5aa6aca180b274f422 and 
proprietary/.git/objects/01/8a9ead457589ed2e284a5aa6aca180b274f422 differ
Files rev2sha/.git/objects/01/93240d92d8e65e9205e5d6d2c2c8ccbb68a1a3 and 
proprietary/.git/objects/01/93240d92d8e65e9205e5d6d2c2c8ccbb68a1a3 differ
...
Files rev2sha/.git/objects/ff/909c61639db0bcc4dfa02da5bf63f25c3b437c and 
proprietary/.git/objects/ff/909c61639db0bcc4dfa02da5bf63f25c3b437c differ
Files rev2sha/.git/refs/heads/master and proprietary/.git/refs/heads/master 
differ
Files rev2sha/.git/refs/original/refs/heads/master and 
proprietary/.git/refs/original/refs/heads/master differ
Files rev2sha/.git/refs/original/refs/remotes/trunk and 
proprietary/.git/refs/original/refs/remotes/trunk differ
Files rev2sha/.git/refs/remotes/trunk and proprietary/.git/refs/remotes/trunk 
differ
Files 
rev2sha/.git/svn/refs/remotes/trunk/.rev_map.3066f65e-3646-11e1-8aa5-53f2dec60839
 and 
proprietary/.git/svn/refs/remotes/trunk/.rev_map.3066f65e-3646-11e1-8aa5-53f2dec60839
 differ

All the differences are in .git/ , and they seem to be just binary;
the contents of {data/ src/ test/} are identical. I think I can conclude
that for this migration 'msgfilter-rev2sha' isn't beneficial.

What really bothers me is the git documentation:

https://git-scm.com/docs/git-svn
| This option [--no-metadata] is NOT recommended ...
| consider git-filter-branch[1] instead.

https://git-scm.com/docs/git-filter-branch
| Please do not use this command if you do not know the full implications,
| and avoid using it anyway

One way is NOT recommended, and the other is to be avoided.
I'll just use '--no-metadata'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]