public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 9/9] libxfs-apply: don't add duplicate headers
Date: Mon, 23 Nov 2020 16:24:33 -0800	[thread overview]
Message-ID: <20201124002433.GA31219@magnolia> (raw)
In-Reply-To: <8adce075-983b-2b3f-eb3c-10eb72bccf0c@sandeen.net>

On Mon, Nov 23, 2020 at 02:30:58PM -0600, Eric Sandeen wrote:
> On 11/10/20 12:04 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > When we're backporting patches from libxfs, don't add a S-o-b header if
> > there's already one in the patch being ported.
> 
> I guess the goal here is to not add 2 identical sign offs in a row.
> 
> But when I do the libxfs-application, I do feel like it should add
> my SOB as sort of a chain of custody record before I commit it to a
> new tree/project, no?
> 
> So could this be modified to simply not add 2 identical SOBs in a row?
> 
> Maybe we can just run "uniq" on the $_hdr.new file?

Not sure how uniq gets us to "not add 2 identical signoffs in a row" but
changing the last line of add_header to:

tail -n 1 "$hdrfile" | grep -q "^${hdr}$" || echo "$hdr" >> "$hdrfile"

would do it.

--D

> Thanks,
> -Eric
> 
> 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  tools/libxfs-apply |   14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> > 
> > 
> > diff --git a/tools/libxfs-apply b/tools/libxfs-apply
> > index 3258272d6189..35cdb9c3449b 100755
> > --- a/tools/libxfs-apply
> > +++ b/tools/libxfs-apply
> > @@ -193,6 +193,14 @@ filter_xfsprogs_patch()
> >  	rm -f $_libxfs_files
> >  }
> >  
> > +add_header()
> > +{
> > +	local hdr="$1"
> > +	local hdrfile="$2"
> > +
> > +	grep -q "^${hdr}$" "$hdrfile" || echo "$hdr" >> "$hdrfile"
> > +}
> > +
> >  fixup_header_format()
> >  {
> >  	local _source=$1
> > @@ -280,13 +288,13 @@ fixup_header_format()
> >  	sed -i '${/^[[:space:]]*$/d;}' $_hdr.new
> >  
> >  	# Add Signed-off-by: header if specified
> > -	if [ ! -z ${SIGNED_OFF_BY+x} ]; then 
> > -		echo "Signed-off-by: $SIGNED_OFF_BY" >> $_hdr.new
> > +	if [ ! -z ${SIGNED_OFF_BY+x} ]; then
> > +		add_header "Signed-off-by: $SIGNED_OFF_BY" $_hdr.new
> >  	else	# get it from git config if present
> >  		SOB_NAME=`git config --get user.name`
> >  		SOB_EMAIL=`git config --get user.email`
> >  		if [ ! -z ${SOB_NAME+x} ]; then
> > -			echo "Signed-off-by: $SOB_NAME <$SOB_EMAIL>" >> $_hdr.new
> > +			add_header "Signed-off-by: $SOB_NAME <$SOB_EMAIL>" $_hdr.new
> >  		fi
> >  	fi
> >  
> > 

      reply	other threads:[~2020-11-24  1:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 18:03 [PATCH v2 0/9] xfsprogs: fixes for 5.10 Darrick J. Wong
2020-11-10 18:03 ` [PATCH 1/9] mkfs: allow users to specify rtinherit=0 Darrick J. Wong
2020-11-10 18:03 ` [PATCH 2/9] mkfs: clarify valid "inherit" option values Darrick J. Wong
2020-11-10 18:36   ` Christoph Hellwig
2020-11-10 18:03 ` [PATCH 3/9] mkfs: don't pass on extent size inherit flags when extent size is zero Darrick J. Wong
2020-11-10 18:37   ` Christoph Hellwig
2020-11-10 18:03 ` [PATCH 4/9] xfs: remove unnecessary parameter from scrub_scan_estimate_blocks Darrick J. Wong
2020-11-10 18:03 ` [PATCH 5/9] xfs_db: report ranges of invalid rt blocks Darrick J. Wong
2020-11-10 18:03 ` [PATCH 6/9] xfs_repair: skip the rmap and refcount btree checks when the levels are garbage Darrick J. Wong
2020-11-10 18:03 ` [PATCH 7/9] xfs_repair: correctly detect partially written extents Darrick J. Wong
2020-11-10 18:03 ` [PATCH 8/9] xfs_repair: directly compare refcount records Darrick J. Wong
2020-11-10 18:37   ` Christoph Hellwig
2020-11-10 18:04 ` [PATCH 9/9] libxfs-apply: don't add duplicate headers Darrick J. Wong
2020-11-10 18:37   ` Christoph Hellwig
2020-11-23 20:30   ` Eric Sandeen
2020-11-24  0:24     ` Darrick J. Wong [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=20201124002433.GA31219@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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