Skip to content

Commit

Permalink
Use filetimes in check_integrity (#1162)
Browse files Browse the repository at this point in the history
* check the file times in check_integrity

* make no-arguments to check_integrity check all commands, and also make check_integrity run git-utimes first

this has the downside that the script now takes a little longer. But the upside that it guarantees more correctness.

* update git-extras

using the incredible power of the new script, I have detected this was out of date, out of sync, etc
  • Loading branch information
wyattscarpenter authored Sep 19, 2024
1 parent ffee88a commit 4d2d393
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
sudo apt-get install -y bsdmainutils
- name: Script
run: |
./check_integrity.sh $(find bin | cut -b 5- | xargs)
./check_integrity.sh
- name: Brew release
if: matrix.platform == 'macos-latest'
run: |
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Let's say you wish to add a new command. Assuming your new command is named `foo
5. (Optional) Update `./etc/bash_completion.sh`.
6. (Optional) Update `./etc/git-extras.fish`.
7. (Optional) Add a test under `./tests`.
8. Run `./check_integrity.sh foo` to check if all done.
8. Run `./check_integrity.sh foo` to check if all done. (You may also run `./check_integrity.sh` to check all commands.)

You are welcome to open up an issue to discuss new commands or features before opening a pull request.

Expand Down
12 changes: 7 additions & 5 deletions check_integrity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ check_documentation() {
err "Create man/$cmd.1 and man/$cmd.html via $(make_doc "$1")"
fi

if [ "man/$cmd.md" -nt "man/$cmd.1" ] || [ "man/$cmd.md" -nt "man/$cmd.html" ]
then
err "man/$cmd.md, man/$cmd.1, and man/$cmd.html all exist, but man/$cmd.md is newer. You should rm man/$cmd.1 man/$cmd.html and then create man/$cmd.1 and man/$cmd.html via $(make_doc "$1")"
fi

check_git_extras_cmd_list "$@"
check_man_page_index "$@"
}
Expand Down Expand Up @@ -77,12 +82,9 @@ check() {
check_completion "$1"
}

usage() {
echo >&2 "Usage: ./check_integrity.sh <command-name> [<command-name2> ...]"
exit 0
}
test $# == 0 && set -- $(find bin | cut -b 5- | xargs)

test $# == 0 && usage
./bin/git-utimes --newer

for name in "$@"; do
name=${name#git-}
Expand Down
4 changes: 3 additions & 1 deletion man/git-extras.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-EXTRAS" "1" "May 2023" "" "Git Extras"
.TH "GIT\-EXTRAS" "1" "September 2024" "" "Git Extras"
.SH "NAME"
\fBgit\-extras\fR \- Awesome GIT utilities
.SH "SYNOPSIS"
Expand Down Expand Up @@ -127,6 +127,8 @@ Change the default branch to \fB$BRANCH\fR\. If \fBgit\-extras\.default\-branch\
.IP "\[ci]" 4
\fBgit\-rename\-branch(1)\fR rename local branch and push to remote
.IP "\[ci]" 4
\fBgit\-rename\-file(1)\fR Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case\-sensitivity\.
.IP "\[ci]" 4
\fBgit\-rename\-remote(1)\fR Rename a remote
.IP "\[ci]" 4
\fBgit\-rename\-tag(1)\fR Rename a tag
Expand Down
4 changes: 3 additions & 1 deletion man/git-extras.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4d2d393

Please sign in to comment.