Difference between revisions of "Source file headers"

From Gramps
Jump to: navigation, search
(http://en.wiktionary.org/wiki/prepended#English)
 
(4 intermediate revisions by one other user not shown)
Line 2: Line 2:
 
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-20xx 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 ==
Line 40: Line 40:
 
== 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]mple.com>
# 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>
 +
 
 +
==See also==
 +
*[[Howto: Contribute to Gramps]]
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]

Latest revision as of 01:37, 11 June 2020

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-20xx 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]>

See also