linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: new libxfs-apply option for Signed-off-by: tag
@ 2017-05-11 19:35 Eric Sandeen
  2017-06-21 22:20 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2017-05-11 19:35 UTC (permalink / raw)
  To: linux-xfs

Technically when a maintainer moves a patch from another project,
they should add their Signed-off-by: tag.  Add an option to
libxfs-apply to make that easy when cross-porting libxfs
patches.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tools/libxfs-apply b/tools/libxfs-apply
index e7d7e0a..b594ccb 100755
--- a/tools/libxfs-apply
+++ b/tools/libxfs-apply
@@ -8,7 +8,7 @@ usage()
 	echo $*
 	echo
 	echo "Usage:"
-	echo "	libxfs-apply [--verbose] --source <repodir> --commit <commit_id>"
+	echo "	libxfs-apply [--verbose] --sob <name/email> --source <repodir> --commit <commit_id>"
 	echo "	libxfs-apply --patch <patchfile>"
 	echo
 	echo "libxfs-apply should be run in the destination git repository."
@@ -73,6 +73,7 @@ while [ $# -gt 0 ]; do
 	--source)	REPO=$2 ; shift ;;
 	--patch)	PATCH=$2; shift ;;
 	--commit)	COMMIT_ID=$2 ; shift ;;
+	--sob)		SIGNED_OFF_BY=$2 ; shift ;;
 	--verbose)	VERBOSE=true ;;
 	*)		usage ;;
 	esac
@@ -274,6 +275,14 @@ fixup_header_format()
 			print $0
 		}' > $_hdr.new
 
+	# Remove the last line if it contains only whitespace
+	sed -i '${/^ *$/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
+	fi
+
 	# now output the new patch
 	cat $_hdr.new $_diff
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfsprogs: new libxfs-apply option for Signed-off-by: tag
  2017-05-11 19:35 [PATCH] xfsprogs: new libxfs-apply option for Signed-off-by: tag Eric Sandeen
@ 2017-06-21 22:20 ` Darrick J. Wong
  2017-06-21 22:23   ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2017-06-21 22:20 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Thu, May 11, 2017 at 02:35:43PM -0500, Eric Sandeen wrote:
> Technically when a maintainer moves a patch from another project,
> they should add their Signed-off-by: tag.  Add an option to
> libxfs-apply to make that easy when cross-porting libxfs
> patches.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/tools/libxfs-apply b/tools/libxfs-apply
> index e7d7e0a..b594ccb 100755
> --- a/tools/libxfs-apply
> +++ b/tools/libxfs-apply
> @@ -8,7 +8,7 @@ usage()
>  	echo $*
>  	echo
>  	echo "Usage:"
> -	echo "	libxfs-apply [--verbose] --source <repodir> --commit <commit_id>"
> +	echo "	libxfs-apply [--verbose] --sob <name/email> --source <repodir> --commit <commit_id>"
>  	echo "	libxfs-apply --patch <patchfile>"
>  	echo
>  	echo "libxfs-apply should be run in the destination git repository."
> @@ -73,6 +73,7 @@ while [ $# -gt 0 ]; do
>  	--source)	REPO=$2 ; shift ;;
>  	--patch)	PATCH=$2; shift ;;
>  	--commit)	COMMIT_ID=$2 ; shift ;;
> +	--sob)		SIGNED_OFF_BY=$2 ; shift ;;

I wonder, under what circumstances does the user /not/ want to have
their S-o-b added to the commit?  It seems to me that this ought to be
the default, since the $maintainer is importing code from another
libxfs, which (to me anyway) doesn't seem all that different from
pulling in regular patches from the mailing list or wherever.

Second, can we just pull the name and email from the output of git
config --get user.{name,email} unless the user explicitly provided a sob
line?

>  	--verbose)	VERBOSE=true ;;
>  	*)		usage ;;
>  	esac
> @@ -274,6 +275,14 @@ fixup_header_format()
>  			print $0
>  		}' > $_hdr.new
>  
> +	# Remove the last line if it contains only whitespace
> +	sed -i '${/^ *$/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
> +	fi

Third, we could detect that the patch already has the particular S-o-b
that we'd be adding here, and avoid adding a duplicate.

--D

> +
>  	# now output the new patch
>  	cat $_hdr.new $_diff
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfsprogs: new libxfs-apply option for Signed-off-by: tag
  2017-06-21 22:20 ` Darrick J. Wong
@ 2017-06-21 22:23   ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2017-06-21 22:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On 6/21/17 5:20 PM, Darrick J. Wong wrote:
> On Thu, May 11, 2017 at 02:35:43PM -0500, Eric Sandeen wrote:
>> Technically when a maintainer moves a patch from another project,
>> they should add their Signed-off-by: tag.  Add an option to
>> libxfs-apply to make that easy when cross-porting libxfs
>> patches.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/tools/libxfs-apply b/tools/libxfs-apply
>> index e7d7e0a..b594ccb 100755
>> --- a/tools/libxfs-apply
>> +++ b/tools/libxfs-apply
>> @@ -8,7 +8,7 @@ usage()
>>  	echo $*
>>  	echo
>>  	echo "Usage:"
>> -	echo "	libxfs-apply [--verbose] --source <repodir> --commit <commit_id>"
>> +	echo "	libxfs-apply [--verbose] --sob <name/email> --source <repodir> --commit <commit_id>"
>>  	echo "	libxfs-apply --patch <patchfile>"
>>  	echo
>>  	echo "libxfs-apply should be run in the destination git repository."
>> @@ -73,6 +73,7 @@ while [ $# -gt 0 ]; do
>>  	--source)	REPO=$2 ; shift ;;
>>  	--patch)	PATCH=$2; shift ;;
>>  	--commit)	COMMIT_ID=$2 ; shift ;;
>> +	--sob)		SIGNED_OFF_BY=$2 ; shift ;;
> 
> I wonder, under what circumstances does the user /not/ want to have
> their S-o-b added to the commit?  It seems to me that this ought to be
> the default, since the $maintainer is importing code from another
> libxfs, which (to me anyway) doesn't seem all that different from
> pulling in regular patches from the mailing list or wherever.
> 
> Second, can we just pull the name and email from the output of git
> config --get user.{name,email} unless the user explicitly provided a sob
> line?

<shakes fist>

yes that's a good idea :)

>>  	--verbose)	VERBOSE=true ;;
>>  	*)		usage ;;
>>  	esac
>> @@ -274,6 +275,14 @@ fixup_header_format()
>>  			print $0
>>  		}' > $_hdr.new
>>  
>> +	# Remove the last line if it contains only whitespace
>> +	sed -i '${/^ *$/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
>> +	fi
> 
> Third, we could detect that the patch already has the particular S-o-b
> that we'd be adding here, and avoid adding a duplicate.

hm.  well, I /always/ add mine at the end when I merge it.  So even if
it's like this in the kernel:

Signed-off-by: Bob
Reviewed-by: Alice

if Bob commits it to userspace, I'd still suggest that 
we should end up with:

Signed-off-by: Bob
Reviewed-by: Alice
Signed-off-by: Bob

because it got moved again...

> --D
> 
>> +
>>  	# now output the new patch
>>  	cat $_hdr.new $_diff
>>  
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-21 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11 19:35 [PATCH] xfsprogs: new libxfs-apply option for Signed-off-by: tag Eric Sandeen
2017-06-21 22:20 ` Darrick J. Wong
2017-06-21 22:23   ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).