Re: [gentoo-dev] Proper commit messages

2005-08-15 Thread Aron Griffis
Markus Rothe wrote: [Tue Aug 09 2005, 07:36:18AM EDT]
 Personaly I find it a little bit annoying to write changes twise.
 One time in Changelog and one time in --commitmsg. How about using
 the commitmsg for Changelog as default, but if a Changelog entry
 already exists, then write nothing to Changelog.

A few others have posted their solutions to this problem.  Perhaps
some people will find my solution useful, since it's a bit more
sophisticated.  I've been using this for literally years now with no
modifications.

- handles using editor for echangelog
- fixes spacing before re-using the message for cvs commit
- post-runs eviewcvs (for the sake of pasting into bugs)

# echangelog and repoman combined
er() {
  echangelog ${1:+$*} || return 1
  rc
}

# repoman commit with the message from the ChangeLog
rc() { 
  declare msg

  if [[ -n $* ]]; then
msg=$*
echo Using msg from command-line 2
  else
msg=$(perl ChangeLog -0777 -pe \
  's/^.*?\n  \d{2} \w{3} \d{4};.*?:\n//s || exit 1; # trim top
   s/\n(?:\*|  \d{2} \w{3} \d{4};).*//s;# trim bottom
   s/^\s*//; s/\s*$//; s/^(?:  |\t)//gm;# fix spacing
   #/^ /m || s/\s+/ /g;  # normalize spacing unless formatted
  ')
if [[ $? != 0 || -z $msg ]]; then
  echo couldn't parse message from ChangeLog 2
  return 1
fi
echo Parsed msg from ChangeLog 2
  fi

  echo -- 2
  echo $msg 2
  echo -- 2

  repoman commit -m $msg || return 1

  if [[ -x /usr/bin/eviewcvs ]]; then
local f entry=$(perl -00ne '/^  \d/ and print, last' ChangeLog)
entry=${entry%%:*}
entry=${entry##*}
entry=${entry//,/ }
for f in $entry; do
  [[ $f == -* ]]  continue
  f=${f#+}
  echo $f
done | xargs -n1 eviewcvs
  fi
}

Regards,
Aron

--
Aron Griffis
Gentoo Linux Developer



pgpwoTbgK9bLI.pgp
Description: PGP signature


Re: [gentoo-dev] Proper commit messages

2005-08-09 Thread Markus Rothe
Ciaran McCreesh wrote:
 If you're the sort that writes good ChangeLog messages anyway, there's
 nothing wrong with reusing them as the commit message. If you have a
 really really good reason for not using a ChangeLog message, or if you
 haven't yet written a shell alias for reusing ChangeLog messages for
 commits, you still need to come up with something for the commit
 message.

Personaly I find it a little bit annoying to write changes twise. One
time in Changelog and one time in --commitmsg. How about using the
commitmsg for Changelog as default, but if a Changelog entry already
exists, then write nothing to Changelog.

Regards,

Markus Rothe


pgpicx32SYWRw.pgp
Description: PGP signature


Re: [gentoo-dev] Proper commit messages

2005-08-09 Thread Stephen Bennett
On Tue, 9 Aug 2005 11:36:18 +
Markus Rothe [EMAIL PROTECTED] wrote:

 Personaly I find it a little bit annoying to write changes twise. One
 time in Changelog and one time in --commitmsg. How about using the
 commitmsg for Changelog as default, but if a Changelog entry already
 exists, then write nothing to Changelog.

I'm sure you can manage to write a bash function to call echangelog and
repoman commit with the same message.
-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] Proper commit messages

2005-08-09 Thread Markus Rothe
Stephen Bennett wrote:
 On Tue, 9 Aug 2005 11:36:18 +
 Markus Rothe [EMAIL PROTECTED] wrote:
 
  Personaly I find it a little bit annoying to write changes twise. One
  time in Changelog and one time in --commitmsg. How about using the
  commitmsg for Changelog as default, but if a Changelog entry already
  exists, then write nothing to Changelog.
 
 I'm sure you can manage to write a bash function to call echangelog and
 repoman commit with the same message.

Sure, I can and the other mail shows that it is *realy* simple, but why
should every dev write his own script, when this could be done once
for all?

Nevermind.. If I don't provide patches for repoman I shouldn't bitching
around! ;-)

Regards,

Markus Rothe


pgp5r0VEVkfRd.pgp
Description: PGP signature


Re: [gentoo-dev] Proper commit messages

2005-08-09 Thread Diego 'Flameeyes' Pettenò
On Tuesday 09 August 2005 13:55, Simon Stelling wrote:
 #!/bin/bash
 echangelog ${1}
 repoman scan
 repoman commit -m ${1}

Even simpler, as repoman commit abort in case of errors in repoman scan:

ecommit() {
echangelog $@
repoman commit -m $@
}

add that to your .bashrc.

I use it always:

ecommit Stable on amd64

and it's done :)
If something is bad, it stops me.
If the package is mine and I want to have it clear, repoman full before 
ecommit to be safe.

-- 
Diego Flameeyes Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)


pgpffOfZBG2kt.pgp
Description: PGP signature


Re: [gentoo-dev] Proper commit messages

2005-08-09 Thread Ciaran McCreesh
On Tue, 9 Aug 2005 12:23:20 + Markus Rothe [EMAIL PROTECTED]
wrote:
| Stephen Bennett wrote:
|  On Tue, 9 Aug 2005 11:36:18 +
|  Markus Rothe [EMAIL PROTECTED] wrote:
|  
|   Personaly I find it a little bit annoying to write changes twise.
|   One time in Changelog and one time in --commitmsg. How about
|   using the commitmsg for Changelog as default, but if a Changelog
|   entry already exists, then write nothing to Changelog.
|  
|  I'm sure you can manage to write a bash function to call echangelog
|  and repoman commit with the same message.
| 
| Sure, I can and the other mail shows that it is *realy* simple, but
| why should every dev write his own script, when this could be done
| once for all?

Isn't this one of those things that's best done on a per-dev basis?
It's so trivial there's no point shipping an app that does it --
reading the associated documentation would take longer than writing
your own. Plus that way you can incorporate personalised clever things
such as auto keyword messages for arch teams

-- 
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail: ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm



pgp2tHY5rV26E.pgp
Description: PGP signature