Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 34 lines (24 sloc) 0.897 kB
#!/bin/sh
# git-line-history --- Track changes in a line from a file using git.
# Copyright © 2009 2010 2011 Sebastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
# Last changed: 2011-03-26 02:19:41
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
VERSION="1.0"
if test "$#" != "2"; then
echo "Usage: $0 file regexp"
exit 1
fi
file=$1
regexp=$2
id=$(git rev-parse HEAD)
while test "$id" != ""; do
line=$(git blame -l -s ${id}^1 $file 2>/dev/null | perl -ne \
"print \"\$1:\$3\n\" if /^([0-9a-f]{40})\s+(.*\s+)?[0-9]+\)(.*$regexp.*)\$/;")
echo "$line"
id=$(echo $line | cut -f1 -d':')
done
exit 0
Jump to Line
Something went wrong with that request. Please try again.