git p4:迁移完整历史记录 - 包括集成历史记录
git p4: migrate full history - including integration history
几年前,我的一个 Perforce depot(例如 //FirstDepot/LargeSubfolder/...
)中的一个子文件夹变得太大而无法维护,所以我 'migrated' 将它放入自己的 depot(例如 //NewDepotFromLargeSubfolder/...
). Perforce 不支持从一个 depot 到另一个 depot 的集成,所以我基本上检查了文件,将它们添加到新的 depot 并从子文件夹中删除了它们。
现在我要将整个 Perforce 服务器迁移到多个 git 存储库。 git p4
程序运行良好,我已经成功地将其他不相关的 Perforce depot 迁移到 git(包括使用 @all
的完整文件历史记录 - 但是,这些 depot 从来没有 'migrated' 在 Perforce 中以描述的方式......)。
问题是我不想丢失//FirstDepot/LargeSubfolder/...
下的文件历史记录。那里有几千个更改列表(加上 //NewDepotFromLargeSubfolder/...
的几千个),其中许多包含非常有价值的信息。
我尝试从第一个位置迁移文件历史记录,然后 'stack' 在其之上迁移第二个位置的历史记录:
host:~ user$ mkdir SomeTempFolder
host:~ user$ cd SomeTempFolder
host:SomeTempFolder user$ export P4PORT=perforce:1666
host:SomeTempFolder user$ git p4 clone //FirstDepot/LargeSubfolder@all gitRepoFolder
Importing from //FirstDepot/LargeSubfolder@all into gitRepoFolder
Initialized empty Git repository in /Users/user/SomeTempFolder/gitRepoFolder/.git/
Import destination: refs/remotes/p4/master
Importing revision 26776 (99%)
Ignoring apple filetype file //FirstDepot/LargeSubfolder/SomePath/SomeIconFile.icns
Importing revision 26778 (100%)
因此,除了有关 Mac OS X 图标文件被忽略的消息外,第一位有效。但是第二部分失败了:
host:SomeTempFolder user$ git p4 clone //NewDepotFromLargeSubfolder@all gitRepoFolder
Importing from //NewDepotFromLargeSubfolder@all into gitRepoFolder
Reinitialized existing Git repository in /Users/user/SomeTempFolder/gitRepoFolder/.git/
Import destination: refs/remotes/p4/master
Importing revision 26777 (0%)
Ignoring apple filetype file //NewDepotFromLargeSubfolder/SomePath/SomeIconFile.icns
Importing revision 27142 (33%)
Ignoring apple filetype file //NewDepotFromLargeSubfolder/AnotherPath/Some AppleScript file.scpt
Ignoring apple filetype file //NewDepotFromLargeSubfolder/AnotherPath/Another AppleScript file.scpt
Importing revision 27620 (100%)
fast-import failed: warning: Not updating refs/remotes/p4/master (new tip <some long git ID> does not contain <another long git ID>)
git-fast-import statistics:
<loads of git statistic>
运行 git p4
和 --verbose
似乎表明 Perforce 修订版的实际导入已成功完成,但随后出现了我不明白的错误:
Importing revision 27620 (100%)commit into refs/remotes/p4/master
Opening pipe: ['p4', '-G', '-x', '-', 'print']
Path/of/the/file/in/the/last/Changelist
Reading pipe: ['git', 'config', '--bool', 'git-p4.importLabels']
Traceback (most recent call last):
File "/usr/libexec/git-core/git-p4", line 3287, in <module>
main()
File "/usr/libexec/git-core/git-p4", line 3281, in main
if not cmd.run(args):
File "/usr/libexec/git-core/git-p4", line 3155, in run
if not P4Sync.run(self, depotPaths):
File "/usr/libexec/git-core/git-p4", line 3030, in run
die("fast-import failed: %s" % self.gitError.read())
File "/usr/libexec/git-core/git-p4", line 106, in die
raise Exception(msg)
Exception: fast-import failed: warning: ... (as above) ...
第二部分迁移到新的 git 存储库后工作正常。
阅读`git-p4 clone` fails "new tip ... does not contain ..."后,我在没有空格的工作文件夹中重试了迁移;同样的结果。我正在 Mac OS X 顺便说一句,但是 Perforce 服务器在 Debian 7.5 虚拟机上 运行。
我的问题:
+ 有人对如何找出这里的问题有什么建议吗?
+ 通常可以 'stack' 大块的修订历史吗?
+ 谁能想到另一种方法(除了有两个 git 回购协议)?
我根本不是 git 专家,但到目前为止,我几乎可以随便乱扔东西,而且 git 在弄清楚我想做什么方面做得非常出色; Reinitialized existing Git repository
消息似乎也表明我并没有完全离开。
The migration of the second part works fine when done into a new git repository
这可能是此处可接受的解决方法的基础:必须分离 Git 回购,并从“How do you merge two git repositories?”中选择一种技术以获得最终回购。
git filter-branch
approach is detailed in "Combining multiple git repositories".
(你还有一个simpler approach based on merge, also described here: The OP ssc selected "Merge two Git repositories without breaking file history")
几年前,我的一个 Perforce depot(例如 //FirstDepot/LargeSubfolder/...
)中的一个子文件夹变得太大而无法维护,所以我 'migrated' 将它放入自己的 depot(例如 //NewDepotFromLargeSubfolder/...
). Perforce 不支持从一个 depot 到另一个 depot 的集成,所以我基本上检查了文件,将它们添加到新的 depot 并从子文件夹中删除了它们。
现在我要将整个 Perforce 服务器迁移到多个 git 存储库。 git p4
程序运行良好,我已经成功地将其他不相关的 Perforce depot 迁移到 git(包括使用 @all
的完整文件历史记录 - 但是,这些 depot 从来没有 'migrated' 在 Perforce 中以描述的方式......)。
问题是我不想丢失//FirstDepot/LargeSubfolder/...
下的文件历史记录。那里有几千个更改列表(加上 //NewDepotFromLargeSubfolder/...
的几千个),其中许多包含非常有价值的信息。
我尝试从第一个位置迁移文件历史记录,然后 'stack' 在其之上迁移第二个位置的历史记录:
host:~ user$ mkdir SomeTempFolder
host:~ user$ cd SomeTempFolder
host:SomeTempFolder user$ export P4PORT=perforce:1666
host:SomeTempFolder user$ git p4 clone //FirstDepot/LargeSubfolder@all gitRepoFolder
Importing from //FirstDepot/LargeSubfolder@all into gitRepoFolder
Initialized empty Git repository in /Users/user/SomeTempFolder/gitRepoFolder/.git/
Import destination: refs/remotes/p4/master
Importing revision 26776 (99%)
Ignoring apple filetype file //FirstDepot/LargeSubfolder/SomePath/SomeIconFile.icns
Importing revision 26778 (100%)
因此,除了有关 Mac OS X 图标文件被忽略的消息外,第一位有效。但是第二部分失败了:
host:SomeTempFolder user$ git p4 clone //NewDepotFromLargeSubfolder@all gitRepoFolder
Importing from //NewDepotFromLargeSubfolder@all into gitRepoFolder
Reinitialized existing Git repository in /Users/user/SomeTempFolder/gitRepoFolder/.git/
Import destination: refs/remotes/p4/master
Importing revision 26777 (0%)
Ignoring apple filetype file //NewDepotFromLargeSubfolder/SomePath/SomeIconFile.icns
Importing revision 27142 (33%)
Ignoring apple filetype file //NewDepotFromLargeSubfolder/AnotherPath/Some AppleScript file.scpt
Ignoring apple filetype file //NewDepotFromLargeSubfolder/AnotherPath/Another AppleScript file.scpt
Importing revision 27620 (100%)
fast-import failed: warning: Not updating refs/remotes/p4/master (new tip <some long git ID> does not contain <another long git ID>)
git-fast-import statistics:
<loads of git statistic>
运行 git p4
和 --verbose
似乎表明 Perforce 修订版的实际导入已成功完成,但随后出现了我不明白的错误:
Importing revision 27620 (100%)commit into refs/remotes/p4/master
Opening pipe: ['p4', '-G', '-x', '-', 'print']
Path/of/the/file/in/the/last/Changelist
Reading pipe: ['git', 'config', '--bool', 'git-p4.importLabels']
Traceback (most recent call last):
File "/usr/libexec/git-core/git-p4", line 3287, in <module>
main()
File "/usr/libexec/git-core/git-p4", line 3281, in main
if not cmd.run(args):
File "/usr/libexec/git-core/git-p4", line 3155, in run
if not P4Sync.run(self, depotPaths):
File "/usr/libexec/git-core/git-p4", line 3030, in run
die("fast-import failed: %s" % self.gitError.read())
File "/usr/libexec/git-core/git-p4", line 106, in die
raise Exception(msg)
Exception: fast-import failed: warning: ... (as above) ...
第二部分迁移到新的 git 存储库后工作正常。
阅读`git-p4 clone` fails "new tip ... does not contain ..."后,我在没有空格的工作文件夹中重试了迁移;同样的结果。我正在 Mac OS X 顺便说一句,但是 Perforce 服务器在 Debian 7.5 虚拟机上 运行。
我的问题:
+ 有人对如何找出这里的问题有什么建议吗?
+ 通常可以 'stack' 大块的修订历史吗?
+ 谁能想到另一种方法(除了有两个 git 回购协议)?
我根本不是 git 专家,但到目前为止,我几乎可以随便乱扔东西,而且 git 在弄清楚我想做什么方面做得非常出色; Reinitialized existing Git repository
消息似乎也表明我并没有完全离开。
The migration of the second part works fine when done into a new git repository
这可能是此处可接受的解决方法的基础:必须分离 Git 回购,并从“How do you merge two git repositories?”中选择一种技术以获得最终回购。
git filter-branch
approach is detailed in "Combining multiple git repositories".
(你还有一个simpler approach based on merge, also described here: The OP ssc selected "Merge two Git repositories without breaking file history")