Skip to content

Instantly share code, notes, and snippets.

@tlync
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlync/852be00dcab8a4a5d237 to your computer and use it in GitHub Desktop.
Save tlync/852be00dcab8a4a5d237 to your computer and use it in GitHub Desktop.
2014/10/16 社内LT - 人を恨むな仕組みを恨め

%title: %author: Takuya Fujimura (@tlync) %date: 2014-10-16


人を恨むな仕組みを恨め


FAMILAR STORY

ScalaStyle で静的解析しているけど、誰も守ってくれない、気にしてくれない…

PR 送る前にテストが通っているかを確認してない… 落ちてるじゃん…

ゴミみたいなコミット入ってる… 確認しろや


WHAT IS PROBLEM?

人ではなく仕組み


FIX BY PROCESS

git pre-push 1.8.2 higher


USE CASE

以下の様な場合に push させない

  • テストに失敗する
  • 静的解析で閾値以上の警告が発生した
  • -- の様な、ゴミみたいなコミットが入っている

MINIMUM EXAMPLE

\ #!/bin/bash \ read -p "Are you sure?" -n 1 -r < /dev/tty \ echo \ if [[ $REPLY =~ ^[Yy]$ ]] \ then \ exit 0 # push will execute \ fi \ exit 1 # push will not execute


DEMO


FOR [WIP] BRANCH

git push fix-hoge --no-verify


SUMMARY

git pre-push を使って無駄な指摘を減らそう


THX

https://gist.github.com/tlync/0b66846a6a16794a6313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment