dotfiles

:)
git clone https://git.sr.ht/~ashymad/dotfiles
Log | Files | Refs | Submodules | LICENSE

commit 04aab8e069c031a5e10dc644bc7be98483df18ce
parent 27334df2dd0934c7a165263ae602c98f3081bbe5
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Mon,  6 Jul 2026 23:47:13 +0200

Fix withenv wiht tail -r

Diffstat:
Mscripts/.local/bin/src-git | 8+++++---
Mscripts/.local/bin/withenv | 2+-
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/.local/bin/src-git b/scripts/.local/bin/src-git @@ -1,12 +1,14 @@ #!/bin/sh for dir in ~/.usr/src/*; do - tag="$(git -C "$dir" tag --points-at HEAD)" + [ -d "$dir"/.git ] || continue + + tag="$(git -C "$dir" tag --sort=creatordate --points-at HEAD | tail -1)" if [ -n "$tag" ]; then [ "$1" = "-u" ] && git -C "$dir" fetch --tags 2>/dev/null 1>&2 remote_tag="$(git -C "$dir" for-each-ref --sort=creatordate --format '%(refname)' refs/tags | cut -d/ -f3 | tail -1)" if [ "${tag#v}" != "${remote_tag#v}" ]; then - printf "%-15s %10s -> %-10s\n" "$(basename $dir)" "$tag" "$remote_tag" + printf "%-25s %10s -> %-10s\n" "$(basename $dir)" "$tag" "$remote_tag" fi else [ "$1" = "-u" ] && git -C "$dir" remote update 2>/dev/null 1>&2 @@ -18,7 +20,7 @@ for dir in ~/.usr/src/*; do if remote="$(git -C "$dir" rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)"; then commits="$(git -C "$dir" rev-list --left-only --count "$remote...@")" if [ "$commits" != 0 ]; then - printf "%-15s %10s ++ %-10s\n" "$(basename $dir)" "$branch" "$commits" + printf "%-25s %10s ++ %-10s\n" "$(basename $dir)" "$branch" "$commits" fi fi fi diff --git a/scripts/.local/bin/withenv b/scripts/.local/bin/withenv @@ -23,7 +23,7 @@ subst() { | awk '{print "SHA1SUM=" $1}'; \ } 3>&1 \ | $TAC \ - | xargs sh -c 'printf "%s\n" "${@}" | '$TAC' | env "$0" envsubst' -- + | xargs sh -c 'printf "%s\n" "${@}" | '"$TAC"' | env "$0" envsubst' -- } if [ "$IGNORE" = 1 ]; then