Hi Jonathan,
On Tue, Jul 20, 2010 at 04:30:31PM -0500, Jonathan Nieder wrote:
> Guido Günther wrote:
> 
> >  git-buildpackage (0.5.1) experimental; urgency=low
> >  .
> >    [ Jonathan Nieder ]
> >    * [a650ce3] Add prebuild hook Can be used to add an upstream changelog
> >      generated from the git repository to the build dir. (Closes: #587652)
> >  .
> >    [ Guido Günther ]
> >    * [9b8bc60] Bump standards version
> 
> Thanks!
> 
> Sorry about the poorly formatted log message.  Well, live and learn.
Thanks a lot for your patch! I tend to write things like:

    Terminate the first line of a commit message with a dot

    if it's a multiline commit. Don't terminate singe line commits that
    only containt the patch description.

to keep the description short. So I added a check if the second line
starts with a lowercase letter and moved things around a little bit.
Pushed to git.
Thanks a lot,
 -- Guido

> 
> diff --git a/git-dch b/git-dch
> index 501d1b9..8e33d31 100755
> --- a/git-dch
> +++ b/git-dch
> @@ -73,14 +73,28 @@ def spawn_dch(msg='', author=None, email=None, 
> newversion=False, version=None, r
>      system(cmd)
>  
>  
> +def ispunct(ch):
> +    return not ch.isalnum() and not ch.isspace()
> +
> +def punctuate_commit(msg):
> +    lines = msg.split('\n', 1)
> +    if len(lines) <= 1:
> +        return msg
> +    first, rest = lines
> +    if not rest:
> +        return msg
> +    if first and ispunct(first[-1]):
> +        return msg
> +    return "%s.\n%s" % (first, rest)
> +
>  def add_changelog_entry(msg, author, email):
> -    "add aa single changelog entry"
> -    spawn_dch(msg=msg, author=author, email=email)
> +    "add a single changelog entry"
> +    spawn_dch(msg=punctuate_commit(msg), author=author, email=email)
>  
>  
>  def add_changelog_section(msg, distribution, author=None, email=None, 
> version=None):
>      "add a new changelog section"
> -    spawn_dch(msg=msg, newversion= True, version=version, author=author, 
> email=email, distribution=distribution)
> +    spawn_dch(msg=punctuate_commit(msg), newversion= True, version=version, 
> author=author, email=email, distribution=distribution)
>  
>  
>  def fixup_trailer(repo, git_author=False):
> -- 
> 
> 



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to