Skip to content

Commit 4d2d393

Browse files
Use filetimes in check_integrity (#1162)
* 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
1 parent ffee88a commit 4d2d393

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
sudo apt-get install -y bsdmainutils
7272
- name: Script
7373
run: |
74-
./check_integrity.sh $(find bin | cut -b 5- | xargs)
74+
./check_integrity.sh
7575
- name: Brew release
7676
if: matrix.platform == 'macos-latest'
7777
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Let's say you wish to add a new command. Assuming your new command is named `foo
2525
5. (Optional) Update `./etc/bash_completion.sh`.
2626
6. (Optional) Update `./etc/git-extras.fish`.
2727
7. (Optional) Add a test under `./tests`.
28-
8. Run `./check_integrity.sh foo` to check if all done.
28+
8. Run `./check_integrity.sh foo` to check if all done. (You may also run `./check_integrity.sh` to check all commands.)
2929

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

check_integrity.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ check_documentation() {
4747
err "Create man/$cmd.1 and man/$cmd.html via $(make_doc "$1")"
4848
fi
4949

50+
if [ "man/$cmd.md" -nt "man/$cmd.1" ] || [ "man/$cmd.md" -nt "man/$cmd.html" ]
51+
then
52+
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")"
53+
fi
54+
5055
check_git_extras_cmd_list "$@"
5156
check_man_page_index "$@"
5257
}
@@ -77,12 +82,9 @@ check() {
7782
check_completion "$1"
7883
}
7984

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

85-
test $# == 0 && usage
87+
./bin/git-utimes --newer
8688

8789
for name in "$@"; do
8890
name=${name#git-}

man/git-extras.1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.9.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
3-
.TH "GIT\-EXTRAS" "1" "May 2023" "" "Git Extras"
3+
.TH "GIT\-EXTRAS" "1" "September 2024" "" "Git Extras"
44
.SH "NAME"
55
\fBgit\-extras\fR \- Awesome GIT utilities
66
.SH "SYNOPSIS"
@@ -127,6 +127,8 @@ Change the default branch to \fB$BRANCH\fR\. If \fBgit\-extras\.default\-branch\
127127
.IP "\[ci]" 4
128128
\fBgit\-rename\-branch(1)\fR rename local branch and push to remote
129129
.IP "\[ci]" 4
130+
\fBgit\-rename\-file(1)\fR Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case\-sensitivity\.
131+
.IP "\[ci]" 4
130132
\fBgit\-rename\-remote(1)\fR Rename a remote
131133
.IP "\[ci]" 4
132134
\fBgit\-rename\-tag(1)\fR Rename a tag

man/git-extras.html

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)