Add get-tags and count-tags scripts
All checks were successful
/ check (push) Successful in 1m38s

Add `get-tags` and `count-tags` scripts to get and count Git tags within
a repository, including the ability to filter tags - e.g. only get or
count tags that begin with a certain date.
This commit is contained in:
Oliver Davies 2025-07-11 12:28:42 +01:00
parent 559d5239c5
commit adfe90c99b
5 changed files with 39 additions and 0 deletions

View file

@ -38,7 +38,9 @@
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
count-tags
create-script create-script
get-tags
tag-release tag-release
time-until time-until
update-all-git-repos update-all-git-repos

View file

@ -99,8 +99,10 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
backup-websites backup-websites
build-glove80 build-glove80
count-tags
create-script create-script
displayselect displayselect
get-tags
qrencode qrencode
mounter mounter
move-firefox-screenshots move-firefox-screenshots

14
packages/count-tags.nix Executable file
View file

@ -0,0 +1,14 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "count-tags";
runtimeInputs = with pkgs; [
coreutils
get-tags
];
text = ''
get-tags "''${1:-}" | wc -l
'';
}

View file

@ -9,9 +9,11 @@ in
_timer = callPackage ./_timer.nix { }; _timer = callPackage ./_timer.nix { };
backup-websites = callPackage ./backup-websites.nix { }; backup-websites = callPackage ./backup-websites.nix { };
build-glove80 = callPackage ./build-glove80.nix { }; build-glove80 = callPackage ./build-glove80.nix { };
count-tags = callPackage ./count-tags.nix { };
create-script = callPackage ./create-script.nix { }; create-script = callPackage ./create-script.nix { };
dev-commit = callPackage ./dev-commit.nix { }; dev-commit = callPackage ./dev-commit.nix { };
displayselect = callPackage ./displayselect { }; displayselect = callPackage ./displayselect { };
get-tags = callPackage ./get-tags.nix { };
git-graph = callPackage ./git-graph.nix { }; git-graph = callPackage ./git-graph.nix { };
mounter = callPackage ./mounter.nix { }; mounter = callPackage ./mounter.nix { };
move-firefox-screenshots = callPackage ./move-firefox-screenshots.nix { }; move-firefox-screenshots = callPackage ./move-firefox-screenshots.nix { };

19
packages/get-tags.nix Executable file
View file

@ -0,0 +1,19 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "get-tags";
runtimeInputs = with pkgs; [
git
unixtools.column
];
text = ''
if [[ "$#" -gt 0 ]]; then
git tag | grep "$*"
exit 0
fi
git tag
'';
}