]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
scripts/bash_aliases: duffman(): Add function to diff all modified pages
authorAlejandro Colomar <alx@kernel.org>
Mon, 25 Nov 2024 15:14:34 +0000 (16:14 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 26 Nov 2024 10:22:51 +0000 (11:22 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
scripts/bash_aliases

index 967a69efea5c33de19a3f76eca873c6af37cf681..ff8f754d3627374278aa93b61ebe3fde3fdb0e96 100644 (file)
@@ -100,3 +100,23 @@ man_gitstaged()
        |tr -d '\n'                                                     \
        |sed 's/, $//';
 }
+
+# diff all modified pages against the system ones.
+
+duffman()
+{
+       cd $(git rev-parse --show-toplevel);
+
+       git diff --name-only \
+       | grep -E \
+          '(\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>|\.man)+(\.man|\.in)*$' \
+       | sortman \
+       | while read f; do \
+               local sys="$(basename "$f")";
+
+               diffman "$sys" "$f";
+       done \
+       | less -R;
+
+       cd -;
+}