From 4d2d393142918594da02e498169dd692fe21e17c Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Wed, 18 Sep 2024 20:27:11 -0700 Subject: [PATCH] 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 --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 2 +- check_integrity.sh | 12 +++++++----- man/git-extras.1 | 4 +++- man/git-extras.html | 4 +++- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b40972147..cbe0153f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e7e7a343..7336c6f5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/check_integrity.sh b/check_integrity.sh index 16c2583a7..b436e0d76 100755 --- a/check_integrity.sh +++ b/check_integrity.sh @@ -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 "$@" } @@ -77,12 +82,9 @@ check() { check_completion "$1" } -usage() { - echo >&2 "Usage: ./check_integrity.sh [ ...]" - 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-} diff --git a/man/git-extras.1 b/man/git-extras.1 index c922217bf..c7d4af0ab 100644 --- a/man/git-extras.1 +++ b/man/git-extras.1 @@ -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" @@ -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 diff --git a/man/git-extras.html b/man/git-extras.html index d1fb5489b..00ed5d0fc 100644 --- a/man/git-extras.html +++ b/man/git-extras.html @@ -209,6 +209,8 @@

COMMANDS

  • git-rename-branch(1) rename local branch and push to remote
  • +git-rename-file(1) Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity.
  • +
  • git-rename-remote(1) Rename a remote
  • git-rename-tag(1) Rename a tag
  • @@ -265,7 +267,7 @@

    SEE ALSO

    1. -
    2. May 2023
    3. +
    4. September 2024
    5. git-extras(1)