Skip to content

Commit c695c59

Browse files
committed
refactor(release-notes): improve tag and commit range handling
- enhance default tag selection logic for release notes generation - add fallback mechanism for tag and commit range detection - simplify tag and commit range assignment when not explicitly specified
1 parent 39f3e3f commit c695c59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/codecompanion/_extensions/gitcommit/tools/ai_release_notes.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,16 @@ AIReleaseNotes.cmds = {
316316
-- Set to_tag if not specified
317317
if not to_tag then
318318
if #tags > 0 then
319-
to_tag = tags[1] -- Use latest tag
319+
to_tag = tags[1] -- Use latest tag
320320
else
321-
to_tag = "HEAD" -- No tags, use HEAD
321+
to_tag = "HEAD" -- No tags, use HEAD
322322
end
323323
end
324324

325325
-- Set from_tag if not specified
326326
if not from_tag then
327327
if #tags > 1 then
328-
from_tag = tags[2] -- Use previous tag
328+
from_tag = tags[2] -- Use previous tag
329329
elseif #tags == 1 then
330330
-- Only one tag, get first commit as starting point
331331
local first_commit_cmd = "git rev-list --max-parents=0 HEAD"
@@ -347,7 +347,7 @@ AIReleaseNotes.cmds = {
347347
to_tag = "HEAD"
348348
end
349349
if not from_tag then
350-
from_tag = "HEAD~10" -- Default to last 10 commits
350+
from_tag = "HEAD~10" -- Default to last 10 commits
351351
end
352352
end
353353
end

0 commit comments

Comments
 (0)