딱 필요한 커밋 로그만 diff 떠서 슥 훑어보기

file = ARGV[0] # 파일을 파라미터로 넘겨줄 수 있지만, 디폴트로는 리포지토리에 대한 log를 나열하게 됨

git_logs = `git log --oneline #{file} | gum choose --limit 100` # 100개 정도만 조회해서 다중 선택

# See https://abhij.it/ruby-difference-between-system-exec-and-backticks/
git_logs.each_line do |line|
  commit_hash, *_ = line.split
  system("git show #{commit_hash}") # 선택한 커밋 해시에서 어떤 변경사항이 있었는지 조회
  puts("=====")
  puts("Press ENTER key to CONTINUE")
  puts("=====")
  gets
end

checklist = []
git_logs.each_line do |line|
  checklist << "- [ ] #{line}" # 지금까지 조회한 커밋 로그들을 파악완료했는지 여부 파악을 위해 체크리스트 생성
end

puts checklist.join
0

If you have a fediverse account, you can quote this note from your own instance. Search https://hackers.pub/ap/notes/01960935-f633-7932-803b-6738eca55cd6 on your instance and quote it. (Note that quoting is not supported in Mastodon.)