public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org
Subject: Re: [PATCH v2] Add script to get modified pages for commit msgs
Date: Mon, 16 Nov 2020 21:27:07 +0100	[thread overview]
Message-ID: <1e43d7f8-f512-c7fa-3e1a-455a3bb292ea@gmail.com> (raw)
In-Reply-To: <20201116194218.5098-1-alx.manpages@gmail.com>

Hi ALex,

On 11/16/20 8:42 PM, Alejandro Colomar wrote:
> The script can be used this way:
> 
> git commit -sm "$(./scripts/modified_pages.sh): Short commit msg"
> 
> And then maybe --amend and add a longer message.
> 
> This is especially useful for changes to many pages at once,
> usually when running a script to apply some global changes.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  scripts/modified_pages.sh | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100755 scripts/modified_pages.sh
> 
> diff --git a/scripts/modified_pages.sh b/scripts/modified_pages.sh
> new file mode 100755
> index 000000000..f6c4a6cea
> --- /dev/null
> +++ b/scripts/modified_pages.sh
> @@ -0,0 +1,34 @@
> +#!/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/^, //"

Thanks. Patch applied!

Cheers,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

      reply	other threads:[~2020-11-16 20:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 23:08 [PATCH] Add script to get modified pages for commit msgs Alejandro Colomar
2020-11-16  0:16 ` [PATCH v2] " Alejandro Colomar
2020-11-16  0:46   ` Alejandro Colomar (man-pages)
2020-11-16  8:07   ` Michael Kerrisk (man-pages)
2020-11-16 19:42     ` Alejandro Colomar
2020-11-16 20:27       ` Michael Kerrisk (man-pages) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e43d7f8-f512-c7fa-3e1a-455a3bb292ea@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox