aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
authorAlejandro Colomar <alx.manpages@gmail.com>2021-05-09 23:38:56 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-05-10 11:27:12 +1200
commitf493a71fe135f6283b02a1f7376bbded46447bbe (patch)
tree20706b03e3b263cb3dd4f8183363126fc4837980 /scripts
parentbacf09154d98166a0f2f72f72055bb18916d3493 (diff)
downloadman-pages-f493a71fe135f6283b02a1f7376bbded46447bbe.tar.gz
scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bash_aliases17
-rwxr-xr-xscripts/modified_pages.sh34
2 files changed, 16 insertions, 35 deletions
diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index a14c65cd40..8cedc4efc9 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
########################################################################
#
-# (C) Copyright 2021, Alejandro Colomar
+# (C) Copyright 2020, 2021, Alejandro Colomar
# These functions are free software; you can redistribute them and/or
# modify them under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2.
@@ -147,6 +147,21 @@ function pdfman()
xdg-open ${tmp};
}
+# man_gitstaged prints a list of all files with changes staged for commit
+# (basename only if the files are within <man?/>), separated by ", ".
+# Usage example: .../man-pages$ git commit -m "$(man_gitstaged): msg";
+
+function man_gitstaged()
+{
+ git status \
+ |sed "/Changes not staged for commit:/q" \
+ |grep -E "^\s*(modified|deleted|new file):" \
+ |sed "s/^.*:\s*/, /" \
+ |sed "s%man[1-9]/%%" \
+ |tr -d '\n' \
+ |sed "s/^, //"
+}
+
########################################################################
# Glibc
diff --git a/scripts/modified_pages.sh b/scripts/modified_pages.sh
deleted file mode 100755
index f6c4a6cea2..0000000000
--- a/scripts/modified_pages.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-## SPDX-License-Identifier: GPL-2.0-only
-########################################################################
-##
-## (C) Copyright 2020, Alejandro Colomar
-## This program is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License
-## as published by the Free Software Foundation; version 2.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details
-## (http://www.gnu.org/licenses/gpl-2.0.html).
-##
-########################################################################
-##
-## The output of this script is a
-## list of all files with changes staged for commit
-## (basename only if the files are within "man?/"),
-## separated by ", ".
-## Usage:
-## git commit -m "$(./scripts/modified_pages.sh): Short message here"
-##
-
-
-git status \
-|sed "/Changes not staged for commit:/q" \
-|grep -E "^\s*(modified|deleted|new file):" \
-|sed "s/^.*:\s*/, /" \
-|sed "s%man[1-9]/%%" \
-|tr -d '\n' \
-|sed "s/^, //"