Sunday, August 21, 2005

Manual ChangeLogs; a thing of the past?

If you have ever examined the source distribution of an open source project, you'll probably have noticed a ChangeLog file. This file lists, in good detail, all changes done to the source code in reverse order, giving their description, the name of the affected files and the name of the author who did the change. So far, so good. But I really think that these files, or better said, the way they are written and managed, is flawed. Let's see why:

ChangeLogs are written and controlled by hand. That is: you do a set of changes to the project and then proceed to write an entry that lists the files you modified and why you did so. Some tools, like GNU Emacs, provide hooks to simplify their writing, but, in the end, it is the software developer who ends up taking care of them manually. This is not really a problem when the project does not use a version control system (VCS, for short) to store its source code, because in this case, there is no other way to keep track of the changes.

But when you add a decent VCS to the mix (one that has, at the very least, changesets), such as Subversion or Monotone, things get much worse. Worse because the information you have in the ChangeLog is duplicated: once in the file and once in the revision history stored in the VCS. Not to mention that the latter is much more accurate than the former and is automatically managed by the system; e.g., you only need to write the purpose of your changes and it will associate it to the files you changed.

However, all has to be said: ChangeLogs are useful, but in the context of distribution files. E.g., when a user downloads a tar.gz file, he will want the list of changes to be included in it, because he may not be able to (or not want to) use an specific VCS to read it.

What I'm trying to emphasize here is that maintaining a ChangeLog by hand when you use a VCS system is not a good idea, and something you shouldn't need to do. Ideally, you'd generate it from the revision history in the VCS (AFAIK, Subversion can do it). E.g., before publishing a new release, you'd ask the VCS to build a ChangeLog based on the changes from version 0.1 and 0.2, stick it into your distribution file and release it. Your users could be happy and you didn't have to maintain it manually. Things get more complex when you have branches in between, but the VCS should be clever enough to generate a ChangeLog that details what happened to the source code; doing it by hand in this case can be painful.

Now, to the rants. I guess ChangeLogs were originated when there weren't (free) VCS systems available, because authors needed to document the changes between versions of their software. Then, when CVS appeared, things didn't get better because of its lack of changesets. That is, when a change is committed to the repository, its history is spread over all affected files, so you have no way to know which files were modified in a single commit — unless you take note of it in the ChangeLog.

I believe it is time to start throwing away ChangeLogs (in the traditional concept) at the same time you abandon CVS, by generating them in an automated fashion when publishing new releases. Development will be easier because you'll have something less to care about. But, of course, this is just my personal opinion.

11 comments:

  1. [Originally posted at 2005-08-21 11:16 pm UTC]

    code leaks. not everyone gets access to websvn or webcvs. sometimes, all you
    have is the .tgz. -To know that there is some review of what happened, when, in a single place but you can't see it.. can't think of anything worse.

    ChangeLog is not perfect, but it does add value.

    ReplyDelete
  2. [Originally posted at 2005-08-22 08:26 am UTC]

    In the cases were "all you have is the .tgz", I agree that having the ChangeLog is useful. This is, most likely, when you publish releases or snapshots of your development tree (as I outlined in the original post).

    ReplyDelete
  3. [Originally posted at 2005-08-22 03:09 am UTC]

    While they may be technically outdated by decent VCS, software licenses may still require a list of changes made - see GPL #2a.

    Also, personally, I'm a friend of manually "condensed" changes files which only state "major/important" changes as in GNU "NEWS" files.


    - Hubert

    ReplyDelete
  4. [Originally posted at 2005-08-22 08:31 am UTC]

    Hmm... it has passed so much time since I read the GPL that I didn't remember this detail.

    BTW, I also like the NEWS files; and, to me, these are much more useful than ChangeLogs. Pity that lots of projects out there do not manage them correctly, or not care about them at all. (This is something I described in the "Writing package-friendly software" article ;)

    ReplyDelete
  5. [Originally posted at 2005-08-22 06:59 am UTC]

    Yes, I prefer automated ways to generate the changelog from the VCS.

    But notice Changelog has been since... RCS? So I bet it was manually created because it wasn't a perl script suitable to do so like rcs2log.

    I'd like changelog files to see what's new (just because most developers don't use NEWS file in the right way), and I don't think people will start to not using them.

    Juanjo

    ReplyDelete
  6. [Originally posted at 2005-08-22 08:36 am UTC]

    I think I heard once about this script. Does it work for individual files or can it also extract information from CVS repositories (simulating changesets)?

    ReplyDelete
  7. [Originally posted at 2005-08-22 09:31 am UTC]

    AFAIK is uses RCS files, so it should use CVS respository files.

    I noticed this tool first time in OpenBSD (it's included by default). After looking again on it I see it's a shell script, not a perl one as I said.

    Seems a frontend to rlog, but prety usefull when you're used to it :)

    Juanjo

    ReplyDelete
  8. [Originally posted at 2005-08-22 07:03 pm UTC]

    rcs2log is cool! Thanks for the tip, I didn't know that command.

    ReplyDelete
  9. [Originally posted at 2005-08-23 07:56 am UTC]

    I just noticed you spelled "your" as "you're" here:

    "You're users could be happy and you didn't have to maintain it manually."

    No biggie, but I felt it had to be addressed.

    Now on the topic at hand: I agree with what you're saying but I'm afraid it will take some time and a bit of user/developer education.

    ReplyDelete
  10. [Originally posted at 2005-08-23 08:03 am UTC ]

    Thanks; I fixed the typo.

    ReplyDelete
  11. [Originally posted at 2005-08-26 07:30 pm UTC]

    Yeah, I totally agree. I much prefer the "NEWS" file that's targeted at the users. A user is not really interested in '01/01/01 - added proper dispose method to XY__a'. He'd rather like to know that 'Memory usage has been reduced'. I tend to use only the NEWS file, where entries (versions) are splited in two sections - major bug fixes + new features.

    Instead of writing the changelogs, developers should simply read the svn commits made by others.

    ReplyDelete