0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitKrakenでCommite Messageを自動生成

Posted at

Gitkrakenが、実験的に機能提供

ChatGPTのAPIキーを渡すと、ボタンポチでコミットメッセージを生成してくれます。

背景

コミットメッセージ書くの大事だけど面倒

やりたいこと

コミットメッセージ自動生成

やってみた

トリム済み.gif

設定

設定画面.png

  1. 設定
  2. Experimental
  3. OpenAI API Key 貼り付け
  4. プロンプトはデフォルトでコミットメッセージ用に用意されています。

オプションで条件を付け足していく場合は、デフォルトのプロンプトに追加してくとよいでしょう。

プロンプト

デフォルトのプロンプト

  • プロンプト
Commit Messages must have a short description that is less than 50 characters followed by a newline and a more detailed description.
- Write concisely using an informal tone
- List significant changes
- Do not use specific names or files from the code
- Do not use phrases like "this commit", "this change", etc.
  • 結果
Refactor invoices page component to include search functionality and UI improvements
- Import Pagination, Search, Table, CreateInvoice components
- Add lusitana font styling
- Add InvoicesTableSkeleton component for suspense fallback
- Comment out Suspense and Table components temporarily
- Comment out Pagination component temporarily

プレフィクスをつける指示追加

プロンプト

Commit Messages must have a short description that is less than 50 characters followed by a newline and a more detailed description.
- Write concisely using an informal tone
- List significant changes
- Do not use specific names or files from the code
- Do not use phrases like "this commit", "this change", etc.
(下を追加)
- Use one of the following prefixes
  fix: Use if there is a problem with an existing feature.
  hotfix: Use when there is a critical problem with an existing feature.
  add: Use to add a new file or feature.
  feat: Use to add a new feature or file.
  update: Used when there is no problem with an existing feature, but a fix is needed.
  change: Used to modify an existing feature due to specification changes.
  refactor: Used to clean up and improve code.
  improve: Used to improve code.
  disable: Used to temporarily disable a feature.
  delete: Used to delete a file or remove a feature.
  rename: Used to rename a file.
  move: Used to move a file.
  upgrade: Used to upgrade a version.
  revert: Revert to a previous commit.
  docs: Used to modify documentation.
  style: Used to modify coding style.
  perf: Used to improve code performance.
  test: Use to modify test code or add test code.
  chore: Use to commit auto-generated by build tools or libraries, or to make modifications that do not apply to the above prefixes.

結果

feat: Add search functionality and pagination to invoices page
This commit adds the following changes to the invoices page:
- Import and use the Search component for searching invoices
- Import and use the Pagination component for navigating through pages of invoices
- Comment out code related to displaying a table of invoices, as it is not yet implemented

These changes enhance the functionality of the invoices page by allowing users to search for specific invoices and navigate through multiple pages of results.

日本語にするには、プロンプトを日本語に翻訳したプロンプトにすると、日本語のコミットメッセージを生成してくれます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?