[Pm-utils] [PATCH 1/1] Generate ChangeLog on demand.

Victor Lowther victor.lowther at gmail.com
Thu Mar 6 16:55:00 PST 2008


On Thu, Mar 06, 2008 at 09:55:12AM -0800, Dan Nicholson wrote:
> On Wed, Mar 5, 2008 at 7:39 PM, Victor Lowther <victor.lowther at gmail.com> wrote:
> > Since git has very fast log creation aand we imported the entire revision
> >  history from CVS, we can generate ChangeLog on demand instead of having to
> >  track it.
> >
> >  Specifically, any make target that requires it (make dist, etc) will pull an
> >  appropriately-formatted changelog out of git.
> 
> I'm all for this, but I have a couple comments on the specifics.
> 
> >  +ChangeLog:
> >  +       @-git log --no-merges --topo-order > $@
> 
> 1. I'm using git-1.5.3.x and it doesn't have --topo-order. I also
> don't know when --no-merges was added.

--topo-order was added in the 1.5.4 series, apparently. Omitting it is
no big deal -- it just orders the changelog entries to reflect the
logical order they were applied in instead of being in strict reverse
chronological order.

I included --no-merges because most of my local workflow involves
approx. 1 branch per crazy idea or bugfix, and merging them into master
when I get ready to push chages upstream.  Getting rid of the switch is 
also not a problem, it will just introduce more noise into the ChangeLog.
 
> 2. You need to specify where the .git directory is so this will work
> when srcdir != builddir. If you have an up to date ChangeLog in the
> srcdir, you won't see this issue, but it does exist. So:
> 
>   git --git-dir=$(srcdir)/.git log ...
> 
> Newer git will manage to search up the directory chain to find a .git
> directory if builddir is a subdirectory of srcdir, but it's just safer
> to specify exactly where it is.

Good idea.  The version I end up pushing will have this change.

> 3. Please don't silence the make output. It only serves to make
> debugging issues more difficult. If people don't want to see the
> commands, they can just redirect to /dev/null.

OK.

> 4. We need to be smarter than using - for handling errors. It would
> really suck to end up with an empty ChangeLog in a released tarball.
> Personally, I would just drop the - and make it stop if the git-log
> failed for any reason. Here's what they do in Xorg, which is more
> robust, but may be overkill (this has come up repeatedly since they
> started generating the ChangeLog):
> 
> http://cgit.freedesktop.org/xorg/util/macros/tree/Makefile.am

That does seem a little baroque.  I think I will go with the "failure
kills the make" option for now. :)

> --
> Dan

-- 
Victor Lowther
Ubuntu Certified Professional


More information about the Pm-utils mailing list