.hファイルと.mファイルのそれぞれの上部にあるコメントを編集するgitのpre-commitフックを作成しようとしています。x-codeによって追加されたヘッダーコメントを変更して、アプリのバージョンとライセンス情報を含めたいと思います。これは、新しいバージョンに変更するときに役立ちます。
これは、xコードでファイルを作成するときに自動的に挿入されるテキストです。
//
// myFile.h
// myApp
//
// Created by Developer on 11/13/12.
// Copyright (c) 2012 myCompany LLC. All rights reserved.
//
フックでこれに変更したいのですが:
/*
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.
*/
変更したいヘッダーテキストを含むテキストファイルがあると思っていました。または、アプリのバージョン番号が変更されたことを検出します。このファイルが新しいバージョン番号で更新され、gitがgit commitを実行すると、他のすべてのファイルが新しいバージョンで更新され、新しいファイルが正しいヘッダーテキストを持つように変更されます。これは役に立つかもしれないようです。