Home Home > 2009 > 04 > 16
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for April 16th, 2009

Better commit message handling for osc

April 16th, 2009 by

If you are familiar with SUSE packages, you probably know about .changes files, which is used for tracking changes. This file has a defined structure and is converted to common %changelog section in spec file during build of package. It worked well with many internal tools and everyone was happy in those old good times ;-).

Nowadays, we had a BuildService and osc, which has it owns commit log. I have aimed to keep the content of changes and osc changelog synchronized. But manual copying of it is not very reliable approach. So I wrote a small patch (and Adrian gives me a write access, so it is a r7099), which checks changes in it and add them to commit message as a template, so it will be easier to keep them synchronized.

How it works:

vi package.spec # do some changes
vc -m "some changes done" # vc is an internal command
osc commit

and osc will open an editor with content like this

  1 - some changes done
  2 --This line, and those below, will be ignored--
  3
  4 M    package.changes
  5
  6 Diff for working copy: .
  7 Index: package.changes
  8 ===================================================================
  9
 10 --- package.changes     (revision 19)
 11 +++ package.changes     (working copy)
 12 @@ -1,3 +1,8 @@
 13 +-------------------------------------------------------------------
 14 +Thu Apr 16 16:00:58 CEST 2009 - mvyskocil@suse.cz
 15 +
 16 +- some changes done
 17 +
 18  -------------------------------------------------------------------
 19  Thu Apr 16 15:37:52 CEST 2009 - mvyskocil@suse.cz

Now you can type :w (save) for commit, or :q! (quit without saving) for abort. The behavior of -m argument is unchanged.