I am trying to create a pre-commit hook for git that edits the comments at the top of each of my .h and .m files. I would like to change the header comments added by x-code to include the app version and license information. This would be helpful when changing to a new version.
This is the text that is automatically inserted when I create a file in x-code:
//
// myFile.h
// myApp
//
// Created by Developer on 11/13/12.
// Copyright (c) 2012 myCompany LLC. All rights reserved.
//
I would like the hook to change it to this:
/*
myFile.h
myApp
Version: 1.0
myApp 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.
myApp 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 myApp.
If not, see <http://www.gnu.org/licenses/>
Copyright 2012 myCompany. All rights reserved.
This notice may not be removed from this file.
*/
I was thinking that I would have a text file with the header text I want to change. Or detect when the app version number changes. When this file is updated with a new version number and git I do a git commit, then it will update all the other files with the new version and change any new files to have the correct header text. This seems like it might be useful.