Skip to content

Commit

Permalink
Document new \forgitcommit interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MacLotsen committed Apr 6, 2024
1 parent 5f1535c commit e946d44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions doc/gitinfo-lua.tex
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,13 @@
Consult \texttt{man git-log} for possible format variables and omit the \% for every variable.\\

\noindent
\DescribeMacro{\forgitcommit}\oarg{format}\marg{csname}\marg{rev\_spec}\\
\DescribeMacro{\forgitcommit}\oarg{format}\marg{csname}\marg{rev\_spec, files=\{...\}, flags=\{...\}, cwd=...}\\
For displaying multiple commits the~\cmd{\forgitcommit} is used, which has the same arguments as \cmd{\gitcommit}, but only this time the \texttt{csname} is executed for every commit.
The last argument \texttt{rev\_spec} this time, however, can have no argument or a sequence.
The last argument, which originally only took a \texttt{rev\_spec}, now also supports some additional `named' arguments.
The argument \meta{files} takes a list of file names relative from the root of the git project.
When \meta{files} is given, all commits will be filtered out accordingly.
Currently, for \meta{flags}, only \texttt{merges} and \texttt{no-merges} are supported, which includes or excludes merge commits.
The \meta{cwd} option is like \cmd{\gitdirectory}, but only for this call.

\noindent\setlength\xample{4.5cm}\setlength\xamplesep{0pt}
\begin{minipage}[t]{\linewidth-\xample-\xamplesep}
Expand Down
2 changes: 1 addition & 1 deletion scripts/gitinfo-lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ local parse_commit_opts = luakeys.define({
flags = {
sub_keys = {
merges = { data_type='boolean', exclusive_group='merges' },
['no-merges'] = { name = 'no-merges', data_type='boolean', exclusive_group='merges' }
['no-merges'] = { data_type='boolean', exclusive_group='merges' }
}
}
})
Expand Down

0 comments on commit e946d44

Please sign in to comment.