Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
I like to manually mark each line as checked during code reviews. This script allows that. Blog post about it: https://fully-faltoo.com/p/reviewing-each-line-of-code/
default:
just --list
review:
#!/usr/bin/env bash
cd {{invocation_directory()}}
source_branch_name=$(git branch --show-current)
review_branch_name=review-${source_branch_name}
git merge main
git checkout -b $review_branch_name
git reset main
finish-review:
#!/usr/bin/env bash
cd {{invocation_directory()}}
review_branch_name=$(git branch --show-current)
# trim "review-" from starting for source branch name
source_branch_name=${review_branch_name:7}
messages=$(git log ...main --format=%B)
git checkout $source_branch_name
git checkout $review_branch_name . --no-overlay
echo $messages | git commit --file -
git branch -D $review_branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment