Skip to content

Conversation

@fallion
Copy link
Member

@fallion fallion commented Dec 4, 2025

BREAKING CHANGE: Use git commands directly instead of relying of go-git. This should allow for more compatibility with shallow clones.


Important

Replace go-git with direct git command usage for improved compatibility with shallow clones, affecting branch and commit operations.

  • Behavior:
    • Replace go-git with direct git command usage for branch and commit operations in branch_diff_commits.go, commit.go, and get_tags.go.
    • Improve compatibility with shallow clones by using git commands directly.
  • Functions:
    • Update BranchDiffCommits, Commit, CommitsBetween, CommitsOnBranch, CurrentBranch, CurrentCommit, CurrentTag, LatestCommitOnBranch, and PreviousTag to use git commands.
    • Add runGitCommand in open_git.go to execute git commands.
  • Testing:
    • Update tests in branch_diff_commits_test.go, commit_test.go, commits_between_test.go, commits_on_branch_test.go, current_branch_test.go, current_commit_test.go, current_tag_test.go, latest_commit_on_branch_test.go, and previous_tag_test.go to reflect changes.
  • Dependencies:
    • Remove go-git dependencies from go.mod and go.sum.

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

BREAKING CHANGE: Use git commands directly instead of relying of go-git. This should allow for more compatibility with shallow clones.
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 37739bf in 2 minutes and 22 seconds. Click for details.
  • Reviewed 1662 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:
    Consider logging parsing errors when converting each commit hash (using NewHash) instead of silently skipping invalid lines. This can aid in debugging unexpected git output.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. commits_between.go:46
  • Draft comment:
    The error handling for the merge-base command is unclear. Returning an empty slice when the merge-base check fails may hide underlying errors. Consider clarifying or documenting the intended behavior.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. previous_tag.go:30
  • Draft comment:
    The logic in PreviousTag returns the newest tag if the current commit is not tagged. This behavior may be non-intuitive; consider adding documentation to explain the rationale behind returning tags[0] when the current commit lacks an attached tag.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
4. test_helpers.go:25
  • Draft comment:
    Consider checking and handling errors from the git config commands (setting user.name and user.email) to ensure the test repository is properly configured.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. branch_diff_commits.go:8
  • Draft comment:
    Typo: The sentence "returns of a diff of them" appears to be grammatically incorrect. Consider changing it to "returns a diff of them."
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_ff4w8up0GxZwLQc8

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 separate git log calls are used to retrieve the commit message, author, and committer details. Consider consolidating these calls into a single command to reduce overhead and improve performance.

@fallion fallion merged commit 775bf79 into master Dec 4, 2025
8 checks passed
@fallion fallion deleted the use-git branch December 4, 2025 14:38
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