git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to track the history of a line in a file
@ 2009-01-02 22:13 david
  2009-01-02 21:26 ` Jeff King
  2009-01-06 15:48 ` Bernt Hansen
  0 siblings, 2 replies; 17+ messages in thread
From: david @ 2009-01-02 22:13 UTC (permalink / raw)
  To: git

I have a need to setup a repository where I'm storing config files, and I 
need to be able to search the history of a particular line, not just when 
the last edit of the line was (which is what I see from git blame)

I'm not seeing a obvious way to do this, am I missing something or does it 
need a non-obvious approach?

for example, if I do

git blame -L /SUBLEVEL/,+1 -M Makefile

on the linux kernel it currently shows

57f8f7b6 (Linus Torvalds 2008-10-23 20:06:52 -0700 3) SUBLEVEL = 28

what I would want it to show would be a list of the commits that have 
changed this line.

It looks like I can write a script to do this

git blame -L /SUBLEVEL/,+1 -M Makefile 57f8f7b6^
6e86841d (Linus Torvalds 2008-07-28 19:40:31 -0700 3) SUBLEVEL = 27
git blame -L /SUBLEVEL/,+1 -M Makefile 6e86841d^
2ddcca36 (Linus Torvalds 2008-05-03 11:59:44 -0700 3) SUBLEVEL = 26

etc.

is there a better way to do this?

David Lang

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-01-06 16:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02 22:13 how to track the history of a line in a file david
2009-01-02 21:26 ` Jeff King
2009-01-02 22:43   ` david
2009-01-02 21:49     ` Jeff Whiteside
2009-01-02 22:58       ` david
2009-01-02 23:01   ` david
2009-01-02 23:48     ` david
2009-01-02 22:54       ` Junio C Hamano
2009-01-03  0:59         ` david
2009-01-03  0:07           ` Thomas Rast
2009-01-03  2:05             ` david
2009-01-02 23:56       ` david
2009-01-03  4:25         ` david
2009-01-06 15:48 ` Bernt Hansen
2009-01-06 16:08   ` Miklos Vajna
2009-01-06 16:21     ` Bernt Hansen
2009-01-06 16:28       ` Bernt Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).