public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Aron Griffis <agriffis@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Proper commit messages
Date: Mon, 15 Aug 2005 10:03:17 -0400	[thread overview]
Message-ID: <20050815140317.GA12239@olive.flatmonk> (raw)
In-Reply-To: <20050809113618.GC31594@unixforces.net>

[-- Attachment #1: Type: text/plain, Size: 1954 bytes --]

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


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2005-08-16  1:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 20:44 [gentoo-dev] Proper commit messages Ciaran McCreesh
2005-08-09 11:36 ` Markus Rothe
2005-08-09 11:55   ` Simon Stelling
2005-08-09 12:40     ` Diego 'Flameeyes' Pettenò
2005-08-09 12:04   ` Stephen Bennett
2005-08-09 12:23     ` Markus Rothe
2005-08-09 12:47       ` Ciaran McCreesh
2005-08-09 12:59         ` Markus Rothe
2005-08-09 19:07         ` Jonathan Smith
2005-08-09 19:22           ` Ciaran McCreesh
2005-08-09 20:56             ` Henrik Brix Andersen
2005-08-09 22:54             ` Tuan Van
2005-08-09 23:31               ` [gentoo-dev] " Arnaud Launay
2005-08-09 23:38                 ` LostSon
2005-08-09 23:40                 ` Ciaran McCreesh
2005-08-09 23:48                   ` Mike Frysinger
2005-08-10  8:03                     ` Alin Nastac
2005-08-10 21:46                       ` Dice R. Random
2005-08-11 16:16                     ` Drake Wyrm
2005-08-09 23:47                 ` Mike Frysinger
2005-08-15 14:03   ` Aron Griffis [this message]

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=20050815140317.GA12239@olive.flatmonk \
    --to=agriffis@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox