fix last command by using a default number - notes - a console notes manager using git DIR Log DIR Files DIR Refs DIR Tags DIR LICENSE --- DIR commit f7e73487c7dd40d2589d1797bacfb023e57ae722 DIR parent 9e275119a1e5def852ee9cb71077f1908c1d128f HTML Author: Solene Rapenne <solene@perso.pw> Date: Tue, 25 Jun 2019 14:35:59 +0200 fix last command by using a default number Diffstat: M notes | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- DIR diff --git a/notes b/notes @@ -112,7 +112,15 @@ delete() { # display the list of edited files ordered by time last() { + cd "$REPO" + + if [ -n "$1" ]; then + limit="$1" + else + limit=10 + fi + git log --date=relative --name-only | \ awk ' /^commit / { @@ -140,7 +148,7 @@ last() { print date" "$0 } } - }' | head -n $1 + }' | head -n "$limit" exit 0 }