index.html.haml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. ---
  2. description: Keep a Changelog
  3. title: Keep a Changelog
  4. language: en
  5. version: 0.3.0
  6. ---
  7. :markdown
  8. # Keep a CHANGELOG
  9. ## Don’t let your friends dump git logs into CHANGELOGs™
  10. Version **#{current_page.metadata[:page][:version]}**
  11. ### What’s a change log?
  12. A change log is a file which contains a curated, chronologically ordered
  13. list of notable changes for each version of a project.
  14. %pre.changelog= File.read("CHANGELOG.md")
  15. :markdown
  16. ### What’s the point of a change log?
  17. To make it easier for users and contributors to see precisely what
  18. notable changes have been made between each release (or version) of the project.
  19. ### Why should I care?
  20. Because software tools are for people. If you don’t care, why are
  21. you contributing to open source? Surely, there must be a kernel (ha!)
  22. of care somewhere in that lovely little brain of yours.
  23. I [talked with Adam Stacoviak and Jerod Santo on The Changelog][thechangelog]
  24. (fitting, right?) podcast about why maintainers and
  25. contributors should care, and the motivations behind this project.
  26. If you can spare the time (1:06), it’s a good listen.
  27. ### What makes a good change log?
  28. I’m glad you asked.
  29. A good change log sticks to these principles:
  30. - It’s made for humans, not machines, so legibility is crucial.
  31. - Easy to link to any section (hence Markdown over plain text).
  32. - One sub-section per version.
  33. - List releases in reverse-chronological order (newest on top).
  34. - Write all dates in `YYYY-MM-DD` format. (Example: `2012-06-02` for `June 2nd, 2012`.) It’s international, [sensible](http://xkcd.com/1179/), and language-independent.
  35. - Explicitly mention whether the project follows [Semantic Versioning][semver].
  36. - Each version should:
  37. - List its release date in the above format.
  38. - Group changes to describe their impact on the project, as follows:
  39. - `Added` for new features.
  40. - `Changed` for changes in existing functionality.
  41. - `Deprecated` for once-stable features removed in upcoming releases.
  42. - `Removed` for deprecated features removed in this release.
  43. - `Fixed` for any bug fixes.
  44. - `Security` to invite users to upgrade in case of vulnerabilities.
  45. ### How can I minimize the effort required?
  46. Always have an `"Unreleased"` section at the top for keeping track of any
  47. changes.
  48. This serves two purposes:
  49. - People can see what changes they might expect in upcoming releases
  50. - At release time, you just have to change `"Unreleased"` to the version number
  51. and add a new `"Unreleased"` header at the top.
  52. ### What makes unicorns cry?
  53. Alright…let’s get into it.
  54. - **Dumping a diff of commit logs.** Just don’t do that, you’re helping nobody.
  55. - **Not emphasizing deprecations.** When people upgrade from one version to
  56. another, it should be painfully clear when something will break.
  57. - **Dates in region-specific formats.** In the U.S., people put the month first
  58. ("06-02-2012" for June 2nd, 2012, which makes *no* sense), while many people
  59. in the rest of the world write a robotic-looking "2 June 2012", yet pronounce
  60. it differently. "2012-06-02" works logically from largest to smallest, doesn't
  61. overlap in ambiguous ways with other date formats, and is an
  62. [ISO standard](http://www.iso.org/iso/home/standards/iso8601.htm). Thus, it
  63. is the recommended date format for change logs.
  64. There’s more. Help me collect those unicorn tears by
  65. [opening an issue][issues]
  66. or a pull request.
  67. ### Is there a standard change log format?
  68. Sadly, no. Calm down. I know you're furiously rushing to find that link
  69. to the GNU change log style guide, or the two-paragraph GNU NEWS file
  70. "guideline". The GNU style guide is a nice start but it is sadly naive.
  71. There's nothing wrong with being naive but when people need
  72. guidance it's rarely very helpful. Especially when there are many
  73. situations and edge cases to deal with.
  74. This project [contains what I hope will become a better CHANGELOG file convention][CHANGELOG].
  75. I don't think the status quo is good enough, and I think that as a community we
  76. can come up with better conventions if we try to extract good practices from
  77. real software projects. Please take a look around and remember that
  78. [discussions and suggestions for improvements are welcome][issues]!
  79. ### What should the change log file be named?
  80. Well, if you can’t tell from the example above, `CHANGELOG.md` is the
  81. best convention so far.
  82. Some projects also use `HISTORY.txt`, `HISTORY.md`, `History.md`, `NEWS.txt`,
  83. `NEWS.md`, `News.txt`, `RELEASES.txt`, `RELEASE.md`, `releases.md`, etc.
  84. It’s a mess. All these names only makes it harder for people to find it.
  85. ### Why can’t people just use a `git log` diff?
  86. Because log diffs are full of noise — by nature. They could not make a suitable
  87. change log even in a hypothetical project run by perfect humans who never make
  88. typos, never forget to commit new files, never miss any part of a refactoring.
  89. The purpose of a commit is to document one atomic step in the process by which
  90. the code evolves from one state to another. The purpose of a change log is to
  91. document the noteworthy differences between these states.
  92. As is the difference between good comments and the code itself,
  93. so is the difference between a change log and the commit log:
  94. one describes the *why*, the other the how.
  95. ### Can change logs be automatically parsed?
  96. It’s difficult, because people follow wildly different formats and file names.
  97. [Vandamme][vandamme] is a Ruby gem
  98. created by the [Gemnasium][gemnasium] team and which parses
  99. many (but not all) open source project change logs.
  100. ### Why do you alternate between spelling it "CHANGELOG" and "change log"?
  101. "CHANGELOG" is the name of the file itself. It's a bit shouty but it's a
  102. historical convention followed by many open source projects. Other
  103. examples of similar files include [`README`][README], [`LICENSE`][LICENSE],
  104. and [`CONTRIBUTING`][CONTRIBUTING].
  105. The uppercase naming (which in old operating systems made these files stick
  106. to the top) is used to draw attention to them. Since they're important
  107. metadata about the project, they could be useful to anyone intending to use
  108. or contribute to it, much like [open source project badges][shields].
  109. When I refer to a "change log", I'm talking about the function of this
  110. file: to log changes.
  111. ### What about yanked releases?
  112. Yanked releases are versions that had to be pulled because of a serious
  113. bug or security issue. Often these versions don't even appear in change
  114. logs. They should. This is how you should display them:
  115. `## 0.0.5 - 2014-12-13 [YANKED]`
  116. The `[YANKED]` tag is loud for a reason. It's important for people to
  117. notice it. Since it's surrounded by brackets it's also easier to parse
  118. programmatically.
  119. ### Should you ever rewrite a change log?
  120. Sure. There are always good reasons to improve a change log. I regularly open
  121. pull requests to add missing releases to open source projects with unmaintained
  122. change logs.
  123. It's also possible you may discover that you forgot to address a breaking change
  124. in the notes for a version. It's obviously important for you to update your
  125. change log in this case.
  126. ### How can I contribute?
  127. This document is not the **truth**; it’s my carefully considered
  128. opinion, along with information and examples I gathered.
  129. Although I provide an actual [CHANGELOG][] on [the GitHub repo][gh],
  130. I have purposefully not created a proper *release* or clear list of rules
  131. to follow (as [SemVer.org][semver] does, for instance).
  132. This is because I want our community to reach a consensus. I believe the
  133. discussion is as important as the end result.
  134. So please [**pitch in**][gh].
  135. [CHANGELOG]: https://github.com/olivierlacan/keep-a-changelog/blob/master/CHANGELOG.md
  136. [CONTRIBUTING]: https://github.com/olivierlacan/keep-a-changelog/blob/master/CONTRIBUTING.md
  137. [LICENSE]: https://github.com/olivierlacan/keep-a-changelog/blob/master/LICENSE
  138. [README]: https://github.com/olivierlacan/keep-a-changelog/blob/master/README.md
  139. [gemnasium]: https://gemnasium.com/
  140. [gh]: https://github.com/olivierlacan/keep-a-changelog
  141. [issues]: https://github.com/olivierlacan/keep-a-changelog/issues
  142. [semver]: http://semver.org/
  143. [shields]: http://shields.io/
  144. [thechangelog]: http://5by5.tv/changelog/127
  145. [vandamme]: https://github.com/tech-angels/vandamme/