== Dev Week -- Writing Crisp Changelogs -- coolbhavi -- Thu, 3rd Feb, 2012 == {{{#!irc [17:00] Hi all I am Bhavani Shankar a 24 year old ubuntu developer from India [17:00] I am going to take you through what is meant by a changelog in general and how to write effective changelogs in the ubuntu sphere [17:01] Before we start off please download a package (totem for instance) and when we navigate through the source tree we find files named ChangeLog, NEWS, et.al [17:01] So lets start :) [17:01] == Meaning of a changelog == [17:01] A changelog is nothing but a log or record of changes made to a project or a software [17:02] == The basic funda behind a Changelog == [17:02] Naming convention of a changelog file generally is a txt file with a name as ChangeLog [17:02] Sometimes its also called by CHANGES or HISTORY [17:02] (It may be brought to notice that sometimes some packages/software have a file called NEWS is usually a different file reflecting changes between releases, not between the commits) [17:03] Some Version control systems are able to generate the relevant information that is suited as a changelog. [17:03] == General Format of a changelog file == [17:03] Most changelog files follow the following format [17:03] YYYY-MM-DD Joe Hacker [17:03] * myfile.ext (myfunction): my changes made [17:03] additional changes [17:03] * myfile.ext (unrelated_change): my changes made [17:03] to myfile.ext but completely unrelated to the above [17:03] * anotherfile.ext (somefunction): more changes [17:04] (These files are generally organised by paragraphs defining a unique change wrt a function or a file) [17:04] More on changelogs and changelog formats here: http://www.gnu.org/prep/standards/html_node/Change-Logs.html [17:05] ok now moving on, [17:05] == Ubuntu and Changelogs == [17:05] The changelog file pertaining to a Ubuntu package is stored in the debian directory under the name changelog according to debian policy [17:05] Debian policy defines its changelog to be in this format: [17:05] package (version) distribution(s); urgency=urgency [17:05] [optional blank line(s), stripped] [17:05] * change details [17:05] more change details [17:05] [blank line(s), included in output of dpkg-parsechangelog] [17:06] * even more change details [17:06] [optional blank line(s), stripped] [17:06] -- maintainer name [two spaces] date [17:06] In particular, The date has the following format: [17:06] day-of-week, dd month yyyy hh:mm:ss +zzzz [17:07] which is got by running the date -R command in a terminal [17:07] where: [17:07] day-of week is one of: Mon, Tue, Wed, Thu, Fri, Sat, Sun [17:07] dd is a one- or two-digit day of the month (01-31) [17:07] month is one of: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec [17:07] yyyy is the four-digit year (e.g. 2012) [17:07] hh is the two-digit hour (00-23) [17:07] mm is the two-digit minutes (00-59) [17:07] ss is the two-digit seconds (00-60) [17:07] +zzzz or -zzzz is the the time zone offset from Coordinated Universal Time (UTC). "+" indicates that the time is ahead of (i.e., east of) UTC and "-" indicates that the time is behind (i.e., west of) UTC. The first two digits indicate the hour difference from UTC and the last two digits indicate the number of additional minutes difference from UTC. The last two digits must be in the range 00-59. [17:08] It can be worth mentioning here that the entire changelog must be coded in UTF-8 (normally taken care by dch command) [17:09] for more info on the dch command please see man dch [17:10] More explanation on the fields of the changelog file here: http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog [17:10] Now moving on further [17:10] == Do's and Donts == [17:11] QUESTION: When are changelogs used, and who is responsible for putting them in. also, where are they placed? [17:14] kanliot, changelogs are used as a log for tracking changes in projects or software usually the project maintainers write the changelogs its usually placed in the source tree under the name ChangeLog with a txt extension normally and in debian/ubuntu the package chanelogs are placed in debian/changelog [17:14] so moving on with do's and donts [17:15] The purpose of writing a changelog generally is to make sure you document all the changes and history in a most readable n understandable manner :) [17:15] Below are few points to effective changelog writing [17:15] Fewer Assumptions: Try to make lesser assumptions about a particular user knowing something about a particular package so it ll help bringing out better detail and understandability [17:16] Start with the easiest part first and push the more complex/more technical part at the end to make it a interesting read [17:16] Grouping: Group the common stuff and related changes under a heading called summary to make it easier to understand [17:16] Whitespaces: Give appropriate whitespaces to make a clean looking formatted changelog [17:17] Summarising: Adding a one line summary of the change at the top makes the reader to get a overview of what the change is meant to be [17:17] Closing the bugs via changelog while submitting a patch to a bug for sponsor review [17:17] last but not the least, spellchecks! [17:18] The following link gives few examples of debian/changelog writing http://pastebin.com/kQHazZ8y [17:19] Please Remember that changelog writing becomes easy by practice! [17:19] Sorry for hurrying the session up due to 30 min time slot [17:20] There are 10 minutes remaining in the current session. [17:20] Please feel free to ask any questions on the same [17:24] QUESTION ARE you going to go into the actual command to generate the changelogs? [17:25] There are 5 minutes remaining in the current session. [17:26] after you type the changelog debuild will use dpkg-parsechangelog and dpkg-genchanges to generate a changes file [17:26] QUESTION: are the * - and + in that example file just arbitrary bullet points or do they have a special meaning in changelogs? [17:27] the bullet points are used for distinguishing between the main summary of changes and a detailed description for formatting [17:28] QUESTION: Sometimes my changelog sentence become too log for 1 line. What is the best way to solve it? [17:28] wrap up the line to be around 80 charecters [17:28] QUESTION: ​ Should you create changelogs before or after you merge changes into a repo? [17:29] after doing the changes before merging the same its always preferable to document changes [17:30] Thanks all of you for turning up :) Please feel free to hang out at #ubuntu-motu or #ubuntu-devel for any questions. [17:30] You can also catch me up on bhavi@ubuntu.com or facebook.com/bshankar [17:30] Thanks all again! }}}