Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does another version control system have a ClearCase-like filesystem access to file versions?

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.

like image 455
Vijay Avatar asked May 26 '10 05:05

Vijay


3 Answers

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:

git show REVISION:path/to/file

(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:

  • gitfs FUSE-based filesystem for working with source trees stored in git repositories.

figfs (the Filesystem Interface to Git FileSystem), which expands on gitfs.

The repository is presented as a filesystem which allows multiple versions and branches of the project code to be viewed simultaneously and without the need to reconfigure the user's workspace.

In order to provide a filesystem service, figfs uses the Filesystem in User space (FUSE)

From the work of Reilly Grant

fuse

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.

like image 95
VonC Avatar answered Oct 18 '22 17:10

VonC


A quick Google search found gitfs:

gitfs is a FUSE-based filesystem for working with source trees stored in git repositories. The eventual goal is to provide a convenient way to work with lots of branches and patches. Currently only very basic functionality is implemented -- read-only access to the existing tags and objects.

There are likely other (more active) projects offering similar features (both for Git and other VCSes).

like image 33
Greg Hewgill Avatar answered Oct 18 '22 17:10

Greg Hewgill


Basically every hg command you would want to handle an arbitrary revision can - using -r in hg 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 reading file@@/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).

like image 20
Nick Bastin Avatar answered Oct 18 '22 17:10

Nick Bastin