git-query

git data extraction tool using c and libgit2

git clone https://9o.is/git/git-query.git

README

(1379B)


      1 git-query
      2 =========
      3 
      4 Git data extraction tool.
      5 
      6 It extracts a minimal set of git repository data in XML format, suitable for piping to
      7 other templating tools.
      8 
      9 Motivation
     10 ----------
     11 
     12 This is a fork of stagit, kept here for reference. stagit is a great static git page
     13 generator, but its HTML output is hardcoded into the binary. If you want different styling,
     14 layouts, or to integrate with other tools, you're limited. I don't use this
     15 as git cli commands suffice for creating html templates with the `--format` flag, and git's
     16 tabular ouput can be parsed and joined with awk or the unix `join` command.
     17 
     18 Usage
     19 -----
     20 
     21 git-query <command> <repo> [args...]
     22 
     23 Commands:
     24   log <repo> [n]    Output commit log (default 100 commits)
     25   commit <repo> [oid]  Output commit detail with diff
     26   tree <repo> [oid]   Output file tree listing
     27   blob <repo> <path> [oid]  Output raw file content
     28   refs <repo>        Output branches and tags
     29 
     30 
     31 Build and install
     32 -----------------
     33 
     34 $ make
     35 # make install
     36 
     37 
     38 Dependencies
     39 ------------
     40 
     41 - C compiler (C99)
     42 - libgit2 (v0.22+)
     43 - POSIX make
     44 
     45 
     46 Examples
     47 --------
     48 
     49 # Get last 10 commits
     50 git-query log /path/to/repo 10
     51 
     52 # Get specific commit
     53 git-query commit /path/to/repo abc123def
     54 
     55 # Get file tree at HEAD
     56 git-query tree /path/to/repo
     57 
     58 # Get file content
     59 git-query blob /path/to/repo README.md
     60 
     61 # Get list of branches and tags
     62 git-query refs /path/to/repo