`git-p4 clone` 失败“新提示...不包含...”

发布于 2024-09-29 10:32:53 字数 475 浏览 2 评论 0原文

我在 Windows 上运行,使用 Windows p4 客户端,并通过 Cygwin 安装 git。 p4 客户端宣传其语法在不同平台上是如何规则的,所以这应该是很不错的。

因此,当我转到 git-p4 clone --verbose //depot/path/to/source 时,它会列出存储库中的所有文件,就好像它们正在被签出一样,然后死掉说

异常:快速导入失败:警告:未更新 refs/remotes/p4/master (新 提示 cd601b92da8625c90af05685e450e55b6d19c9e9 不包含 3a512c9408e3cbeef 94c78dfd7115f81e4a6fd0d)

并以一大块“git-fast-import 统计信息”结束。查看错误:新提示?啊?需要包含什么?

我剩下的是一个 .git 存储库,只有几兆(比完整的源代码树小得多)。有什么想法吗?

I'm runnining on Windows, with the windows p4 client, and git installed via Cygwin. The p4 client advertises how its syntax is regular across platforms and all that, so that should be hunky-dory.

So when I go to git-p4 clone --verbose //depot/path/to/source, it lists out all the files in the repository as though they were being checked out, then dies saying

Exception: fast-import failed: warning: Not updating refs/remotes/p4/master (new
tip cd601b92da8625c90af05685e450e55b6d19c9e9 does not contain 3a512c9408e3cbeef
94c78dfd7115f81e4a6fd0d)

and concludes with a big block of "git-fast-import statistics". Looking at the error: new tip? Huh? What needs to contain it?

What I'm left with is a .git repo that's a couple of megs (much, much smaller than the full source tree would be). Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

辞旧 2024-10-06 10:32:53

对于要导入的第一个 CL,您是否收到“忽略修订版 XYZ,因为它会产生空提交”?

如果是这样,您将遇到 git-p4.py 中的错误,它会在实际提交任何内容之前清除“initialParent”设置(这是必需的,以便 git fast-import 可以将新提交加入到先前的导入中)。因此,新的导入文件流与旧的文件流没有连接。

我目前正在通过使用 --changesfile 并明确确定需要导入哪些 CL 来解决此问题。

Do you get "Ignoring revision XYZ as it would produce an empty commit" for the very first CL to be imported?

If so, you're hitting a bug in git-p4.py where it clears the "initialParent" setting (necessary so that git fast-import can join the new commits up to the previous import) before it actually commits anything. The new stream of imported files are therefore left unconnected to the old.

I'm currently working around this by using --changesfile and working out explicitly which CL's need to be imported.

风吹短裙飘 2024-10-06 10:32:53

我也遇到过类似的问题,通常可以追溯到路径、分支名称等中的大小写。不确定 P4,但确保您没有 Master 分支 - 它应该是 master。全线跟随同一个团。另外,避免目录和文件名中含有空格。许多以 git 为中心的工具并不喜欢这样。 Gitolite 就是一个例子。它不允许存储库中有空间。

I've had a similar problem and can usually be traced to the casing in paths, branch names, etc. Not sure about P4 but ensure that you don't have a Master branch - it should be master. Follow the same regiment across the board. Also, avoid directory and file names with spaces in them. A lot of git-centric tooling does not like that. Gitolite is one example. It will not allow a repository that has a space in it.

橘香 2024-10-06 10:32:53

我在运行快速导入时还遇到了“新提示 x 不包含 y”错误。

就我而言,这是由我尝试导入的存储库的主分支中预先存在的不相关提交引起的。我已经使用 GitHub 客户端初始化了存储库,该客户端添加了初始提交(以添加 .gitignore 文件)。快速导入工具可能无法使导入的提交与分支的当前状态保持一致,因为 GitHub 工具的提交与导入的提交没有关系。

我的解决方案是使用“git init”初始化一个空的存储库,然后运行快速导入。

I also encountered the "new tip x does not contain y" error running fast-import.

In my case, this was caused by an unrelated preexisting commit in the master branch of the repo I was attempting to import into. I had initialized the repo with the GitHub client which added an initial commit (to add a .gitignore file). The fast-import tool presumably could not reconcile the imported commits with the current state of the branch since the GitHub tool's commit had no relationship with the commits being imported.

The solution for me was to instead initialize an empty repo with "git init" and then run fast-import.

只想待在家 2024-10-06 10:32:53

与接受的答案类似,当我尝试以以下形式同步到 git 分支时,我遇到了同样的问题:

git p4 sync --branch=feature/f1 //depot/path/to/code

分支名称中的 / 似乎导致了相同的神秘快速导入失败警告。不幸的是 git-p4 似乎不支持标准 git-flow 分支名称。

更改为这样的分支有效:

git p4 sync --branch=f1 //depot/path/to/code

Similar to the accepted answer, I had this same problem when trying to sync to a git branch in the form:

git p4 sync --branch=feature/f1 //depot/path/to/code

The / in the branch name appeared to cause the same cryptic fast-import failed warning. Unfortunately git-p4 doesn't seem to support standard git-flow branch names.

Changing to a branch like this worked:

git p4 sync --branch=f1 //depot/path/to/code
隐诗 2024-10-06 10:32:53

我也有类似的问题。对我有用的是更新 git-p4 python 代码。您可以在此处查看提交,但希望它会被拉起很快。

I had similar problems. What worked for me was updating the git-p4 python code. You can take a look at the commit here, but hopefully it will be pulled up soon.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文