git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git rev-list -S ?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 20, 2012, 20:53 UTC
Message-ID
<7vaa3b570l.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F68CDA4.6060109@ira.uka.de>
Holger Hellmuth <hellmuth@ira.uka.de> writes:
> I read the GsoC page about the ultimate tracking tool just now and
> couldn't find the -S option in git rev-list documentation...
Slippery finger.
|    $ git log -S'it drives an external
|   an external' master Documentation/RelNotes

is a way to find commits that introduced and then removed the block of text to files in the named directory, starting at the tip of 'master'.

Most of the "ultimate tracking tool" dream has already been realized in "git blame" except one major part. Once you find where the blame lies, the tool _could_ help the user to find where these blamed lines came from more than it currently does. Were they typed anew? Were similar lines removed by the commit from other files? Often people run "blame" on a line range they are interested in, find the commits that were blamed, look at "git show $the_found_commit" to see if they can find similar lines in deleted parts of other files and then finally run blame again on the deleted line range of these other files starting from the parent commit of the found commit to do this (and this needs to be repeated). A good GUI should be able to help this process quite a lot, if backed by a good logic to detect "similar" code blocks.

Previous: Christopher TiwaldNext: Jeff King
Message 3 of 5 in “git rev-list -S ?”
  1. Holger HellmuthMar 20, 2012
  2. Christopher TiwaldMar 20, 2012
  3. Junio C HamanoMar 20, 2012
  4. Jeff KingMar 20, 2012
  5. Thomas RastMar 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.