Skip to content

Instantly share code, notes, and snippets.

@pratyushmittal
Created July 31, 2022 13:43
Show Gist options
  • Save pratyushmittal/4bcc06b887ef844775f44b801893b9f6 to your computer and use it in GitHub Desktop.
Save pratyushmittal/4bcc06b887ef844775f44b801893b9f6 to your computer and use it in GitHub Desktop.
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