Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

helper script for making ChangeLog entries



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