check_integrity.sh: check more strickly.

This commit is contained in:
spacewander 2019-06-22 11:09:19 +08:00
parent ac9e35735b
commit c03e0ad841
4 changed files with 34 additions and 3 deletions

View file

@ -19,6 +19,21 @@ check_bash_script() {
|| err "Start git-$1 with '#!/usr/bin/env bash'"
}
check_git_extras_cmd_list() {
local whitelist=('extras')
for cmd in ${whitelist[*]}; do
test "$1" == "$cmd" && return
done
grep "\- \*\*git\-$1(1)\*\*" man/git-extras.md >/dev/null \
|| err "Add git-$1 in the list of commands in man/git-extras.md"
}
check_man_page_index() {
grep "git\-$1(1) git\-$1" man/index.txt >/dev/null \
|| err "Add git-$1 to index.txt"
}
check_documentation() {
local cmd="git-$1"
test -f "man/$cmd.md" || err "man/$cmd.md is required for bin/$cmd"
@ -27,6 +42,9 @@ check_documentation() {
then
err "Run 'make docs' to create man/$cmd.1 and man/$cmd.html"
fi
check_git_extras_cmd_list "$@"
check_man_page_index "$@"
}
check_Commands_page() {

View file

@ -17,6 +17,15 @@ To generate documentation:
$ make -C .. man/git-<command>.{1,html}
```
If you are introducing a new command, you should also update the `man/index.txt`
and `man/git-extras.{1,html,md}` via
```
$ make -C .. man/index.txt
$ make -C .. man/git-extras.md
$ make -C .. man/git-extras.{1,html}
```
4) Remember, we use the following naming convention for files:
```

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-EXTRAS" "1" "May 2018" "" "Git Extras"
.TH "GIT\-EXTRAS" "1" "June 2019" "" "Git Extras"
.
.SH "NAME"
\fBgit\-extras\fR \- Awesome GIT utilities
@ -171,6 +171,9 @@ Self update\.
\fBgit\-rename\-branch(1)\fR rename local branch and push to remote
.
.IP "\(bu" 4
\fBgit\-rename\-remote(1)\fR rename a remote
.
.IP "\(bu" 4
\fBgit\-rename\-tag(1)\fR Rename a tag
.
.IP "\(bu" 4

View file

@ -141,6 +141,7 @@
<li> <strong><a class="man-ref" href="git-refactor.html">git-refactor<span class="s">(1)</span></a></strong> Create refactor branch</li>
<li> <strong><a class="man-ref" href="git-release.html">git-release<span class="s">(1)</span></a></strong> Commit, tag and push changes to the repository</li>
<li> <strong><a class="man-ref" href="git-rename-branch.html">git-rename-branch<span class="s">(1)</span></a></strong> rename local branch and push to remote</li>
<li> <strong><a class="man-ref" href="git-rename-remote.html">git-rename-remote<span class="s">(1)</span></a></strong> rename a remote</li>
<li> <strong><a class="man-ref" href="git-rename-tag.html">git-rename-tag<span class="s">(1)</span></a></strong> Rename a tag</li>
<li> <strong><a class="man-ref" href="git-repl.html">git-repl<span class="s">(1)</span></a></strong> git read-eval-print-loop</li>
<li> <strong><a class="man-ref" href="git-reset-file.html">git-reset-file<span class="s">(1)</span></a></strong> Reset one file</li>
@ -164,7 +165,7 @@
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Tj Holowaychuk &lt;<a href="&#x6d;&#97;&#x69;&#x6c;&#x74;&#111;&#58;&#x74;&#106;&#64;&#118;&#x69;&#x73;&#105;&#111;&#x6e;&#x2d;&#x6d;&#x65;&#x64;&#x69;&#97;&#46;&#99;&#97;" data-bare-link="true">&#116;&#106;&#x40;&#118;&#x69;&#x73;&#x69;&#111;&#110;&#45;&#x6d;&#101;&#x64;&#x69;&#97;&#x2e;&#x63;&#97;</a>&gt;</p>
<p>Written by Tj Holowaychuk &lt;<a href="&#109;&#x61;&#x69;&#108;&#116;&#x6f;&#x3a;&#116;&#106;&#x40;&#x76;&#x69;&#115;&#x69;&#111;&#110;&#45;&#x6d;&#x65;&#x64;&#x69;&#97;&#46;&#99;&#x61;" data-bare-link="true">&#116;&#x6a;&#x40;&#x76;&#x69;&#x73;&#x69;&#111;&#x6e;&#x2d;&#109;&#101;&#100;&#105;&#x61;&#x2e;&#99;&#97;</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -177,7 +178,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>May 2018</li>
<li class='tc'>June 2019</li>
<li class='tr'>git-extras(1)</li>
</ol>