Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git diff command #59

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Fix git diff command #59

merged 1 commit into from
Oct 17, 2023

Conversation

tapishr
Copy link
Member

@tapishr tapishr commented Oct 17, 2023

Fix git diff command to follow symmetric diff or three-dot diff

Summary by CodeRabbit

  • Refactor: Improved the functionality of the code reviewer tool. The update enhances the accuracy of file exclusion during code reviews by correctly identifying the differences between specific commit ranges. This change will streamline the review process, making it more efficient and reliable.

@tapishr tapishr requested a review from avikalpg October 17, 2023 11:43
@tapishr tapishr self-assigned this Oct 17, 2023
@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2023

Walkthrough

The change modifies the get_excluded_files function in the reviewer.rs file. It introduces a new variable commit_range to store the commit range, which is then used in the git diff command. This adjustment ensures the correct retrieval of the diff between the specified commit range.

Changes

File Summary
.../src/reviewer.rs Introduced commit_range variable to store the commit range. Updated git diff command to use commit_range, improving the accuracy of diff retrieval between specified commits.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

@sonarcloud
Copy link

sonarcloud bot commented Oct 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between d93fddc and fdaeb8b.
Files selected for processing (1)
  • devprofiler/src/reviewer.rs (2 hunks)
Additional comments (Suppressed): 2
devprofiler/src/reviewer.rs (2)
  • 264-269: The change from using two separate commit hashes to a commit range in the git diff command is a significant one. This change switches the diff from a two-dot diff to a three-dot diff, which can yield different results. The two-dot diff shows the changes between the two commits, while the three-dot diff shows what changes would be needed to merge the two commits. This is a more accurate way of determining what changes have been made between two branches or commits. However, ensure that this is the intended behavior for your use case.
- .args(&["diff", prev_commit, next_commit, "--numstat"])
+ .args(&["diff", &commit_range, "--numstat"])
  • 402-403: No significant changes were made in these lines. The store_hunkmap function is still being called with the same arguments as before.

@avikalpg avikalpg merged commit b2db96d into main Oct 17, 2023
3 checks passed
@avikalpg avikalpg deleted the tr/fixDiffCommand branch October 17, 2023 11:49
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.

None yet

2 participants