From 751172d8646df3b5f1600480ac3e2479ca33be9a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:10:29 +1300 Subject: Rename README.markdown to README.md --- README.markdown | 35 ----------------------------------- README.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 README.markdown create mode 100644 README.md diff --git a/README.markdown b/README.markdown deleted file mode 100644 index 87e8c7c..0000000 --- a/README.markdown +++ /dev/null @@ -1,35 +0,0 @@ -`watch-vcs-tags` -================ - -Scripts that given a list of repository roots as arguments look for new tags -available on remote systems, and report the repository name and a tab-indented -list of new tags, if any. - -Presently only `watch-git-tags` is implemented (well, published). This is all -implemented in POSIX `sh`, but does require a `mktemp(1)` implementation that -supports the `-d` option to create temporary directories. - - $ watch-git-tags ~/.local/src/ed/vim - /home/tom/.local/src/ed/vim - v8.0.0858 - -You can install it in `/usr/local/bin` with: - - # make install - -You can define a `PREFIX` to install it elsewhere: - - $ make install PREFIX="$HOME"/.local - -If you keep a list of your repository paths in a file like `~/.watch-git-tags`, -you could put this in a `crontab(5)` task to email you new tags: - - xargs watch-git-tags < ~/.watch-git-tags-repos - -License -------- - -Copyright (c) [Tom Ryder][1]. Distributed under an [MIT License][2]. - -[1]: https://sanctum.geek.nz/ -[2]: https://www.opensource.org/licenses/MIT diff --git a/README.md b/README.md new file mode 100644 index 0000000..87e8c7c --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +`watch-vcs-tags` +================ + +Scripts that given a list of repository roots as arguments look for new tags +available on remote systems, and report the repository name and a tab-indented +list of new tags, if any. + +Presently only `watch-git-tags` is implemented (well, published). This is all +implemented in POSIX `sh`, but does require a `mktemp(1)` implementation that +supports the `-d` option to create temporary directories. + + $ watch-git-tags ~/.local/src/ed/vim + /home/tom/.local/src/ed/vim + v8.0.0858 + +You can install it in `/usr/local/bin` with: + + # make install + +You can define a `PREFIX` to install it elsewhere: + + $ make install PREFIX="$HOME"/.local + +If you keep a list of your repository paths in a file like `~/.watch-git-tags`, +you could put this in a `crontab(5)` task to email you new tags: + + xargs watch-git-tags < ~/.watch-git-tags-repos + +License +------- + +Copyright (c) [Tom Ryder][1]. Distributed under an [MIT License][2]. + +[1]: https://sanctum.geek.nz/ +[2]: https://www.opensource.org/licenses/MIT -- cgit v1.2.3 From cfd5fc1168b45600e9b06424fed581ec91362ed2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:25:20 +1300 Subject: Use full option names for git commands --- watch-git-tags | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watch-git-tags b/watch-git-tags index 79e26d8..fd5b022 100755 --- a/watch-git-tags +++ b/watch-git-tags @@ -3,13 +3,13 @@ self=watch-git-tags # List sorted local tags lt() { - git tag -l | + git tag --list | LC_COLLATE=C sort } # List sorted remote tags rt() { - { git ls-remote -qt || + { git ls-remote --quiet --tags || printf >&2 'Failed to retrieve tags for repository %s\n' "$PWD" } | awk '!/\^\{\}$/{print substr($2,11)}' | LC_COLLATE=C sort -- cgit v1.2.3 From 0532d2aaa50b785bf359cece568fcca16cb35c5d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:25:41 +1300 Subject: Exclude peeled tags and pseudorefs --- watch-git-tags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watch-git-tags b/watch-git-tags index fd5b022..8ccc884 100755 --- a/watch-git-tags +++ b/watch-git-tags @@ -9,7 +9,7 @@ lt() { # List sorted remote tags rt() { - { git ls-remote --quiet --tags || + { git ls-remote --quiet --refs --tags || printf >&2 'Failed to retrieve tags for repository %s\n' "$PWD" } | awk '!/\^\{\}$/{print substr($2,11)}' | LC_COLLATE=C sort -- cgit v1.2.3 From 12afe9f8378c48b9c9e4255ad40ac8a39262db87 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:27:29 +1300 Subject: Simplify git-ls-remote output filtering --- watch-git-tags | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/watch-git-tags b/watch-git-tags index 8ccc884..f73994a 100755 --- a/watch-git-tags +++ b/watch-git-tags @@ -11,8 +11,7 @@ lt() { rt() { { git ls-remote --quiet --refs --tags || printf >&2 'Failed to retrieve tags for repository %s\n' "$PWD" - } | awk '!/\^\{\}$/{print substr($2,11)}' | - LC_COLLATE=C sort + } | cut -d/ -f3 | LC_COLLATE=C sort } # Create a temporary directory with name in $td, and handle POSIX-ish traps to -- cgit v1.2.3 From e63e4e296021cd986dd6ca057ef5a45476203927 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:27:43 +1300 Subject: Attempt to fetch all new tags after finding any This should ideally prevent notifying about the same tags repeatedly until they are manually fetched. This is a change in functionality, and should constitute a major version bump. --- watch-git-tags | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/watch-git-tags b/watch-git-tags index f73994a..af60664 100755 --- a/watch-git-tags +++ b/watch-git-tags @@ -53,6 +53,12 @@ for repo ; do ( # Write new tags to file LC_COLLATE=C comm -13 -- [ab] > new + # Attempt to quietly fetch new tags so that we don't notify about the same + # ones next time + if [ -s new ] ; then + git fetch --quiet --tags + fi + ) & done # Wait for each of those to finish -- cgit v1.2.3 From 0ebd8c7bff3cf4fbc3d472414bb474dd81ed3a2c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:30:02 +1300 Subject: Add a usage hint to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 87e8c7c..6ebecd1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ you could put this in a `crontab(5)` task to email you new tags: xargs watch-git-tags < ~/.watch-git-tags-repos +Another option is to watch all repositories in a specific directory: + + watch-git-tags "$HOME"/.local/src/watch/* + License ------- -- cgit v1.2.3 From 40b2bf77949f23643f45f533ddb7c6dd0557725f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 10:30:24 +1300 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 227cea2..4a36342 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +3.0.0 -- cgit v1.2.3