All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Submitting patches
Date: Mon, 26 Feb 2007 14:12:24 -0600	[thread overview]
Message-ID: <45E33F28.2040408@freescale.com> (raw)
In-Reply-To: <528646bc0702261206h69e69da4udf2698740c6676f5@mail.gmail.com>

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

  reply	other threads:[~2007-02-26 20:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=45E33F28.2040408@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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 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.