慣例により、FOO-1001 などの Jira 課題 ID を含めるために、git でストーリー ブランチを作成します。私はそれを行うためのスクリプトを持っています。ここで、Jira API から FOO-1001 のタイトルを取得する別のスクリプトを用意しました。入力したときにそれを達成したい:
$ git commit
私のエディターが開き、次の情報が事前に入力されます。
BUGFIX: FOO-1001 Some sample issue title downloaded using my script
私が説明したスクリプトを使用してこれを実現する最も簡単な方法は何ですか? 私の考えは、gitがそれを見つけてデフォルトとして使用できるように、何らかの方法でコミットメッセージをファイルにフォーマットすることです。1 つの方法はフックを使用することですが、(同僚が簡単に再利用できるように)prepare-commit-msg
構成を行わずに、スタンドアロン スクリプトを使用して目的を達成することをお勧めします。.git