I'm trying to automate a deb package builder for a git repository, as part of which I want to get a bunch of commit comments (since the last package release) and put them into multiple comments in debian/changelog for the new release.I'm using dch batch mode like this:dch -v ${RELEASE_VER} --distribution stable commentbut that works only for one comment. If I run this multiple times, I get multiple version entries.The dch man page says:If the text of the change is given on the command line, debchange will run in batch mode and simply add the text, with line breaks as necessaryI'm not sure what it means with line breaks as necessary, but if the comment text passed as the first non-option parameter includes new lines, dch will remove new lines from the text and put it as a single comment.
Adding multiple comments to debchange in batch mode?
scripting;deb
dch is designed to work one comment at a time. When you're adding changes to the changelog, simply rundch -v ${RELEASE_VER} commentmultiple times (the -v ${RELEASE_VER} part is only necessary the first time). This will build up a list of changes with a header targeting UNRELEASED; that's the marker dch uses to decide that it should add new comments to the existing list, rather than starting a new block. Line breaks as necessary means that dch will wrap your single comment if it's too long.Once you've finished, ask dch to release the changelog with the appropriate distribution:dch -r --distribution stable ignoredThe ignored part is there so that dch won't open an editor for you to finalise the changelog. This will replace the UNRELEASED part with stable, and will update the footer (with the date and time).If all your packaging is in git, you might find gbp dch more appropriate (in git-buildpackage); it can build up a complete debian/changelog using commit messages.