Adds diffstat to commit template and limit flag to the repo command

This commit is contained in:
Miguel de la Cruz 2024-06-30 13:02:22 +02:00
parent 6a1b122d2d
commit 5f71f435f7
5 changed files with 64 additions and 24 deletions

View file

@ -41,20 +41,15 @@
{{.commit.Msg}}
<b>Diffstat:</b>
<table>
{{range $i, $fs := .commit.FileStats}}
<tr>
<td class="M">M</td>
<td><a href="#h0">stagit-index.c</a></td>
<td class="{{$fs.Mode}}">{{$fs.Mode}}</td>
<td><a href="#h{{$i}}">{{$fs.Name}}</a></td>
<td> | </td>
<td class="num">2</td>
<td><span class="i">+</span><span class="d">-</span></td>
</tr>
<tr>
<td class="M">M</td>
<td><a href="#h1">stagit.c</a></td>
<td> | </td>
<td class="num">2</td>
<td><span class="i">+</span><span class="d">-</span></td>
<td class="num">{{$fs.Total}}</td>
<td>{{if gt $fs.Adds 0}}<span class="i">{{repeatStr "+" $fs.Adds}}</span>{{end}}{{if gt $fs.Dels 0}}<span class="d">{{repeatStr "-" $fs.Dels}}</span>{{end}}</td>
</tr>
{{end}}
</table></pre><pre>{{.commit.Files}} file{{if ne .commit.Files 1}}s{{end}} changed, {{.commit.Adds}} insertion{{if ne .commit.Adds 1}}s{{end}}(+), {{.commit.Dels}} deletion{{if ne .commit.Dels 1}}s{{end}}(-)
<hr/><b>diff --git a/<a id="h0" href="../file/stagit-index.c.html">stagit-index.c</a> b/<a href="../file/stagit-index.c.html">stagit-index.c</a></b>
<a href="#h0-0" id="h0-0" class="h">@@ -179,7 +179,7 @@ main(int argc, char *argv[])

View file

@ -54,6 +54,9 @@
<td class="num" align="right">-{{.Dels}}</td>
</tr>
{{- end}}
{{if ne .remaining 0}}
<tr><td></td><td colspan="5">{{.remaining}} more commit{{if ne .remaining 1}}s{{end}} remaining, fetch the repository</td></tr>
{{end}}
</tbody></table></div>
</body>
</html>