Skip to content

man page for design with ctl file

manzur edited this page Sep 13, 2010 · 3 revisions
Man page of GitFS

GitFS


Section: Devices and Network Interfaces (4)
Index

 

Name

gitfs – File server interface to Git scm
 

Synopsis

mount {gitfs [-d] repo} mntpt
 

Description

gitfs

is a file server that represents git repository. Git commands are executed by writing them into the
ctl

file. Result of a command is stored in the
data

file.

There’s no "interactive" mode for
git-commit.

Commit message should be written to
data

file,

Interactive add is done through utility called git/add, as stdin is used
by Styxserver. All operations with git/add works as some kind of shell for ctl.

Objects located in objects can be read as ordinary files. Result of reading files under
objects/ directory is the same as you could get from
git cat-file

 

Options

-d

is used to see messages from fileserver

repo is path to git repository. By default it searches for .git directory in the path

from current directory upto the /.
 

Hierarchy

/log

File that contains log. If you want to use options for git-log
you can write options to ctl file and get results from data file.
This file contains unfiltered log of the repository, i.e. it’s the same
what git-log does by default.

/status

File that is substitution for git-status command.

/tags

Directory, which contains tags.

/config

Repository specific configurations are stored in this file.

/exclude

File that contains patterns of file names to exclude from
git-add.

/objects/[0-9a-f][0-9a-f]

This directory object store associated with the repository. Each subdirectory contains objects(blobs, tags, trees, commits)
of the repository.

/files/*

This directory contains the files from repo/ directory.

/ctl

File that’s used for operating with git. Commands can be send are: commit, gc, add, branch, reset, status, checkout, merge, rm.

/data

Results of executed commands in the
ctl

file are stored here.      

 

Examples

Mounting fileserver and reading logs

Mount git repository and read the unfiltered log file.


$ mount {gitfs .} mntpt
$ cat mntpt/log
<some log>
$ unmount mntpt

The same as above but with filtering and getting log for the last 2 weeks

$ echo ‘log —since=2 weeks ago’ > ctl
$ cat git_repo/data
<some log>

Simple commits.

Commit message is read from data file
$ echo checkout > ctl

  1. …Some editing…
    $ echo add file1 > ctl
    $ echo rm file2 > ctl
    $ echo commit > ctl

Merges

$ echo merge branchname > ctl

Result of merge is read from data file.
After resolving conflict you can add and commit:

$ echo add file1 > ctl
$ echo commit > ctl

Differences between trees and files

$ echo diff-tree <treeish1> <treeish2> > ctl

Difference between index and working directory

$ echo show-diff > ctl

 

Source

gitfs.b
 

See also

 

Bugs    






 

Index