Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 282172 - No way to control the $Id$ comment
Summary: No way to control the $Id$ comment
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: 2.4.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Dave Steinberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 286329
  Show dependency tree
 
Reported: 2009-07-01 11:29 EDT by Peter Moogk CLA
Modified: 2009-08-17 15:15 EDT (History)
2 users (show)

See Also:


Attachments
Patch to make $Id$ flag conditional (1.84 MB, patch)
2009-07-28 14:02 EDT, Dave Steinberg CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Moogk CLA 2009-07-01 11:29:10 EDT
When EMF code is generated an $Id$ CVS variable is generated in the comment header.  Although this is handy way to get timestamp information into the source code, it makes comparing two versions of generated EMF code difficult, since all files will have a least the timestamp different.  EMF should give the developer the choice of whether the $Id$ variable is emitted or not.  This could be done through a genmodel setting.   It could also be done by not emitting the $Id$ comment when the genmodel has a copyright comment string defined.   Thanks!
Comment 1 Ed Merks CLA 2009-07-01 13:37:42 EDT
Contributions/patches will be welcome.
Comment 2 Dave Steinberg CLA 2009-07-28 14:02:24 EDT
Created attachment 142796 [details]
Patch to make $Id$ flag conditional

Here's what I'd recommend. I think it's the simplest possible change: just move the $Id$ tag into the no-copyright-specified block.  This way, if people specify a custom copyright statement, they won't get the tag. If they want it, they can put it there themselves.

This seems like a good idea in general since people might not be using CVS or may want to customize the tags they're getting.

Because we don't update existing copyright comments on merge, it doesn't seem like it will do any damage. It will only affect new files.  And I'd be happy to add an entry to the Bleeding Edge warning people of the change, if that seems like a good idea.

Ed, what do you think?
Comment 3 Dave Steinberg CLA 2009-07-28 14:09:02 EDT
James, if made, this change would bump org.eclipse.emf.codegen.ecore to 2.6.0, requiring the dependency in org.eclipse.emf.uml.codegen.ecore to be updated as well.  And this change would cause all your specialized templates to be rebuilt, but only affecting the generated copyright statements (when copyright text is specified) as described above.

Any concerns?
Comment 4 James Bruck CLA 2009-07-28 15:27:59 EDT
Dave, thanks for the 'heads up'.  I'll have to make appropriate updates in UML2 when you deliver this.   When were you planning on putting this in?
Comment 5 Dave Steinberg CLA 2009-07-29 10:01:35 EDT
James,

Whenever possible, but with no great rush.  I'm just trying to deal with some low hanging fruit in my spare moments.  Do you have a preference?
Comment 6 Ed Merks CLA 2009-07-30 09:33:30 EDT
This sounds like a good approach Dave!
Comment 7 Dave Steinberg CLA 2009-07-30 15:05:08 EDT
Thanks Ed.  I've got the changes ready to go (including updating all the expected results in the generator tests), but I'll hold off on commiting it (or any other codegen changes) until James is back from vacation.  UML has a strict dependency on codegen.ecore 2.5, so they'll need to respond immediately to avoid breakage.
Comment 8 Dave Steinberg CLA 2009-08-11 13:21:16 EDT
The change is committed to CVS for EMF 2.6.

James, you'll now need to update your dependency on org.eclipse.emf.codegen.ecore, and your templates should update themselves.
Comment 9 Dave Steinberg CLA 2009-08-17 15:15:01 EDT
Fix available in HEAD: 2.6.0M1 (S200908122048).