Skip to content

Conversation

@fallion
Copy link
Member

@fallion fallion commented Dec 4, 2025

Important

Refactor git package to replace go-git with direct git command execution, updating commit, branch, and tag handling logic and tests.

  • Behavior:
    • Refactor BranchDiffCommits in branch_diff_commits.go to use git log for commit comparison, improving efficiency.
    • Update Commit in commit.go to fetch commit details using git log commands.
    • Modify CommitsBetween in commits_between.go to handle empty hashes and use git log for commit retrieval.
    • Change CommitsOnBranch and CommitsOnBranchSimple in commits_on_branch.go and commits_on_branch_simple.go to use git log for fetching commits.
    • Revise CurrentBranch and CurrentCommit in current_branch.go and current_commit.go to use git commands for current state retrieval.
    • Adjust CurrentTag in current_tag.go to determine the current tag using git commands.
    • Refactor getTags in get_tags.go to fetch and sort tags using git for-each-ref.
    • Update LatestCommitOnBranch in latest_commit_on_branch.go to resolve branch commits using git rev-parse.
    • Modify PreviousTag in previous_tag.go to find previous tags using sorted tag data.
  • Models:
    • Introduce Hash, Commit, Signature, and Reference types in types.go to replace go-git types.
  • Testing:
    • Update tests in *_test.go files to align with new git command-based logic.
    • Add test_helpers.go for setting up test repositories and creating test data.
  • Dependencies:
    • Remove go-git and related dependencies from go.mod and go.sum.

This description was created by Ellipsis for 400eb03. You can customize this summary. It will automatically update as commits are pushed.

Simon Prochazka added 2 commits December 4, 2025 15:34
BREAKING CHANGE: Use git commands directly instead of relying of go-git. This should allow for more compatibility with shallow clones.
@fallion fallion merged commit 7e8732a into master Dec 4, 2025
2 of 6 checks passed
@fallion fallion deleted the version-update branch December 4, 2025 15:01
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 400eb03 in 2 minutes and 39 seconds. Click for details.
  • Reviewed 1667 lines of code in 28 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. branch_diff_commits.go:29
  • Draft comment:
    When NewHash fails (lines 29-32), the error is silently skipped. Consider logging the parsing error to help debug unexpected invalid hashes.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This comment is suggesting a "consider logging" change, which is not a clear code change requirement. It's a suggestion for potential debugging improvements. The rules state "Do NOT comment unless there is clearly a code change required" and "Do NOT make speculative comments." This falls into the category of a speculative improvement - "consider logging to help debug unexpected invalid hashes" implies this might be useful IF there are unexpected invalid hashes, but there's no evidence this is actually a problem. The git command output should always be valid hashes, so this is a defensive suggestion rather than fixing an actual issue. The comment could be valid if there's a real risk of invalid hashes appearing in production and causing silent failures that would be hard to debug. Logging errors is generally a good practice, especially when silently skipping data. While logging is generally good practice, the comment uses "consider" language which makes it non-actionable. It's a suggestion rather than identifying a clear problem. The git command should always return valid hashes, so this is speculative about a scenario that shouldn't happen. This violates the rule about not making speculative comments. This comment should be deleted because it uses "consider" language making it a suggestion rather than a clear code change requirement, and it's speculative about debugging a scenario that shouldn't occur with valid git output.
2. get_tags.go:17
  • Draft comment:
    The custom delimiter '<TAG_SEP>' is used to split tag entries. Ensure that this delimiter cannot appear in tag data to avoid parsing errors.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure that a custom delimiter does not appear in tag data, which is a form of asking for confirmation or verification. This violates the rule against asking the author to ensure behavior is intended or to double-check things. Therefore, this comment should not be approved.
3. previous_tag.go:29
  • Draft comment:
    The logic returns tags[0] when the current commit isn't tagged (lines 29-33). Confirm this behavior matches requirements, as it may be unexpected to return the most recent tag even if not attached to HEAD.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. branch_diff_commits.go:8
  • Draft comment:
    Typographical/grammatical suggestion: In the comment on line 8, it currently states 'returns of a diff of them.' Consider rephrasing to 'returns a diff of them' for clarity.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely a typographical/grammatical suggestion, which is not related to the functionality or logic of the code. It doesn't provide a code suggestion or ask for a test, nor does it address any potential issues with the code itself. Therefore, it violates the rule against making purely informative comments.
5. commits_on_branch_simple.go:9
  • Draft comment:
    Typo in comment: Consider changing "slimed down commit object" to "slimmed down commit object".
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_9UcTTajr1J1QJM9w

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


// Get commit message - use %B to get full body, then normalize
// go-git's Message field returns the raw commit message which always ends with \n
fullMessage, err := g.runGitCommand("log", "-1", "--format=%B", hashStr)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple calls to g.runGitCommand (for commit message, author, committer, and dates) could be consolidated into a single command to improve performance.

}

// Get message for this commit
message, err := g.runGitCommand("log", "-1", "--format=%B", hashLine)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each commit's message is fetched individually via a separate git log call (lines 42-46). Consider batching these calls if the branch has many commits to reduce overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants