BFG之后的git说明?

Kir*_*ill 7 git git-notes bfg-repo-cleaner

我从SVN迁移到git,我在每个git提交中都有一个注释,引用了SVN版本号.在repo import之后我使用BFG repo清理器从二进制文件和其他垃圾中清除git历史记录.不幸的是现在我输入时没有注意到git log.我想BFG忘记更新笔记提交的引用.BFG以下列格式留下*.txt报告,将旧对象id映射到新对象id:

0001b24011381e8885683cd1119ba4cb077fa64b c81149b1b52b9e1e1767d6141f292891d715edb5
00024eecdc31f2f6e67018f7d6f00e7c1ad03f1f 326ee3b508e3dd2934ec1f50069195f86ea1a1c7
00028e04dcc2d59bd835b447bd3a207ae481696c 3d18e9b9d3336e59d62093200b81603ffefcc747
Run Code Online (Sandbox Code Playgroud)

在给出上述映射的情况下,您能否建议一些脚本快速修复注释?

PS:我几乎可以肯定问题是由于没有更新refs引起的,因为当我输入git notes第二名时,我可以看到在BFG报告中被认为是旧的引用object-id-map.old-new.txt

Kir*_*ill 4

我编写了以下 bash 脚本来从旧对象中传输我的笔记。该解决方案在单线程中速度很慢,不确定并行运行多个命令是否安全git notes

while read string; do
    hashesArray=($string)
    git notes copy ${hashesArray[0]} ${hashesArray[1]}
    git notes remove --ignore-missing ${hashesArray[0]}
done <object-id-map.old-new.txt
Run Code Online (Sandbox Code Playgroud)