From bf919d880d44b82ebad62fa5435328476017296a Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Thu, 8 Jan 2026 18:16:04 -0500 Subject: [PATCH] more helpful warning (not error) message; clean msg --- README.rst | 3 +++ completions/templates/README.rst.in | 3 +++ git-remote-gcrypt | 11 ++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 1753636..9ea108a 100644 --- a/README.rst +++ b/README.rst @@ -276,6 +276,9 @@ To scan for unencrypted files in a remote gcrypt repo, use:: git-remote-gcrypt clean [url|remote] +.. warning:: + The clean command is unstable and subject to deprecation or renaming and should not be used in scripts. + If no URL or remote is specified, ``git-remote-gcrypt`` will list all available ``gcrypt::`` remotes. diff --git a/completions/templates/README.rst.in b/completions/templates/README.rst.in index 1753636..9ea108a 100644 --- a/completions/templates/README.rst.in +++ b/completions/templates/README.rst.in @@ -276,6 +276,9 @@ To scan for unencrypted files in a remote gcrypt repo, use:: git-remote-gcrypt clean [url|remote] +.. warning:: + The clean command is unstable and subject to deprecation or renaming and should not be used in scripts. + If no URL or remote is specified, ``git-remote-gcrypt`` will list all available ``gcrypt::`` remotes. diff --git a/git-remote-gcrypt b/git-remote-gcrypt index d6ab253..2cd848d 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -227,17 +227,18 @@ resolve_url() { local cmd="$1" if [ -z "$URL" ]; then local remotes - remotes=$(git remote -v | grep 'gcrypt::' || :) + remotes=$(git remote -v || :) echo "Usage: git-remote-gcrypt $cmd [URL|REMOTE]" >&2 if [ -n "$remotes" ]; then - echo "Error: No URL or remote specified. Available gcrypt remotes:" >&2 + echo "No URL or remote specified. Available remotes:" >&2 echo "$remotes" | sed 's/^/ /' >&2 + exit 0 else - echo "Error: No gcrypt remotes found and no URL/remote specified." >&2 + echo "Error: No remotes found and no URL/remote specified." >&2 + exit 1 fi - exit 1 fi - + # If it's not a URL, try to resolve as a remote name if ! echo "$URL" | grep -q -E '://|::' || [ -n "${URL##*/*}" ]; then local potential_url -- 2.52.0