diff options
Diffstat (limited to 'watch-git-tags')
-rwxr-xr-x | watch-git-tags | 13 |
1 files changed, 9 insertions, 4 deletions
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 |