另一个版本控制系统是否具有类似 ClearCase 的文件系统来访问文件版本?
在 ClearCase 中,如果我正在处理某个文件 X 并且还想查看其以前的版本(例如版本 5),则可以使用 X@@/main/5
形式使用它。其他(最好是免费的)版本控制系统是否提供类似的功能?
Mercurial 有 hg cat
和 hg co
,但它们仍然无法接近 ClearCase 的上述功能。
In ClearCase, if I am working on some file X and want to also see its previous version (say version 5), it is available as X@@/main/5
. Is something similar available with other (preferably free) version control systems?
Mercurial has hg cat
and hg co
, but they still do not come close to ClearCase's feature above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,
X@@/main/5
是一个扩展路径名,您只能在 动态视图。其次,您可以快速 在 Git 中访问旧版本的文件:(
文件路径始终来自 git 存储库的根目录)
您可以使用 git show 进行其他用途(例如查看另一个分支中的文件)
请参阅“如何从 Git 中的特定修订版检索单个文件?” 了解更多信息。
就基于修订的文件系统的动态探索而言,Git 的 hgfs 等效项为:
git 存储库。
figfs ( Git FileSystem 的文件系统接口),它在 gitfs 上进行了扩展。
来自 Reilly Grant
< img src="https://i.sstatic.net/UrLTN.png" alt="fuse">
FUSE 应用程序允许将文件系统实现为用户空间进程。
应用程序的请求通过 VFS 层传递到 FUSE 驱动程序,
将请求发送到用户空间文件系统守护进程。
Figfs 然后通过普通文件系统访问 Git 存储库,并将结果数据返回给应用程序。
First,
X@@/main/5
is an extended pathname which you can really explore only in dynamic views.Second, you can quickly access an older version of a file in Git:
(with the path of the file being always from the root of the git repository)
And you can use git show for other usage (see the file as it is in another branch for instance)
See "How to retrieve a single file from specific revision in Git?" for more.
In term of dynamic exploration of a revision-based filesystem, the equivalent of hgfs for Git would be:
git repositories.
figfs (the Filesystem Interface to Git FileSystem), which expands on gitfs.
From the work of Reilly Grant
A FUSE application allows a filesystem to be implemented as a user-space process.
An application’s request is passed through the VFS layer and into the FUSE driver which
sends the request to the user space filesystem daemon.
Figfs then accesses the Git repository through the normal filesystem and returns the resulting data to the application.
快速 Google 搜索发现 gitfs:
可能还有其他(更活跃的)项目提供类似的功能(Git 和其他 VCS)。
A quick Google search found gitfs:
There are likely other (more active) projects offering similar features (both for Git and other VCSes).
基本上,您想要处理任意修订版的每个
hg
命令都可以 - 在hg
中使用-r
就像使用@@< /code> 始终以明文形式显示。
hg
“仅”需要-r
因为文件的版本不独立于存储库,因此给定文件和存储库版本,-r
是明确的。如果您想编辑文件,管道
hg cat
与读取file@@/branch/ver
完全相同 - 它们提供了完全相同的(只读)访问权限数据。如果您希望在 Mercurial 中通过 MVFS 获得动态视图的便利,那是一个完全不同的问题,而且您实际上无法做到这一点(您可以通过 NFS 实现只读,但显然那里没有版本控制)。
Basically every
hg
command you would want to handle an arbitrary revision can - using-r
inhg
is just like using@@
in clearcase all the time.hg
"only" needs-r
because files aren't versioned independently of the repository, so given a file and a repo version,-r
is unambiguous.If you want to edit a file, piping
hg cat
is exactly like readingfile@@/branch/ver
- they provide exactly the same (read-only) access to the data.If you want the convenience of dynamic views over MVFS in Mercurial, that's an entirely different problem and you can't really do it (you can do it read-only over NFS, but obviously there's no versioning there).