aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-30 10:30:30 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-30 10:30:30 +1300
commite098f48f2aaffcc43436fe9581e3a6c22d31026d (patch)
treee6e2dae40038cbe396f975b5b9360aad4e487791
parentMerge branch 'release/v2.0.0' (diff)
parentBump VERSION (diff)
downloadwatch-vcs-tags-e098f48f2aaffcc43436fe9581e3a6c22d31026d.tar.gz
watch-vcs-tags-e098f48f2aaffcc43436fe9581e3a6c22d31026d.zip
Merge branch 'release/v3.0.0'v3.0.0
* release/v3.0.0: Add a usage hint to README.md Attempt to fetch all new tags after finding any Simplify git-ls-remote output filtering Exclude peeled tags and pseudorefs Use full option names for git commands Rename README.markdown to README.md
-rw-r--r--README.md (renamed from README.markdown)4
-rw-r--r--VERSION2
-rwxr-xr-xwatch-git-tags13
3 files changed, 14 insertions, 5 deletions
diff --git a/README.markdown b/README.md
index 87e8c7c..6ebecd1 100644
--- a/README.markdown
+++ 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
-------
diff --git a/VERSION b/VERSION
index 227cea2..4a36342 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.0.0
+3.0.0
diff --git a/watch-git-tags b/watch-git-tags
index 79e26d8..af60664 100755
--- a/watch-git-tags
+++ b/watch-git-tags
@@ -3,16 +3,15 @@ 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 --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
@@ -54,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