Home Home > 2009 > 04 > 16 > Better commit message handling for osc
Sign up | Login

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

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.

Both comments and pings are currently closed.

4 Responses to “Better commit message handling for osc”

  1. Hi, i like this Idea. But in which Package are “vc” included?

  2. Michal Vyskocil

    Currently it’s an internal SUSE command. I sent an initial implementation of osc vc yesterday.

  3. Josef Reidinger

    I don’t like opening editor but this idea is good. Exist any option that say use changelog instead opening editor? (maybe set true as editor is what I need)

  4. Michal Vyskocil

    You can use -m MESSAGE option, so osc vc -m will put the message on top of changes.

    Exist any option that say use changelog instead opening editor?

    Well, this doesn’t make a sense, because BuildService already merges the .changes to %changelog in spec file, so you can track it in .changes only and content will be merged to %changelog.