Skip to content

feat(git): validate if PATH git version is safe git - #865

Open
wu21-web wants to merge 6 commits into
alibaba:mainfrom
wu21-web:gitver
Open

feat(git): validate if PATH git version is safe git#865
wu21-web wants to merge 6 commits into
alibaba:mainfrom
wu21-web:gitver

Conversation

@wu21-web

@wu21-web wu21-web commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Simply prints a warning to the user if their git in path version is lower than 2.41

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

Compiled it on alibaba cloud linux with has git 2.17.1

shell@Alicloud:~/open-code-review$ make build
go build -ldflags "-X main.Version=v0.0.0-7e59d53 -X main.GitCommit=7e59d53 -X main.BuildDate=2026-08-12T11:53:57Z" -o ./dist/opencodereview ./cmd/opencodereview

shell@Alicloud:~/open-code-review$ 
shell@Alicloud:~/open-code-review$ cd dist/
shell@Alicloud:~/open-code-review/dist$ ls
opencodereview
shell@Alicloud:~/open-code-review/dist$ ./opencodereview config provider
warning: git 2.17.1 is older than the minimum supported version 2.41.0. Some commands may not work correctly; consider upgrading git.
Cancelled.
shell@Alicloud:~/open-code-review/dist$ 

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

Discussion at: #860

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 2 comment(s)

Comment thread cmd/opencodereview/main.go
Comment thread internal/gitcmd/version.go
@wu21-web wu21-web changed the title feat(git): validate git version is safe git feat(git): validate if PATH git version is safe git Aug 12, 2026
@wu21-web
wu21-web marked this pull request as ready for review August 12, 2026 12:50
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.

1 participant