All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Submitting patches
@ 2007-02-26 15:51 Matt Gessner
  2007-02-26 19:29 ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Gessner @ 2007-02-26 15:51 UTC (permalink / raw)
  To: u-boot

Hi, 

The README file doesn't cover how to submit patches for U-Boot using
git.
Is it as simple as just pulling the diffs out for each file and
submitting them?  Should I post separate patch files as attachments in
the same email?
I also didn't find anything on the www.denx.de site relating to this.

Any preference?

Thanks,

Matt Gessner

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

* [U-Boot-Users] Submitting patches
  2007-02-26 15:51 [U-Boot-Users] Submitting patches Matt Gessner
@ 2007-02-26 19:29 ` Timur Tabi
  2007-02-26 20:06   ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Timur Tabi @ 2007-02-26 19:29 UTC (permalink / raw)
  To: u-boot

Matt Gessner wrote:
> Hi, 
> 
> The README file doesn't cover how to submit patches for U-Boot using
> git.
> Is it as simple as just pulling the diffs out for each file and
> submitting them?  

Yes.  Use git-format-patch to make the patch, and git-send-email to send it to 
this list.  Make sure you add a changelog to the patch before emailing it.

Also, if the patch is under the purview of one of the CPU family maintainers, 
you should CC: him on it.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* [U-Boot-Users] Submitting patches
  2007-02-26 19:29 ` Timur Tabi
@ 2007-02-26 20:06   ` Grant Likely
  2007-02-26 20:12     ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2007-02-26 20:06 UTC (permalink / raw)
  To: u-boot

On 2/26/07, Timur Tabi <timur@freescale.com> wrote:
> Matt Gessner wrote:
> > Hi,
> >
> > The README file doesn't cover how to submit patches for U-Boot using
> > git.
> > Is it as simple as just pulling the diffs out for each file and
> > submitting them?
>
> Yes.  Use git-format-patch to make the patch, and git-send-email to send it to
> this list.  Make sure you add a changelog to the patch before emailing it.

I had a double take when I read this; I assume you're talking about
the commit log at the top of the patch file, and your not talking
about including modifications to the CHANGELOG file.  Correct?

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195

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

* [U-Boot-Users] Submitting patches
  2007-02-26 20:06   ` Grant Likely
@ 2007-02-26 20:12     ` Timur Tabi
  2007-02-26 20:50       ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Timur Tabi @ 2007-02-26 20:12 UTC (permalink / raw)
  To: u-boot

Grant Likely wrote:

> I had a double take when I read this; I assume you're talking about
> the commit log at the top of the patch file, and your not talking
> about including modifications to the CHANGELOG file.  Correct?

Yes, don't touch the CHANGELOG file - that gets automatically updated by WD. 
When you create the patch with git-format-patch, you need to edit that patchfile 
and insert a changelog description before sending it.

This script can make your life easier:

#!/bin/sh

CHANGELOG=git-changelog.txt
COMMENT=git-comment.txt

# Check to see if your version of git-diff supports --ignore-space-at-eol
if [ "`git-diff --ignore-space-at-eol --name-only -p HEAD | grep \"$usage: 
git-diff\"`" == "" ]
then
     IGNOREEOL=--ignore-space-at-eol
fi

function catfile()
{
     count=0
     while read line
     do
         let count++
         lines[$count]="$line"
     done < $1

     firstline=1
     lastline=$count

     while [ "${lines[$firstline]}" == "" ]
     do
         let firstline++
     done

     while [ "${lines[$lastline]}" == "" ]
     do
         let lastline--
     done

     i=$firstline
     while [ $i -le $lastline ]
     do
         echo "${lines[$i]}"
         let i++
     done
}

if [ "$1" == "" ]
then
	echo "Usage: $0 \"git-commit-comment-in-quotes\""
	exit
fi

echo "Commiting these files:"
FILES=`git-diff-index --name-only -p HEAD`

# We always update the index, because having it not updated is just confusing
git-update-index $FILES

ls -1 $FILES

# Also display a list of diffs with extra spaces
git-diff-index --check -p HEAD

echo "Ready?"
read line

git-commit -a -m "$1"

PATCHFILE=`git-format-patch -s $IGNOREEOL HEAD^ `

# If a changelog or comment file exists, then insert it

if [ -r $CHANGELOG -o -r $COMMENT ]
then
     rm -f /tmp/$PATCHFILE
     IFS=""

     while read line
     do
     	echo "$line" >> /tmp/$PATCHFILE
     	if [ "${line:0:9}" == "Subject: " ]
     	then
             if [ -r $CHANGELOG ]
             then
                 echo "" >> /tmp/$PATCHFILE
                 catfile $CHANGELOG >> /tmp/$PATCHFILE
             	echo "" >> /tmp/$PATCHFILE
             fi
     	fi
     	if [ "$line" == "---" ]
     	then
             if [ -r $COMMENT ]
             then
                 echo "" >> /tmp/$PATCHFILE
             	catfile $COMMENT >> /tmp/$PATCHFILE
             	echo "" >> /tmp/$PATCHFILE
             fi
     	fi
     done < $PATCHFILE

     mv -f /tmp/$PATCHFILE $PATCHFILE
fi

echo "Created patchfile $PATCHFILE"



-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* [U-Boot-Users] Submitting patches
  2007-02-26 20:12     ` Timur Tabi
@ 2007-02-26 20:50       ` Grant Likely
  2007-02-26 21:57         ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2007-02-26 20:50 UTC (permalink / raw)
  To: u-boot

On 2/26/07, Timur Tabi <timur@freescale.com> wrote:
> Grant Likely wrote:
>
> > I had a double take when I read this; I assume you're talking about
> > the commit log at the top of the patch file, and your not talking
> > about including modifications to the CHANGELOG file.  Correct?
>
> Yes, don't touch the CHANGELOG file - that gets automatically updated by WD.
> When you create the patch with git-format-patch, you need to edit that patchfile
> and insert a changelog description before sending it.

hehehe, that's a lot of work for a simple thing.  Drop the git-commit
-m flag and use -F instead to add the commit log from a file (or use
neither and git-commit will bring up an editor).  You can also use -s
to add your signoff line too.  Then the files generated by
git-format-patch will already include commit log will already be in
your patch file.

:-)

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195

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

* [U-Boot-Users] Submitting patches
  2007-02-26 20:50       ` Grant Likely
@ 2007-02-26 21:57         ` Timur Tabi
  2007-02-26 22:58           ` Grant Likely
  0 siblings, 1 reply; 8+ messages in thread
From: Timur Tabi @ 2007-02-26 21:57 UTC (permalink / raw)
  To: u-boot

Grant Likely wrote:

> hehehe, that's a lot of work for a simple thing.  Drop the git-commit
> -m flag and use -F instead to add the commit log from a file (or use
> neither and git-commit will bring up an editor). 

I haven't tried it, but according to the online help, -F sets the commit
*message*, which is the one-line text that becomes the subject line. 
git-commit.txt contains the block of text that appears above the "diff" line.

 > You can also use -s
> to add your signoff line too.  

I do use -s:

PATCHFILE=`git-format-patch -s $IGNOREEOL HEAD^ `

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* [U-Boot-Users] Submitting patches
  2007-02-26 21:57         ` Timur Tabi
@ 2007-02-26 22:58           ` Grant Likely
  2007-02-26 23:04             ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2007-02-26 22:58 UTC (permalink / raw)
  To: u-boot

On 2/26/07, Timur Tabi <timur@freescale.com> wrote:
> Grant Likely wrote:
>
> > hehehe, that's a lot of work for a simple thing.  Drop the git-commit
> > -m flag and use -F instead to add the commit log from a file (or use
> > neither and git-commit will bring up an editor).
>
> I haven't tried it, but according to the online help, -F sets the commit
> *message*, which is the one-line text that becomes the subject line.
> git-commit.txt contains the block of text that appears above the "diff" line.

Actually only the first line of the commit message becomes the subject
line.  Subsequent lines are the detail.

Typical convention for the commit message seems to be: 1 line summary;
1 blank line; detailed description; signed-off-by lines.  In fact,
when using the -m flag, you can add a detailed description too by
inserting carriage returns within the quotes.

For example:
$ git commit -m "This is the subject line
>
> This is detail line 1
> This is detail line 2
> This is detail line 3" -s
$

which gives:
$ git log HEAD~1..HEAD
commit 122b83871419754ee24e3d28a72a302958b7c3fa
Author: Grant Likely <grant.likely@secretlab.ca>
Date:   Mon Feb 26 15:53:35 2007 -0700

    This is the subject line

    This is detail line 1
    This is detail line 2
    This is detail line 3

    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
$

>
>  > You can also use -s
> > to add your signoff line too.
>
> I do use -s:
>
> PATCHFILE=`git-format-patch -s $IGNOREEOL HEAD^ `

That works too.  :-)

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195

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

* [U-Boot-Users] Submitting patches
  2007-02-26 22:58           ` Grant Likely
@ 2007-02-26 23:04             ` Timur Tabi
  0 siblings, 0 replies; 8+ messages in thread
From: Timur Tabi @ 2007-02-26 23:04 UTC (permalink / raw)
  To: u-boot

Grant Likely wrote:

> Actually only the first line of the commit message becomes the subject
> line.  Subsequent lines are the detail.

Well, I tested this crazy idea of yours, and you're right!

This will simplify my script file somewhat, but not a whole lot.  Thanks.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

end of thread, other threads:[~2007-02-26 23:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 15:51 [U-Boot-Users] Submitting patches Matt Gessner
2007-02-26 19:29 ` Timur Tabi
2007-02-26 20:06   ` Grant Likely
2007-02-26 20:12     ` Timur Tabi
2007-02-26 20:50       ` Grant Likely
2007-02-26 21:57         ` Timur Tabi
2007-02-26 22:58           ` Grant Likely
2007-02-26 23:04             ` Timur Tabi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.