Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
helper script for making ChangeLog entries
- X-seq: zsh-workers 33835
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: helper script for making ChangeLog entries
- Date: Wed,  3 Dec 2014 17:16:55 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20120113;        h=from:to:subject:date:message-id;        bh=oMPXYIt4wVbp4Q/+x4oQDCbgs5AwU1Y3tPdKC9nV9ok=;        b=tDb1B1UOV6SFZN/bXVueGt0IMGmt6QUMZVmatFRsc1nLuxUtp5A6G5xyK60djKUzxL         U/bOngV/Jwr8091EHUlq4kgzikPnVL88dXwKJXd5/0vImYVkPKTylNhZmjDSb06Ks5lK         73X6MWuWbgpik526bU5jzu3q7dTZZKLdvACURiltgcjCVpQ+1pt5eatgxXsnbsasUmqN         ToFzQ0jCEGxfEcTIrkxw72FIUbssBCroq9BvMjsgKzGXUd8rLnhu5+D31XBTUOJsz+6K         It4h4P6wOdCUSuhdDCt2zlF8GZBUFoqH7GmIQBxrntdIEaOoEUd4SgsBODGKArOXPy70         BaBw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I got a bit tired of constructing these manually, not sure how you guys
do it but here's my script for it.
% gen-zsh-cl-entry HEAD
2014-12-03  Mikael Magnusson  <mikachu@xxxxxxxxx>
	* Eric Cook: 33689: Completion/Unix/Command/_cp: make cp
	--reflink's argument optional
% gen-zsh-cl-entry :/33712:
2014-12-03  Oliver Kiddle  <opk@xxxxxxx>
	* saga: 33712: Completion/Debian/Command/_apt: add --auto-remove
	option
You have to commit your changes first (with --author=someoneelse'
<their@email>' if needed), either prepend the X-Seq to the start of
the commit message, or specify it as the second argument to this script
(but then the commit message still won't have it).
You still need to copy and paste the output into ChangeLog and update
the commit (if it's the top commit, git add ChangeLog; git commit --amend
-C HEAD)
#!/bin/zsh
if > /dev/null git rev-parse --quiet --verify $1; then
  if [[ -z $2 ]]; then
    2=$(git show -s --pretty=format:%s $1)
    3=${2#*:}
    2=${2%%:*}
  else
    3=\ $(git show -s --pretty=format:%s $1)
  fi
  cminfo=(${(0)"$(git show -s --pretty=format:%an%x00%cn%x00%ce $1)"})
  author=$cminfo[1]
  committer=$cminfo[2]
  cmmail=$cminfo[3]
  if [[ "$author" != "$committer" ]]; then
    2="$author: $2"
  fi
  zmodload zsh/datetime
  strftime "%Y-%m-%d  $committer  <$cmmail>" $EPOCHSECONDS
  echo $'\n\t* '$2: ${(j:, :)${(f)"$(git diff --name-only $1\^!|grep -v ChangeLog)"}}:$3|fmt
else
  echo >&2 "You need to pass a valid commit, you may also pass an X-seq"
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author