Skip to content

Commit 47fe67f

Browse files
committed
Fix newlines in commit messages
Add a newline example in commit message and double line ending for paragraph test. Include the test in the documentation.
1 parent bf5ffaa commit 47fe67f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

doc/git-scenario.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ bob
4242

4343
curl https://raw.githubusercontent.com/github/gitignore/main/TeX.gitignore > .gitignore
4444
git add .gitignore
45-
git commit -m "Add gitignore" --date="2017-08-06 12:03"
45+
git commit -m "Add gitignore
46+
47+
Get the TeX.gitignore from the gitignore repository and
48+
use it for this project.
49+
50+
From github" --date="2017-08-06 12:03"
4651

4752
charlie
4853

doc/gitinfo-lua.tex

+4-2
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,13 @@ \section*{Changelog}
314314
\end{description}
315315
\end{lstlisting}
316316
\noindent
317-
\newcommand\commitline[1]{\item #1}
317+
\newcommand\commitline[2]{\item #1
318+
319+
#2}
318320
\newcommand\formatversion[3]{%
319321
\item[#1] \gittag[(taggerdate)(taggerdate:short)(authordate:short)]{printdate}{#1}
320322
\begin{itemize}
321-
\forgitcommit[s]{commitline}{#3}
323+
\forgitcommit[s,b]{commitline}{#3}
322324
\end{itemize}%
323325
}%
324326
\setlength{\fboxsep}{16pt}%

scripts/gitinfo-lua.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ local api = {
4545
['{'] = '\\{',
4646
['}'] = '\\}',
4747
['~'] = '\\textasciitilde ',
48-
['%^'] = '\\textasciicircum '
48+
['%^'] = '\\textasciicircum ',
49+
['\n'] = ' '
4950
}
5051
}
5152
local mt = {
@@ -73,6 +74,7 @@ end
7374

7475
function api:escape_str(value)
7576
local buf = string.gsub(value, '\\', '\\textbackslash ')
77+
buf = string.gsub(buf, "\n%s*\n+", "\\par ")
7678
for search, replace in pairs(self.escape_chars) do
7779
buf = string.gsub(buf, search, replace)
7880
end

0 commit comments

Comments
 (0)