-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGit_homedirs_repository.mw
40 lines (28 loc) · 2.79 KB
/
Git_homedirs_repository.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
This page describes the way that ICPC-live is storing the contestants' home directories.
We store the home directories in a Revision Control System.
By committing changes at regular intervals, an (almost) complete history of the home
directories is created, which can also be queried for changes between different times.
We use [http://git-scm.com/ Git] as RCS system, since it handles large amounts of data well.
= <tt>gitcommit.sh</tt> script =
The script <tt>gitcommit.sh</tt> can be called with two different arguments:
# '''init''' initializes a new Git repository at the <tt>BASEDIR</tt> as configured in the script. This can take a few minutes if the directory is already populated with files, because it also deltifies and compresses the Git database.
# '''commit''' automatically commits any changes in the repository. The commit is tagged as <tt>Tag_HH_MM</tt> with HH:MM the time of the commit. This command is meant to be called at regular intervals from a looping script or Cron job.
The script also creates two files <tt>listing.txt</tt> and <tt>listing_full.txt</tt> in <tt>BASEDIR</tt> that contain a listing of all files with metadata such as permissions and modification times, which are not stored by Git. The second lists all files; the first excludes dot-files. These files are also versioned, so their diffs also provide a quick overview of which files have changed.
= Gitweb =
The plan is to setup [https://git.wiki.kernel.org/index.php/Gitweb Gitweb] on a local webserver as an interface to query the Git repository.
This web interface can be browsed manually, but also be queried by passing parameters via the URL.
The following parameters are most relevant:
* '''a'''=<action> action to perform, see list below.
* '''f'''=<filename> file name (with full path from base of repository)
* '''hb'''=<tag> tag (or commit SHA1 hash) to apply to, unspecified means most recent (i.e. HEAD)
* '''hbp'''=<tag> parent tag, can be used to specify original for diffs
Actions that can be specified (those most useful for automated queries):
* '''blob_plain''' returns file at specified commit
* '''blobdiff_plain''' returns diff of a file between two revisions (tags)
* '''commitdiff_plain''' returns a diff of all changes between two revisions
* '''tree''' browse repository tree (optionally specify subdirectory)
For example, to show the differences between a file at times 10:52 and now, use
http://localhost/gitweb/?p=icpc-homes/.git;a=blobdiff_plain;f=team03/probA.java;hb=HEAD;hpb=Tag_10_52
The precise base URL prefix will probably change.
= Alternative access =
Alternatively to the Gitweb interface, since Git is a distributed RCS, it is easy to clone it to another computer or account (e.g. over SSH) and use your favourite tools to browse the repository, such as <tt>gitk</tt>.