|
64 | 64 |
|
65 | 65 | ---Create prompt for commit message generation |
66 | 66 | ---@param diff string The git diff to include in prompt |
67 | | - ---@param commit_history? string[] Array of recent commit messages for context (optional) |
68 | | - function Generator._create_prompt(diff, lang, commit_history) |
69 | | - -- Build the history context section |
70 | | - local history_context = "" |
71 | | - if commit_history and #commit_history > 0 then |
72 | | - history_context = "\nRECENT COMMIT HISTORY (for style reference):\n" |
73 | | - for i, commit_msg in ipairs(commit_history) do |
74 | | - history_context = history_context .. string.format("%d. %s\n", i, commit_msg) |
75 | | - end |
76 | | - history_context = history_context .. "\nAnalyze the above commit history to understand the project's commit style, tone, and format patterns. Use this as guidance to maintain consistency.\n" |
77 | | - end |
78 | | - |
| 67 | +---@param commit_history? string[] Array of recent commit messages for context (optional) |
| 68 | +function Generator._create_prompt(diff, lang, commit_history) |
| 69 | + -- Build the history context section |
| 70 | + local history_context = "" |
| 71 | + if commit_history and #commit_history > 0 then |
| 72 | + history_context = "\nRECENT COMMIT HISTORY (for style reference):\n" |
| 73 | + for i, commit_msg in ipairs(commit_history) do |
| 74 | + history_context = history_context .. string.format("%d. %s\n", i, commit_msg) |
| 75 | + end |
| 76 | + history_context = history_context |
| 77 | + .. "\nAnalyze the above commit history to understand the project's commit style, tone, and format patterns. Use this as guidance to maintain consistency.\n" |
| 78 | + end |
| 79 | + |
79 | 80 | return string.format( |
80 | 81 | [[You are a commit message generator. Generate exactly ONE complete Conventional Commit message for the provided git diff.%s |
81 | 82 |
|
|
0 commit comments