{"id":730,"date":"2009-06-25T11:44:41","date_gmt":"2009-06-25T10:44:41","guid":{"rendered":"http:\/\/cyberelk.net\/tim\/?p=730"},"modified":"2014-05-20T09:08:01","modified_gmt":"2014-05-20T08:08:01","slug":"generating-changelog-files-from-commit-logs","status":"publish","type":"post","link":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/","title":{"rendered":"Generating ChangeLog files from commit logs"},"content":{"rendered":"<p>I love <a href=\"http:\/\/git-scm.com\/\">git<\/a>, but I also loved <a href=\"http:\/\/www.gnu.org\/prep\/standards\/html_node\/Change-Logs.html\">ChangeLog<\/a> files and git is not so good at merging them.  For a while I played around with <a href=\"http:\/\/www.gnu.org\/software\/gnulib\/\">gnulib<\/a>&#8216;s <a href=\"https:\/\/cyberelk.net\/tim\/2008\/05\/29\/git-merge-changelog\/\">git-merge-changelog<\/a> which made merges really easy.  It worked fairly well, but now I&#8217;m bored of documenting my changes twice, both in the ChangeLog file and in the git commit log.<\/p>\n<p>The coreutils project has been creating its ChangeLog file from the git commit logs for a little while now, and I decided to take a look at how that&#8217;s done.  Now, at last, <a href=\"https:\/\/cyberelk.net\/tim\/software\/system-config-printer\/\">system-config-printer<\/a> can do that too.  Here is how it works.<\/p>\n<p><!--more--><\/p>\n<p>Step 1 happened a while ago, and that was to modify the style of my git commit log entries.  I now write a single line at the top giving a summary of the overall change (as before), so that I get nice output from tools that want to abbreviate the commit log to one line.  Then I leave a blank line, and below that my ChangeLog-style entry with no indentation.<\/p>\n<p>Firstly, the gitlog-to-changelog script from gnulib has been added to the repository.  This is the build tool Jim Meyering wrote which does all the work.<\/p>\n<p>Next, I renamed the ChangeLog file &#8220;ChangeLog-OLD&#8221;, because I&#8217;d like to keep that history around without any alterations.<\/p>\n<p>I use automake in system-config-printer, but it gets upset if there is no ChangeLog file.  To pacify it I modified the &#8220;bootstrap&#8221; script to create an empty ChangeLog file.  I added &#8220;\/ChangeLog&#8221; to the .gitignore file so that I don&#8217;t get continually told about this dummy file not being under revision control.<\/p>\n<p>Finally, to generate the ChangeLog file from git commit logs whenever a new release is built I added a &#8220;dist-hook&#8221; rule to the automake file, getting it to run the gitlog-to-changelog script.<\/p>\n<p>These changes were made on the 1.1.x branch.  The older 1.0.x branch still has a normal ChangeLog file in the source repository, and when changes are made on that branch and merged into 1.1.x the ChangeLog entries get merged into ChangeLog-OLD automatically (git is fantastic for merging changes across renamed files).<\/p>\n<p>The actual changes are <a href=\"http:\/\/git.fedorahosted.org\/git\/?p=system-config-printer.git;a=commitdiff;h=f9e28d0717a1ed408487f03bba8b20bb2f40e90e\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love git, but I also loved ChangeLog files and git is not so good at merging them. For a while I played around with gnulib&#8216;s git-merge-changelog which made merges really easy. It worked fairly well, but now I&#8217;m bored of documenting my changes twice, both in the ChangeLog file and in the git commit [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[53,96,50],"class_list":["post-730","post","type-post","status-publish","format-standard","hentry","category-software","tag-git","tag-software","tag-system-config-printer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Generating ChangeLog files from commit logs - PRINT HEAD<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generating ChangeLog files from commit logs - PRINT HEAD\" \/>\n<meta property=\"og:description\" content=\"I love git, but I also loved ChangeLog files and git is not so good at merging them. For a while I played around with gnulib&#8216;s git-merge-changelog which made merges really easy. It worked fairly well, but now I&#8217;m bored of documenting my changes twice, both in the ChangeLog file and in the git commit [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/\" \/>\n<meta property=\"og:site_name\" content=\"PRINT HEAD\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-25T10:44:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-05-20T08:08:01+00:00\" \/>\n<meta name=\"author\" content=\"Tim Waugh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tim Waugh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/\"},\"author\":{\"name\":\"Tim Waugh\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#\\\/schema\\\/person\\\/23b749f30a67f1b1c6af17024fc94bf6\"},\"headline\":\"Generating ChangeLog files from commit logs\",\"datePublished\":\"2009-06-25T10:44:41+00:00\",\"dateModified\":\"2014-05-20T08:08:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/\"},\"wordCount\":357,\"publisher\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#\\\/schema\\\/person\\\/23b749f30a67f1b1c6af17024fc94bf6\"},\"keywords\":[\"git\",\"Software\",\"system-config-printer\"],\"articleSection\":[\"Software\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/\",\"url\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/\",\"name\":\"Generating ChangeLog files from commit logs - PRINT HEAD\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#website\"},\"datePublished\":\"2009-06-25T10:44:41+00:00\",\"dateModified\":\"2014-05-20T08:08:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/2009\\\/06\\\/25\\\/generating-changelog-files-from-commit-logs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generating ChangeLog files from commit logs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#website\",\"url\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/\",\"name\":\"PRINT HEAD\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#\\\/schema\\\/person\\\/23b749f30a67f1b1c6af17024fc94bf6\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/#\\\/schema\\\/person\\\/23b749f30a67f1b1c6af17024fc94bf6\",\"name\":\"Tim Waugh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/printhead.png\",\"url\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/printhead.png\",\"contentUrl\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/printhead.png\",\"width\":731,\"height\":140,\"caption\":\"Tim Waugh\"},\"logo\":{\"@id\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/printhead.png\"},\"sameAs\":[\"http:\\\/\\\/cyberelk.net\\\/tim\"],\"url\":\"https:\\\/\\\/cyberelk.net\\\/tim\\\/author\\\/twaugh\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Generating ChangeLog files from commit logs - PRINT HEAD","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/","og_locale":"en_GB","og_type":"article","og_title":"Generating ChangeLog files from commit logs - PRINT HEAD","og_description":"I love git, but I also loved ChangeLog files and git is not so good at merging them. For a while I played around with gnulib&#8216;s git-merge-changelog which made merges really easy. It worked fairly well, but now I&#8217;m bored of documenting my changes twice, both in the ChangeLog file and in the git commit [&hellip;]","og_url":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/","og_site_name":"PRINT HEAD","article_published_time":"2009-06-25T10:44:41+00:00","article_modified_time":"2014-05-20T08:08:01+00:00","author":"Tim Waugh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tim Waugh","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/#article","isPartOf":{"@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/"},"author":{"name":"Tim Waugh","@id":"https:\/\/cyberelk.net\/tim\/#\/schema\/person\/23b749f30a67f1b1c6af17024fc94bf6"},"headline":"Generating ChangeLog files from commit logs","datePublished":"2009-06-25T10:44:41+00:00","dateModified":"2014-05-20T08:08:01+00:00","mainEntityOfPage":{"@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/"},"wordCount":357,"publisher":{"@id":"https:\/\/cyberelk.net\/tim\/#\/schema\/person\/23b749f30a67f1b1c6af17024fc94bf6"},"keywords":["git","Software","system-config-printer"],"articleSection":["Software"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/","url":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/","name":"Generating ChangeLog files from commit logs - PRINT HEAD","isPartOf":{"@id":"https:\/\/cyberelk.net\/tim\/#website"},"datePublished":"2009-06-25T10:44:41+00:00","dateModified":"2014-05-20T08:08:01+00:00","breadcrumb":{"@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cyberelk.net\/tim\/2009\/06\/25\/generating-changelog-files-from-commit-logs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cyberelk.net\/tim\/"},{"@type":"ListItem","position":2,"name":"Generating ChangeLog files from commit logs"}]},{"@type":"WebSite","@id":"https:\/\/cyberelk.net\/tim\/#website","url":"https:\/\/cyberelk.net\/tim\/","name":"PRINT HEAD","description":"","publisher":{"@id":"https:\/\/cyberelk.net\/tim\/#\/schema\/person\/23b749f30a67f1b1c6af17024fc94bf6"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cyberelk.net\/tim\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/cyberelk.net\/tim\/#\/schema\/person\/23b749f30a67f1b1c6af17024fc94bf6","name":"Tim Waugh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/cyberelk.net\/tim\/wp-content\/uploads\/2023\/01\/printhead.png","url":"https:\/\/cyberelk.net\/tim\/wp-content\/uploads\/2023\/01\/printhead.png","contentUrl":"https:\/\/cyberelk.net\/tim\/wp-content\/uploads\/2023\/01\/printhead.png","width":731,"height":140,"caption":"Tim Waugh"},"logo":{"@id":"https:\/\/cyberelk.net\/tim\/wp-content\/uploads\/2023\/01\/printhead.png"},"sameAs":["http:\/\/cyberelk.net\/tim"],"url":"https:\/\/cyberelk.net\/tim\/author\/twaugh\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pnnS2-bM","_links":{"self":[{"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/posts\/730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/comments?post=730"}],"version-history":[{"count":10,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/posts\/730\/revisions"}],"predecessor-version":[{"id":750,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/posts\/730\/revisions\/750"}],"wp:attachment":[{"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/media?parent=730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/categories?post=730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyberelk.net\/tim\/wp-json\/wp\/v2\/tags?post=730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}