Difference between revisions of "Source file headers"

From Gramps
Jump to: navigation, search
(Initial Creation)
 
(Copyright statement examples)
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== File Header Policy ==
+
== File header policy ==
 
The Gramps project requires that all source code files stored in the official project repository include the following header at the top of the file:
 
The Gramps project requires that all source code files stored in the official project repository include the following header at the top of the file:
  
<code>
+
<pre>
#
+
#
# Gramps - a GTK+/GNOME based genealogy program
+
# Gramps - a GTK+/GNOME based genealogy program
#
+
#
# Copyright (C) 20xx-20xy Contributor1 Name
+
# Copyright (C) 20xx-20xy Contributor1 Name
# Copyright (C) 20xx      Contributor2 Name
+
# Copyright (C) 20xx      Contributor2 Name
#
+
#
# This program is free software; you can redistribute it and/or modify
+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
+
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
+
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
+
# (at your option) any later version.
#
+
#
# This program is distributed in the hope that it will be useful,  
+
# This program is distributed in the hope that it will be useful,  
# but WITHOUT ANY WARRANTY; without even the implied warranty of
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
+
# GNU General Public License for more details.
#
+
#
# You should have received a copy of the GNU General Public License
+
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
+
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
+
#
</code>
+
</pre>
  
== File Header Procedure ==
+
== File header procedure ==
 
The following procedures regarding source file headers shall be followed by all contributors whose changes are committed to the official project source repository:
 
The following procedures regarding source file headers shall be followed by all contributors whose changes are committed to the official project source repository:
* When a new source file is created, the header shall be pre-pended to the file before the file is committed to the source repository.
+
* When a new source file is created, the header shall be prepended to the file before the file is committed to the source repository.
 
* The original file author shall include his/her name in the copyright statement along with the year the file was created.
 
* The original file author shall include his/her name in the copyright statement along with the year the file was created.
 
* Additional contributors shall add their names and respective years of contribution in the copyright statement if they make changes to the file in the source repository.
 
* Additional contributors shall add their names and respective years of contribution in the copyright statement if they make changes to the file in the source repository.
Line 33: Line 33:
 
* While not strictly required, consider including an e-mail address in addition to the contributor name.
 
* While not strictly required, consider including an e-mail address in addition to the contributor name.
  
== File Header Purpose ==
+
== File header purpose ==
 
The file header has two primary purposes:
 
The file header has two primary purposes:
 
# Communication of the license the code is distributed under
 
# Communication of the license the code is distributed under
 
# Tracking of past contributors (who are by definition copyright holders)
 
# Tracking of past contributors (who are by definition copyright holders)
  
== Copyright Statement Examples ==
+
== Copyright statement examples ==
 
Single author, all contributions in the same year:
 
Single author, all contributions in the same year:
<code>
+
<pre>
# Copyright (C) 2005 John Doe
+
# Copyright (C) 2015 John Doe
</code>
+
</pre>
  
 
Single author, contributions in a range of years:
 
Single author, contributions in a range of years:
<code>
+
<pre>
# Copyright (C) 2005-2009 John Doe
+
# Copyright (C) 2014-2015 John Doe
</code>
+
</pre>
  
 
Single author, contributions in sparse years:
 
Single author, contributions in sparse years:
<code>
+
<pre>
# Copyright (C) 2005, 2007-2008 John Doe
+
# Copyright (C) 2005, 2007-2013 John Doe
</code>
+
</pre>
  
 
Multiple authors, contributions in various years:
 
Multiple authors, contributions in various years:
<code>
+
<pre>
# Copyright (C) 2005, 2007-2008 John Doe    <[email protected]>
+
# Copyright (C) 2005, 2007-2013 John Doe    <[email protected]>
# Copyright (C) 2008           Jane Smith
+
# Copyright (C) 2009           Jane Smith
# Copyright (C) 2006-2007      Ed Johnson  <[email protected]>
+
# Copyright (C) 2006-2007      Ed Johnson  <[email protected]>
</code>
+
</pre>
 +
 
 +
[[Category:Plugins]]
 +
[[Category:Developers/Tutorials]]
 +
[[Category:Developers/General]]
 +
[[Category:Reports|H]]

Revision as of 05:32, 8 January 2015

File header policy

The Gramps project requires that all source code files stored in the official project repository include the following header at the top of the file:

#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 20xx-20xy Contributor1 Name
# Copyright (C) 20xx      Contributor2 Name
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

File header procedure

The following procedures regarding source file headers shall be followed by all contributors whose changes are committed to the official project source repository:

  • When a new source file is created, the header shall be prepended to the file before the file is committed to the source repository.
  • The original file author shall include his/her name in the copyright statement along with the year the file was created.
  • Additional contributors shall add their names and respective years of contribution in the copyright statement if they make changes to the file in the source repository.
    • Years can be indicated as ranges, or separated by comas.
  • While not strictly required, consider including an e-mail address in addition to the contributor name.

File header purpose

The file header has two primary purposes:

  1. Communication of the license the code is distributed under
  2. Tracking of past contributors (who are by definition copyright holders)

Copyright statement examples

Single author, all contributions in the same year:

# Copyright (C) 2015 John Doe

Single author, contributions in a range of years:

# Copyright (C) 2014-2015 John Doe

Single author, contributions in sparse years:

# Copyright (C) 2005, 2007-2013 John Doe

Multiple authors, contributions in various years:

# Copyright (C) 2005, 2007-2013 John Doe    <[email protected]>
# Copyright (C) 2009            Jane Smith
# Copyright (C) 2006-2007       Ed Johnson  <[email protected]>