[git-buildpackage] How to generate changelog completely from the beginning of git history

Guido Günther agx at sigxcpu.org
Fri Mar 16 13:02:00 CET 2018


On Fri, Mar 16, 2018 at 01:41:11PM +0200, Kirill Shestakov wrote:
> Hi!
> I wonder is there a way to generate debian changelog using gbp dch
> completely from the beginning of git history? E.g. there is a repo with
> tags like 0.1, 0.2, 0.3 etc. And a changelog section for every release
> is needed.
> If there was an option to select an arbitrary end commit instead of
> hardcoded HEAD, it would be possible to do:
> 
> #!/bin/bash
> prev=$first_commit
> for tag in 0.1 0.2 0.3; do
>       gpb dch --since $prev --to $tag --new-version $tag
>       prev=$tag
> done
> 
> Doing git checkout $tag in cycle to set new HEAD did not work for me and
> I got "gbp:error: Currently not on a branch". Selecting an end commit
> with (e.g. "--git-log=0.4") did not work for me either:

A git checkout from a tag (or rather an arbitrary sha1) should work:

$ git co HEAD^
Note: checking out 'HEAD^'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at f1b878c9 tests: enable unittests without devscripts
$ gbp dch -R -a 
gbp:info: Found tag for topmost changelog version '9edc7d870a28c8336dbcfc4047e947e112916b37'
...

If you're not using gbp 0.9.7 you should ;)
 -- Guido

> 
> $ gbp dch --new-version="0.4" --since 0.3 --git-log="0.4" gbp:error: Dch
> failed: debchange: warning:     debian/changelog(l1): version 'VERSION'
> is invalid: version number does not start with digit LINE: my-project
> (VERSION) UNRELEASED; urgency=medium debchange: error: unknown is not a
> valid version
> 
> I look forward to your reply.
> Best regards,
> Kirill
> _______________________________________________
> git-buildpackage mailing list
> git-buildpackage at lists.sigxcpu.org
> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage


More information about the git-buildpackage mailing list