rubycritic icon indicating copy to clipboard operation
rubycritic copied to clipboard

Error during analysis - Unknown revision or path not in the working tree

Open santhosh-fit opened this issue 2 years ago • 1 comments

I have setup rubycritic for my project with base branch in rubycritic.yml for comparison. On CI for the feature branches, I have setup rubycritic analysis to be run for all the modified files only(instead of running on all files in app or lib folders), which runs the analysis for the identified files on main branch, the feature branch and produces the report with comparison (main vs feature branch). However, if there was a new file added as part of feature branch, the analysis produces an error while running on main branch as:

running churn
fatal: ambiguous argument 'app/models/<file>.rb': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

I understand that the new file is not part of main branch and hence this error. The analysis continues to run on feature branch and also produces a report.

Is there a way to skip running compare/analysis on main for the new files?

santhosh-fit avatar Jan 05 '24 19:01 santhosh-fit

Possible fix: https://github.com/faisal/rubycritic/tree/unknown_revision_fix

faisal avatar May 24 '24 20:05 faisal