[opensuse-buildservice] RFC: small patch for "osc commit" with big effect
Hi, Index: osc/commandline.py =================================================================== --- osc/commandline.py (revision 4001) +++ osc/commandline.py (working copy) @@ -1029,6 +1029,9 @@ ${cmd_usage} ${cmd_option_list} """ + if not opts.message and not opts.file: + sys.stderr.write('You didn\'t specify a commit message.\n' + 'In the future, this will be mandatory.\n') msg = '' if opts.message: msg = opts.message Later, giving a commit message (-m / -F) will be enforced. What do people think about this? I think it is good, and I know some that agree, and I haven't seen anyone disagreeing yet. We can also make the messages mandatory right away, depending on what you think... Thanks, Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development
Peter, sorry for top-Posting.. sometimes I could start to hate GroupWise... it does not always as it's told to do :) So this time it forgets to quote your text correctly. so about enforcing the commit messages: I'm perfectly in favor of if... BUT with a small extension: the .changes files should be updated in the same moment (or the api should use this info for the %changelog) Otherwise we start to make the same changes over and over: in the .changes, in the commit message, and most likely this will lead to useless comments, like 'see changelog' ;) Dominique
From: Peter Poeml
To: Date: 20.05.2008 16:04 Subject: [opensuse-buildservice] RFC: small patch for "osc commit" with big effect Hi,
Index: osc/commandline.py =================================================================== --- osc/commandline.py (revision 4001) +++ osc/commandline.py (working copy) @@ -1029,6 +1029,9 @@ ${cmd_usage} ${cmd_option_list} """ + if not opts.message and not opts.file: + sys.stderr.write('You didn\'t specify a commit message.\n' + 'In the future, this will be mandatory.\n') msg = '' if opts.message: msg = opts.message Later, giving a commit message (-m / -F) will be enforced. What do people think about this? I think it is good, and I know some that agree, and I haven't seen anyone disagreeing yet. We can also make the messages mandatory right away, depending on what you think... Thanks, Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
BUT with a small extension: the .changes files should be updated in
Dominique Leuenberger wrote: the same moment (or the api should use this info for the %changelog) Generating commit message from changes file suits me better than the other way. What do others think? -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o Package Maintainer Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9, CR prusnak[at]suse.cz http://www.suse.cz --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Hello,
so about enforcing the commit messages: I'm perfectly in favor of if... BUT with a small extension: the .changes files should be updated in the same moment (or the api should use this info for the %changelog)
Yes. PLEASE! I requested this when commit message was introduced into osc and still would like to have it. P.S. I'm used to -m "minor changes" anyway, as this is my "I don't know what to write into commit message" text, so no objections to enforce the message. Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 20.05.2008 at 17:10, Pavol Rusnak
wrote: Dominique Leuenberger wrote: BUT with a small extension: the .changes files should be updated in the same moment (or the api should use this info for the %changelog) Generating commit message from changes file suits me better than the other way. What do others think?
Hmm.. of course changing all the files and then simply committing sounds tempting, but might be a bit trickier to find out for osc if the last entry in the changes was not already used for another commit... Either way, those two things have to get in sync IMO. Dominique --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 20 May 2008 16:10:18 wrote Pavol Rusnak:
Dominique Leuenberger wrote:
BUT with a small extension: the .changes files should be updated in
the same moment (or the api should use this info for the %changelog)
Generating commit message from changes file suits me better than the other way. What do others think?
Well, you may do multiple commits for just one changelog entry. The user of the package might not be interessted how many typos you put in during version upgrade ;) -- Adrian Schroeter SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 20.05.2008 at 17:25, Adrian Schröter
wrote: On Tuesday 20 May 2008 16:10:18 wrote Pavol Rusnak: Dominique Leuenberger wrote: BUT with a small extension: the .changes files should be updated in the same moment (or the api should use this info for the %changelog)
Generating commit message from changes file suits me better than the other way. What do others think?
Well, you may do multiple commits for just one changelog entry. The user of the package might not be interessted how many typos you put in during
version upgrade ;)
Adrian, you still make typos? ;) But you have a point there. Maybe a keyword like in osc -m "c: <now comes the nice commit message>" could be used to help us lazy spec file writers? c as in comment / commit, just shorter. In case the c: is omitted, we could treat it as a packager-only commit log entry. Dominique --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, 20 May 2008, Adrian Schröter wrote:
On Tuesday 20 May 2008 16:10:18 wrote Pavol Rusnak:
Dominique Leuenberger wrote:
BUT with a small extension: the .changes files should be updated in
the same moment (or the api should use this info for the %changelog)
Generating commit message from changes file suits me better than the other way. What do others think?
Well, you may do multiple commits for just one changelog entry. The user of the package might not be interessted how many typos you put in during version upgrade ;)
What about that: if(changes file exits) { if(changes modified locally) { if(option --commitfromchanges) { set commit message to changes entry } else { do nothing } } else if(option --nochanges) { do nothing } else if(option --addchanges) { update last changes entry with commit message } else { add new changes entry } } else { do nothing :-) } That should fit all needs. Ciao -- http://www.dstoecker.eu/ (PGP key available)
On Tue, May 20, 2008 at 8:04 AM, Peter Poeml
Later, giving a commit message (-m / -F) will be enforced.
What do people think about this? I think it is good, and I know some that agree, and I haven't seen anyone disagreeing yet.
Dumb question: why doesn't "osc commit" just fire up a $EDITOR just like "svn commit" does? Is there some reason not to do the normal thing here? -Archie -- Archie L. Cobbs --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Pavol Rusnak
BUT with a small extension: the .changes files should be updated in
Dominique Leuenberger wrote: the same moment (or the api should use this info for the %changelog)
Generating commit message from changes file suits me better than the other way. What do others think?
+1 And if it is missing and osc is interactive (stdin is not empty), could osc ask for a commit message interactively instead of an error message? And then add it to the changelog? Getting greedy ;) S. -- Susanne Oberhauser +49-911-74053-574 SUSE -- a Novell Business OPS Engineering Maxfeldstraße 5 Processes and Infrastructure Nürnberg SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, May 20, 2008 at 10:20:00AM -0500, Archie Cobbs wrote:
On Tue, May 20, 2008 at 8:04 AM, Peter Poeml
wrote: Later, giving a commit message (-m / -F) will be enforced.
What do people think about this? I think it is good, and I know some that agree, and I haven't seen anyone disagreeing yet.
Dumb question: why doesn't "osc commit" just fire up a $EDITOR just like "svn commit" does? Is there some reason not to do the normal thing here?
That would be the next thing to implement, indeed. Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development
Hello Dominique, On Tue, May 20, 2008 at 03:07:37PM +0200, Dominique Leuenberger wrote:
so about enforcing the commit messages: I'm perfectly in favor of if... BUT with a small extension: the .changes files should be updated in the same moment (or the api should use this info for the %changelog)
Otherwise we start to make the same changes over and over: in the .changes, in the commit message, and most likely this will lead to useless comments, like 'see changelog' ;)
Yes and no. The package changelog is often quite different from the commit changelog. Just like the difference between svn changelog and package changelog. Of course they _might_ be the same, but nobody would argue that this is always the case (or even in the majority), and that the two changelogs are redundant. Package changelog is for users of your package. Commit changelog is for users of the source code revision control system used by the build service. Having some automatic that transports changes forth and back may make sense in some cases. I'm looking forward to suggestions/implementations. Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development
On Tue, May 20, 2008 at 07:24:48PM +0200, Peter Poeml wrote:
On Tue, May 20, 2008 at 10:20:00AM -0500, Archie Cobbs wrote:
On Tue, May 20, 2008 at 8:04 AM, Peter Poeml
wrote: Later, giving a commit message (-m / -F) will be enforced.
What do people think about this? I think it is good, and I know some that agree, and I haven't seen anyone disagreeing yet.
Dumb question: why doesn't "osc commit" just fire up a $EDITOR just like "svn commit" does? Is there some reason not to do the normal thing here?
That would be the next thing to implement, indeed.
osc does that now. Check out the trunk. Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development
Hello, on Mittwoch, 21. Mai 2008, Peter Poeml wrote:
The package changelog is often quite different from the commit changelog. ... Having some automatic that transports changes forth and back may make sense in some cases. I'm looking forward to suggestions/implementations.
Agreed. I'd like to add that IMHO all things that go to the package changelog should also be listed in the commit changelog. An idea for the new "interactive" commit where osc calls $EDITOR: [1] Open $EDITOR with some type of template, for example: ----------------------------------------------------------------------- OSC-START-PACKAGE-CHANGELOG OSC: enter lines that should appear in the package changelog: OSC-START-COMMIT-LOG OSC: enter lines that should only appear in the commit log: OSC: OSC: Modified files: OSC: mypackage.spec OSC: Added files: OSC: fix-foobar.patch OSC: OSC: (every line starting with OSC: is ignored) ----------------------------------------------------------------------- The keywords are OSC-START-PACKAGE-CHANGELOG and OSC-START-COMMIT-LOG which mark the beginning of the two sections, and "^OSC:" as comment marker. The comments include a short summary about the changed/added/removed files, which is usually a good reminder for the user. The two OSC-START-... keywords could also be used with -m. The only remaining question is how changelog entries without a OSC-START-... keyword should be handled. I vote for "add to package changelog also" in this case - better too much than incomplete ;-) Regards, Christian Boltz [1] no, I didn't test it - seems the package in the buildservice doesn't have the "open $EDITOR on commit" feature yet. -- If you break it, you own both parts. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Wed, 21 May 2008, Christian Boltz wrote:
An idea for the new "interactive" commit where osc calls $EDITOR: [1] Open $EDITOR with some type of template, for example:
----------------------------------------------------------------------- OSC-START-PACKAGE-CHANGELOG OSC: enter lines that should appear in the package changelog:
OSC-START-COMMIT-LOG OSC: enter lines that should only appear in the commit log:
OSC: OSC: Modified files: OSC: mypackage.spec OSC: Added files: OSC: fix-foobar.patch OSC: OSC: (every line starting with OSC: is ignored) -----------------------------------------------------------------------
The keywords are OSC-START-PACKAGE-CHANGELOG and OSC-START-COMMIT-LOG which mark the beginning of the two sections, and "^OSC:" as comment marker. The comments include a short summary about the changed/added/removed files, which is usually a good reminder for the user.
The two OSC-START-... keywords could also be used with -m.
The only remaining question is how changelog entries without a OSC-START-... keyword should be handled. I vote for "add to package changelog also" in this case - better too much than incomplete ;-)
No. This is a new workflow, which no other software implements. Don't do that. There are enough established ways to do that. Better solution: Support keywords like many other tools: osc commit -m "LOG: add this as changelog message". Now your above template suggestion is fine as well. Start the tool with $EDITOR and a template like that: -------------------- # OSC commit message supports some additional keywords. Each line stating # with one of these keywords is handled specially: # LOG: everything behind this goes into the package changelog or the # RPM specfile # BUG: this change is related to given bug number # CLOSES: closes given bug number -------------------- Differences to your proposal: a) Established work flow in many larger code repositories b) much more expandable - BUG, CLOSES probably will not be implemented right now, but I expect them to come one day c) commandline only usage works fine (A way to support multiple lines in commandline should exists (e.g. support \n for newlines). d) Using established standard comments char # Ciao -- http://www.dstoecker.eu/ (PGP key available) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (8)
-
Adrian Schröter
-
Archie Cobbs
-
Christian Boltz
-
Dirk Stöcker
-
Dominique Leuenberger
-
Pavol Rusnak
-
Peter Poeml
-
Susanne Oberhauser