所有svn修订版本号的映射< => git SHA-1提交哈希 [英] Map of all svn revision numbers <=> git SHA-1 commit hashes

查看:169
本文介绍了所有svn修订版本号的映射< => git SHA-1提交哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git-svn 需要重建其内部映射时,它会将所需信息输出到 STDERR : p>

 重建.git / svn / refs / remotes / origin / trunk / .rev_map.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 
r38601 = 28d3a624c5c96db9a1f45d8f261a9b0de1f6f288
r38652 = 74c55b8dff798e5ae1bc2ad00d8ec6eee4f2646b
r38744 = eb457e1949ecf854816ba9cf64b4bace710a7302
r38745 = 5bca99a37fbc6db72d2d50a75301185f4297926c
(...)
$ b

文件 .git / svn / refs / remotes / origin / trunk / .rev_map.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 是二进制的,因此不能很容易地解析。有没有办法让 git-svn 通过特定命令输出上述信息?我在 git 2.7.0 ,顺便说一句。



编辑:我知道 git svn find-rev ,但这只允许我找出单个修订的SHA-1提交哈希。我必须提供特定的SVN修订版。然而,我想得到的是所有修订的映射。最好不要使用暴力破解或使用外部数据源(即SVN回购)来提供SVN修订版作为输入。最好的是,没有提供任何东西,因为这些信息在git-svn构建它的修订版映射后存储在版本库中 - 或者不是吗?

div>

获取所有SVN修订:

  git config --add svn-remote。< Remote> .url< ; SVN URL> 
git config --add svn-remote。< Remote> .fetch:refs / remotes /< Remote Name>
git svn fetch< Remote>

映射版本号< => git SHA-1:

  git checkout remotes /< Remote Name> 
git svn log --show-commit --oneline

输出:

  r50 | 77c9acf | SVN提交消息
...
r1 | 84e6c49 | SVN提交消息


When git-svn needs to rebuild its internal map, it outputs the wanted information to STDERR:

Rebuilding .git/svn/refs/remotes/origin/trunk/.rev_map.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
r38601 = 28d3a624c5c96db9a1f45d8f261a9b0de1f6f288
r38652 = 74c55b8dff798e5ae1bc2ad00d8ec6eee4f2646b
r38744 = eb457e1949ecf854816ba9cf64b4bace710a7302
r38745 = 5bca99a37fbc6db72d2d50a75301185f4297926c
(...)

The file .git/svn/refs/remotes/origin/trunk/.rev_map.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX is unfortunately binary, thus can't be parsed easily. Is there a way to have git-svn output the above information by a specific command? I'm on git 2.7.0, by the way.

Edit: I'm aware of git svn find-rev, but this will only allow me to find out the SHA-1 commit hash of a single revision and I have to provide a specific SVN revision. What I would like to get, though, is the mapping of all revisions. Preferably without brute-forcing my way through or using an external datasource (the SVN repo, namely) to provide SVN revisions as input. Most preferably, without providing anything, as this information is stored in the repository after git-svn has built its revision map - or is it not?

解决方案

Fetch all SVN revisions:

git config --add svn-remote.<Remote>.url <SVN URL>
git config --add svn-remote.<Remote>.fetch :refs/remotes/<Remote Name>
git svn fetch <Remote>

Map revision numbers <=> git SHA-1:

git checkout remotes/<Remote Name>
git svn log --show-commit --oneline

Output:

r50 | 77c9acf | "SVN Commit message"
...
r1 | 84e6c49 | "SVN Commit message"

这篇关于所有svn修订版本号的映射&lt; =&gt; git SHA-1提交哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆