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

Re: [PATCH] gitk: add support for -G'regex' pickaxe variant

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 13, 2013, 18:55 UTC
Message-ID
<20130513185551.GB3657@google.com>
In-Reply-To
<CACPiFCKkzSCaSfqExZggFHBAmcPBTYYhyauOa2h1dXiYqKZMxA@mail.gmail.com>
Martin Langhoff wrote:
> And to be honest, log -G is so much more useful that I don't care a
> s***t for log -S.
Fair enough. :)
[...]
Show 5 quoted lines
> In other words: You find a suspicious-looking line of code and you ask
> "how did this horrid code come to be?", and the more horrendous the
> code is, the more likely it is to be the accretion of a several
> commits. In that case, which to me is the common case, log -S ain't
> your friend at all.

My experience is the opposite. I wonder "What did the author of this nonsense comment mean?" or "What is the purpose of this strange condition in this if () statement?". Then "git log -S" finds the culprit without showing extraneous unrelated changes (such as reindenting). It is like "git blame", but for arbitrary chunks of code instead of single lines. Then, just like with "git blame", at times the next step is to blame the parent and repeat the process using the earlier form of the code in question.

It is especially handy for confusing code that spans multiple lines. (Unfortunately that is not as easy to try in gitk.)

As I mentioned before, log -G and log -S are fairly dissimilar operations.

Thanks, Jonathan

Previous: Martin LanghoffNext: Martin Langhoff
Message 13 of 20 in “gitk: add support for -G'regex' pickaxe variant”
  1. gitk: add support for -G'regex' pickaxe variantMartin Langhoff, Jun 8, 2012
  2. Zbigniew Jędrzejewski-SzmekJun 9, 2012
  3. Junio C HamanoJun 10, 2012
  4. Paul MackerrasJun 10, 2012
  5. Junio C HamanoJun 10, 2012
  6. gitk: add support for -G'regex' pickaxe variantZbigniew Jędrzejewski-Szmek, Jun 14, 2012
  7. Martin LanghoffMay 7, 2013
  8. Felipe ContrerasMay 7, 2013
  9. Paul MackerrasMay 11, 2013
  10. Jonathan NiederMay 11, 2013
  11. Paul MackerrasMay 11, 2013
  12. Martin LanghoffMay 13, 2013
  13. Jonathan NiederMay 13, 2013
  14. Martin LanghoffMay 13, 2013
  15. Jonathan NiederMay 13, 2013
  16. Martin LanghoffMay 13, 2013
  17. Junio C HamanoMay 13, 2013
  18. Ramkumar RamachandraMay 13, 2013
  19. Jonathan NiederMay 13, 2013
  20. Jonathan NiederMay 13, 2013

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.