From 02797af27b120ec40d69c08da98363fe1baa40ec Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 15 Aug 2020 15:25:31 +0000 Subject: [PATCH] Add flgrep to grep tracked files in a Fossil repo --- zshrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zshrc b/zshrc index baa5ad9..8542f37 100644 --- a/zshrc +++ b/zshrc @@ -225,6 +225,15 @@ if which fossil &>/dev/null; then fi } + flgrep() { + local ret=1 + fossil changes --all | sed 's/^.* //' | while read file; do + grep -H "$@" "$file" && ret=0 + [ $? -gt 1 ] && return $? + done + return $ret + } + git2fl() { local gitdir=$(git rev-parse --show-toplevel)/.git local repo=$(fossil info | awk '/^repository:/ { print $2 }')