LaTeX2e package providing acces to some git info
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit ahead of mpg:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



                   Using git informations in LaTeX documents
                            Manuel Pégourié-Gonnard

This an early version of the git-info LaTeX package, not yet suitable for
distribution on the CTAN, but maybe still usable.  However, be warned that
everything may change without warning until the package is published on CTAN.

Currently, there is only one feature and no documentation besides this readme
and the example files.

The feature is, if you load git-info in a document lying in a git repository,
the package defines a few macros containing information about the current HEAD:
- hash, committer and date of the last commit,
- current branch.
See the example and test files for the full list of macros available.

The package has two options, only one of which is used atm: 'maxdepth=N', whose
default value is 8. It is the maximum allowed depth (in terms of directory
level) of the current directory relative to the root of the git repo. Make it
bigger than if 8 is not enough for you and git-info fails with a error like
"this is not a git repository".

Git-info works by parsing some plain-text files in the git repository in pure
TeX.  There is currently some restrictions : eg, the current HEAD must be a branch,
not detached; and probably other restrictions I am not aware of, due to my poor
knowledge of git (internals).

Plans for the future are to allow access to the same information (except the
branch) individually for each file, à la svn-multi.  With current TeX, it can
probably not be done in TeX macros, since access to a few compressed files is
needed.  So a helper script will be provided, intended to be run by the
post-commit hook, writing the necessary information to a plain text file.

Other plans for the future also include more testing, some customisation options,
and a proper documentation, of course.

Feel free to test the package, report features and suggest new bugs ;-)

Happy TeXing!