From: Siraaj Khandkar Date: Fri, 13 Nov 2020 22:12:30 +0000 (-0500) Subject: Fix git-description help msg and improve variables X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=a87e65be8d672b6d881099acd2e7779334b03dc6;p=khome.git Fix git-description help msg and improve variables --- diff --git a/home/bin/git-description b/home/bin/git-description index 710336b..14085bc 100755 --- a/home/bin/git-description +++ b/home/bin/git-description @@ -7,7 +7,7 @@ cmd="$1" remote="$2" usage() { - printf "Usage: %s [push|pull] REMOTE\n" "$exe" + printf "Usage: %s (push|pull) REMOTE\n" "$exe" exit 1 } @@ -21,11 +21,12 @@ case "$remote" in *) ;; esac +file='description' remote_url=$(git remote get-url "$remote") -remote_file="${remote_url}/description" -local_file='.git/description' +remote_path="${remote_url}/${file}" +local_path=".git/${file}" case "$cmd" in - push) scp "$local_file" "$remote_file";; - pull) scp "$remote_file" "$local_file";; + push) scp "$local_path" "$remote_path";; + pull) scp "$remote_path" "$local_path";; esac