zsh-workers
 help / color / mirror / code / Atom feed
* helper script for making ChangeLog entries
@ 2014-12-03 16:16 Mikael Magnusson
  2014-12-03 21:10 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mikael Magnusson @ 2014-12-03 16:16 UTC (permalink / raw)
  To: zsh-workers

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@gmail.com>

	* Eric Cook: 33689: Completion/Unix/Command/_cp: make cp
	--reflink's argument optional

% gen-zsh-cl-entry :/33712:
2014-12-03  Oliver Kiddle  <opk@zsh.org>

	* 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-17 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03 16:16 helper script for making ChangeLog entries Mikael Magnusson
2014-12-03 21:10 ` Bart Schaefer
2014-12-05 18:43 ` Frank Terbeck
2015-04-17 13:53 ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).