whitesmith / whitesmith/rubycritic
Suggestion: `git stash` before comparing branches?
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 3.5k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
Hi; I'm not sure if this is possible or not, but I think Overcommit does something along these lines; when you run it, it git stashes any uncommitted code first, so that it only runs your commit/push hooks against the relevant code.
Could RubyCritic do something similar, to allow checking uncommitted code against another branch? Currently you have to commit first (as far as I'm aware).
I think the sequence currently goes:
- git checkout [branch to compare against] (fails here if there is uncommitted code)
- rubycritic 1st run
- git checkout [branch you ran rubycritic in]
- rubycritic 2nd run
If instead it went:
- git stash
- git checkout [branch to compare against]
- rubycritic 1st run
- git checkout [branch you ran rubycritic in]
- git stash pop
- rubycritic 2nd run
... would that work? And if so, would it be a sensible default behaviour? Or is there a reason this might be a bad idea? (Technical or philosophical) 🙂
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by tracing RubyCritic's branch-comparison workflow and its Git checkout calls; determine the safe behavior for uncommitted changes, including stash restoration failures, and define acceptance criteria for comparing the branches without requiring a commit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, ruby
- Domain
- cli, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100