zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: helper script for making ChangeLog entries
Date: Wed,  3 Dec 2014 17:16:55 +0100	[thread overview]
Message-ID: <1417623415-7042-1-git-send-email-mikachu@gmail.com> (raw)

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


             reply	other threads:[~2014-12-03 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 16:16 Mikael Magnusson [this message]
2014-12-03 21:10 ` Bart Schaefer
2014-12-05 18:43 ` Frank Terbeck
2015-04-17 13:53 ` Daniel Shahaf

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=1417623415-7042-1-git-send-email-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.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.
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).