3 ms·
While we're at it: git_show_blame () { if [ -z "$3" ] then printf "USAGE: git_show_blame filepath start_line_num end_line_num" && return 1
by __blockcipher__ 8y ago
While we're at it:
git_show_blame () {
if [ -z "$3" ]
then
printf "USAGE: git_show_blame filepath start_line_num end_line_num" && return 1
else
[ ! -z "$4" ] && printf "\\n${LPURP}[git_show_blame]${NC} Warning: extra arguments provided. Ignoring everything after the first 3\\n\\n"
git show $(git blame "$1" -L "$2","$3" | awk '{print $1}')
return $?
fi
}
Use with recursive search `grep -Rn your_regex .` to track down the original commit that your pesky coworker added two years ago without any corresponding documentation for an alert that's going critical at 2am...(only slightly exaggerating there :P)