Patchwork [3/3] scripts/send-pull-request: allow sending of patches without a cover letter

login
register
mail settings
Submitter Otavio Salvador
Date Dec. 8, 2011, 3:40 p.m.
Message ID <abe8db681be0a2ec0ada964957236a5f0511d746.1323358819.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/16525/
State Accepted
Commit 326ef69d1296cd35a86d1eaee0741e6fc956af52
Headers show

Comments

Otavio Salvador - Dec. 8, 2011, 3:40 p.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 scripts/send-pull-request |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
Darren Hart - Dec. 9, 2011, 7:18 p.m.
On 12/08/2011 07:40 AM, Otavio Salvador wrote:

Hi Otavio,

Please provide a commit log body.

http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Headers_and_Commit_Messages


> +else
> +	echo "WARNING: No cover letter will be send."

s/send/sent/


Otherwise looks reasonable.
Khem Raj - Dec. 9, 2011, 7:34 p.m.
On Thu, Dec 8, 2011 at 7:40 AM, Otavio Salvador <otavio@ossystems.com.br> wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  scripts/send-pull-request |   21 ++++++++++++---------
>  1 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/scripts/send-pull-request b/scripts/send-pull-request
> index be13009..8d51ce2 100755
> --- a/scripts/send-pull-request
> +++ b/scripts/send-pull-request
> @@ -108,15 +108,18 @@ fi
>
>
>  # Verify the cover letter is complete and free of tokens
> -CL="$PDIR/0000-cover-letter.patch"
> -for TOKEN in SUBJECT BLURB; do
> -       grep -q "*** $TOKEN HERE ***" "$CL"
> -       if [ $? -eq 0 ]; then
> -               echo "ERROR: Please edit $CL and try again (Look for '*** $TOKEN HERE ***')."
> -               exit 1
> -       fi
> -done
> -
> +if [ -e $PDIR/0000-cover-letter.patch ]; then
> +       CL="$PDIR/0000-cover-letter.patch"
> +       for TOKEN in SUBJECT BLURB; do
> +               grep -q "*** $TOKEN HERE ***" "$CL"
> +               if [ $? -eq 0 ]; then
> +                       echo "ERROR: Please edit $CL and try again (Look for '*** $TOKEN HERE ***')."
> +                       exit 1
> +               fi
> +       done
> +else
> +       echo "WARNING: No cover letter will be send."
> +fi
>
>  # Harvest emails from the generated patches and populate AUTO_CC.
>  if [ $AUTO_CL -eq 1 ]; then
> --
> 1.7.2.5
>
>


why do you want to avoid cover letter ? or is it for other layers
other than oe-core
Otavio Salvador - Dec. 9, 2011, 7:36 p.m.
On Fri, Dec 9, 2011 at 17:34, Khem Raj <raj.khem@gmail.com> wrote:

> why do you want to avoid cover letter ? or is it for other layers
> other than oe-core
>

When it is a single patch makes no sense to send a cover letter that most
of time we just write the same of first commit.
Darren Hart - Dec. 9, 2011, 7:45 p.m.
On 12/09/2011 11:36 AM, Otavio Salvador wrote:
> On Fri, Dec 9, 2011 at 17:34, Khem Raj <raj.khem@gmail.com
> <mailto:raj.khem@gmail.com>> wrote:
> 
>     why do you want to avoid cover letter ? or is it for other layers
>     other than oe-core
> 
> 
> When it is a single patch makes no sense to send a cover letter that
> most of time we just write the same of first commit.

Well, you could just use git-send-email when there is only 1 patch. I
had considered having the tool create only a single email if there was
only 1 patch. However, in the end, I just send the cover letter with the
pull requrest and let the single patch follow. It works fine and is
consistent with the other patches, even if it is a degenerate case.

So I don't think this is necessary really, but if it works for you and
doesn't get abused, I'm fine with it. Perhaps only allowing this if
there is indeed only 1 patch would be better.
Khem Raj - Dec. 9, 2011, 7:48 p.m.
On Fri, Dec 9, 2011 at 11:45 AM, Darren Hart <dvhart@linux.intel.com> wrote:
> On 12/09/2011 11:36 AM, Otavio Salvador wrote:
>> On Fri, Dec 9, 2011 at 17:34, Khem Raj <raj.khem@gmail.com
>> <mailto:raj.khem@gmail.com>> wrote:
>>
>>     why do you want to avoid cover letter ? or is it for other layers
>>     other than oe-core
>>
>>
>> When it is a single patch makes no sense to send a cover letter that
>> most of time we just write the same of first commit.
>
> Well, you could just use git-send-email when there is only 1 patch.

right

 I
> had considered having the tool create only a single email if there was
> only 1 patch. However, in the end, I just send the cover letter with the
> pull requrest and let the single patch follow. It works fine and is
> consistent with the other patches, even if it is a degenerate case.
>
> So I don't think this is necessary really, but if it works for you and
> doesn't get abused, I'm fine with it. Perhaps only allowing this if
> there is indeed only 1 patch would be better.

if its possible it will happen abuse that is
Richard Purdie - Dec. 10, 2011, 12:07 a.m.
On Fri, 2011-12-09 at 11:18 -0800, Darren Hart wrote:
> On 12/08/2011 07:40 AM, Otavio Salvador wrote:
> 
> Hi Otavio,
> 
> Please provide a commit log body.
> 
> http://wiki.openembedded.org/index.php/Commit_Patch_Message_Guidelines#Patch_Headers_and_Commit_Messages
> 
> 
> > +else
> > +	echo "WARNING: No cover letter will be send."
> 
> s/send/sent/
> 
> 
> Otherwise looks reasonable.

Hmm, this has just merged with the typo, sorry (it had been around a
while with no comments). Can someone sent a follow up please?

Cheers,

Richard
Otavio Salvador - Dec. 10, 2011, 3:51 p.m.
On Fri, Dec 9, 2011 at 22:07, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> Hmm, this has just merged with the typo, sorry (it had been around a
> while with no comments). Can someone sent a follow up please?
>

I will send a patch fixing it.

Patch

diff --git a/scripts/send-pull-request b/scripts/send-pull-request
index be13009..8d51ce2 100755
--- a/scripts/send-pull-request
+++ b/scripts/send-pull-request
@@ -108,15 +108,18 @@  fi
 
 
 # Verify the cover letter is complete and free of tokens
-CL="$PDIR/0000-cover-letter.patch"
-for TOKEN in SUBJECT BLURB; do
-	grep -q "*** $TOKEN HERE ***" "$CL"
-	if [ $? -eq 0 ]; then
-		echo "ERROR: Please edit $CL and try again (Look for '*** $TOKEN HERE ***')."
-		exit 1
-	fi
-done
-
+if [ -e $PDIR/0000-cover-letter.patch ]; then
+	CL="$PDIR/0000-cover-letter.patch"
+	for TOKEN in SUBJECT BLURB; do
+		grep -q "*** $TOKEN HERE ***" "$CL"
+		if [ $? -eq 0 ]; then
+			echo "ERROR: Please edit $CL and try again (Look for '*** $TOKEN HERE ***')."
+			exit 1
+		fi
+	done
+else
+	echo "WARNING: No cover letter will be send."
+fi
 
 # Harvest emails from the generated patches and populate AUTO_CC.
 if [ $AUTO_CL -eq 1 ]; then