Re: how to track the history of a line in a file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: david
Date: Friday, January 2, 2009 - 4:48 pm

On Fri, 2 Jan 2009, david@lang.hm wrote:

<SNIP>

I was misunderstanding git blame

new script is

#!/bin/bash
line=`git blame -n -b -l -L /$1/,+1 -M $2`
echo "-$line"
foundCOMMIT=`echo "$line" |cut -c -40`
foundline=`echo "$line" |cut -c 42- |cut -f 1 -d " "`
while [ "$foundCOMMIT" != "                                        " ] ;do
#git diff -U0 $foundCOMMIT..$foundCOMMIT^ $2
line=`git blame -n -b -l -L $foundline,+1 -M $2 $foundCOMMIT^`
echo "-$line"
foundCOMMIT=`echo "$line" |cut -c -40`
foundline=`echo "$line" |cut -c 42- |cut -f 1 -d " "`
done

this seems to be working for me now.

David Lang
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: how to track the history of a line in a file, Jeff King, (Fri Jan 2, 2:26 pm)
Re: how to track the history of a line in a file, Jeff Whiteside, (Fri Jan 2, 2:49 pm)
Re: how to track the history of a line in a file, Junio C Hamano, (Fri Jan 2, 3:54 pm)
Re: how to track the history of a line in a file, david, (Fri Jan 2, 4:48 pm)
Re: how to track the history of a line in a file, Thomas Rast, (Fri Jan 2, 5:07 pm)
Re: how to track the history of a line in a file, Bernt Hansen, (Tue Jan 6, 8:48 am)
Re: how to track the history of a line in a file, Miklos Vajna, (Tue Jan 6, 9:08 am)
Re: how to track the history of a line in a file, Bernt Hansen, (Tue Jan 6, 9:21 am)
Re: how to track the history of a line in a file, Bernt Hansen, (Tue Jan 6, 9:28 am)