dot

packages and services management
Log | Files | Refs | README

commit 73b02e8a086e18ee8645a3651610a4ed18304da9
parent 8e655d823f55360bbe3c1f7c3becc1918c0448cc
Author: josuah <mail@josuah.net>
Date:   Thu, 29 Dec 2016 18:10:53 +0100

fixed diff listing

Diffstat:
M.local/bin/version | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/.local/bin/version b/.local/bin/version @@ -153,14 +153,13 @@ makediff() tracediff() { [ -d "$3/.version" ] || die "no .version dir in $3" + revision="${1:-$( + tail -n 2 "$3/.version/history" | sed 1q + )}" # get all changes since "$1" revisions="$(cat "$3/.version/history")$NL" - revisions="${revisions##*${1:-$( - sed -n '$ p' "$3/.version/history" - )}$NL}" - - printf '%s\n' "$revisions" + revisions="${revisions##*$revision$NL}" # generate a diff of every revision with next one prev="$revision" @@ -174,20 +173,21 @@ tracediff() main() { + root="$(root)" case "$1" in ( i | init ) [ $# -ne 1 ] && usage - init "$(root)" + init "$root" ;; ( n | new ) [ $# -ne 1 ] && usage - new "$(root)" + new "$root" ;; ( d | diff ) [ $# -gt 2 ] && [ ! -f ".version/$1" ] || [ $# -eq 3 ] && [ ! -f ".version/$2" ] || [ $# -gt 3 ] && usage - tracediff "$2" "$3" "$(root)" + tracediff "$2" "$3" "$root" ;; ( l | list ) [ $# -gt 1 ] && usage