git-rofs

command module
v0.0.0-...-b63583f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

README

= Git ROFS

Git ROFS is a read-only FUSE filesystem for Git repositories. It is more
or less equivalent to a read-only version of `git checkout`, except it
doesn't do any writes to disk.

== Use

The requirements to build the program are:

* `go >= 1.12`
* `libgit2 >= 0.27`
* `libfuse`

The Go dependencies use CGo and may require `pkg-config` and a C compiler
as well. To build the program, run:

[source,bash]
----
make
----

To install it to `$prefix` (default `$HOME/bin`):

[source,bash]
----
make install
----

Run the program with:

[source,bash]
----
git-rofs [OPTION]... ROOT MOUNTPOINT
----

`ROOT` is the Git repository to look at. `MOUNTPOINT` is a directory
where the repository should be mounted.

By default, the program will mount the given repository at its current
`HEAD`. This is not very interesting. To mount it at anything that `git
rev-parse` can resolve into a commit hash, use the `-commit REF` option.

Run `git-rofs -h` or `git-rofs -help` to see all available options.

== Possible applications

* Look at the state of a repository at various points in its history.

* Run static analysis at different points in repository history in
parallel to see how metrics have evolved.

* Keep a read-only version checked out for code searching while developing
in a worktree.

== Possible improvements

* Change the reference that is checked out at runtime via some IPC mechanism.

* Create mountpoints if they don't exist. Clean them up on exit.

== Prior art

I wrote an earlier iteration of the same idea in https://github.com/gunnihinn/gitsplorer[Python].
It was https://magnusson.io/post/gitsplorer/[uncomfortably slow].

== Contributing

Development happens in this Github repository. Please file issues for
any bugs or features. Pull requests are very welcome.

== License

This project is licensed under the GPLv3.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL