在 git svn clone 中使用 --no-metadata 有优势吗?

发布于 2024-12-19 04:02:32 字数 248 浏览 4 评论 0原文

我正在使用 git svn clone 进行从 SVN 存储库到 Git 存储库的单向转换。大多数示例都使用 --no-metadata 标志来执行此操作 - 使用此标志有优势吗?

据我所知,该标志删除了 SVN 修订号。我可以想到保留这些内容可能有用的原因(例如参考错误跟踪软件中提到的特定提交)。

使用 --no-metadata 标志的参数是什么?除了打破所有联系的感觉之外,还有什么好处吗?

I'm doing a one-way convert from an SVN repository to a Git repository using git svn clone. Most examples do this with the --no-metadata flag - is there an advantage to using this flag?

I understand that the flag removes the SVN revision numbers. I can think of reasons why it may be useful to keep these around (such as referring back to specific commits mentioned in bug tracking software).

What are the arguments for using the --no-metadata flag? Is there any benefit other than a sensation of breaking all ties?

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

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

发布评论

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

评论(2

把梦留给海 2024-12-26 04:02:32

使用 --no-metadata 的一个理由是它不会更改您的提交消息。因此,即使您从不同的位置获取,提交消息也将是相同的,因此提交哈希值将是相同的。

举个例子,如果我从本地 file: URL 中 git svn init 一个存储库,然后从 https: URL 中提取,则每次提交存储库将被复制,因为所有带有 git-svn-id: file:///... 的提交都将作为 git-svn-id: https:// 获取/...并用 new 编码SHA1 的。

如果我指定 --no-metadata 那么提交消息和这个 sha1 将是相同的,我可以从本地文件系统或 subversion 服务器获取,因为任何内容都只有一个副本git repo 中给出了 svn commit。

就我个人而言,我更喜欢有一个最小元数据选项,它记录了颠覆版本ID,但不是完整的元数据,但又不会与git-filter-branch混在一起我们要么全有,要么一无所有。

One argument for using --no-metadata is that it doesn't change your commit messages. So even if you fetch from different locations, the commit messages will be the same and thus the commit hashes will be the same.

As an example, if I git svn init a repo from a local file: URL and later pull from an https: URL, every commit in the repo will be duplicated, since all of the commits with git-svn-id: file:///... will be fetched as git-svn-id: https:///... and encoded with new SHA1's.

If I specify --no-metadata then the commit message and this sha1 has will be the same and I can fetch from either the local filesystem or the subversion server because there will only be a single copy of any given svn commit in the git repo.

Personally I would prefer it if there were a minimal metadata option, which recorded the subversion revision id, but not the full metadata, but without messing around with git-filter-branch we are stuck with all or nothing.

神爱温柔 2024-12-26 04:02:32

其实不推荐:

不建议使用此选项,因为它很难追踪
现有文档中对 SVN 修订号的旧引用、错误
报告和档案。如果您计划最终从 SVN 迁移到
git 并且确定要删除 SVN 历史记录,请考虑
而是使用 git-filter-branch(1) 。过滤器分支还允许重新格式化
元数据以便于阅读和重写作者信息
非“svn.authorsFile”用户。

It is actually not recommended:

This option is NOT recommended as it makes it difficult to track down
old references to SVN revision numbers in existing documentation, bug
reports and archives. If you plan to eventually migrate from SVN to
git and are certain about dropping SVN history, consider
git-filter-branch(1) instead. filter-branch also allows reformatting
of metadata for ease-of-reading and rewriting authorship info for
non-"svn.authorsFile" users.

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