From 8dbd23372f3dabdee8d285fe32aef9bc698d053c Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 16 Jun 2022 18:45:46 +0200 Subject: [PATCH] style.fish: Just ask for uncommitted changes I keep some files around that I don't *want* to commit or ignore, but it's fine to restyle them. It's also fine to restyle everything if you are about to commit something because then it'll be committed in the correct style. --- build_tools/style.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build_tools/style.fish b/build_tools/style.fish index ea720ecbf..cff0c8ea8 100755 --- a/build_tools/style.fish +++ b/build_tools/style.fish @@ -23,9 +23,11 @@ if test $all = yes set -l files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//') if set -q files[1] echo - echo You have uncommitted changes. Cowardly refusing to restyle the entire code base. - echo - exit 1 + echo 'You have uncommitted changes. Are you sure you want to restyle?' + read -P 'y/N? ' -n1 -l ans + if not string match -qi "y" -- $ans + exit 1 + end end set c_files src/*.h src/*.cpp src/*.c set fish_files share/**.fish