Module gall.ll

Low level interface to Git

In addition to the documented functions below, the following Git subcommands are directly exposed as functions which are essentially like…

function gall.ll.FUNC(...)
    return gall.ll.rungit("FUNC", ...)
end

…but with correct handling of the tabular input to rungit

The current full-list of those functions is:

  • cat_file exposes git cat-file
  • symbolic_ref exposes git symbolic-ref
  • show_ref exposes git show-ref
  • hash_object exposes git hash-object
  • ls_tree exposes git ls-tree
  • init exposes git init
  • merge_base exposes git merge-base
  • rev_list exposes git rev-list
  • config exposes git config

Functions

chomp (s) Remove a trailing newline if present.
get_set_git (e) Get / Set the git executable

If e is provided, then it is set as the path, otherwise the current path is returned as-is.

rungit (t) Run the given git process.


Functions

chomp (s)
Remove a trailing newline if present.

Parameters:

  • s string The string to chomp

Returns:

    string s with a single trailing newline (if present) removed.
get_set_git (e)
Get / Set the git executable

If e is provided, then it is set as the path, otherwise the current path is returned as-is. By default, the Git executable is simply git.

Parameters:

  • e optional string The path to the Git executable

Returns:

    string The path to the Git executable
rungit (t)
Run the given git process.

The run parameters must contain:

  • The repo (the value for GIT_DIR)
  • At least 1 list entry for the command line
  • Optionally an env table.
  • Optionally a string stdin to pass into the process
  • Optionally a stdout boolean which says whether to capture stdout
  • Optionally a stderr boolean which says whether to capture stderr

Additionally, if stdout or stderr are functions instead of booleans then they will be called to filter the stream after reading.

Parameters:

Returns:

  1. number Exit code
  2. string Contents of stdout
  3. string Contents of stderr

Raises:

Function will assert if given no repository or if the subprocess is killed uncleanly
generated by LDoc 1.4.3 Last updated 2016-10-27 06:21:07