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

Re: git log -S not finding all commits?

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Oct 8, 2009, 22:02 UTC
Message-ID
<20091009070213.6117@nanako3.lavabit.com>
In-Reply-To
<7ae12651.522df17b.4acda0f5.21a31@o2.pl>
Quoting Daniel <mjucde@o2.pl>
Show 14 quoted lines
> $ git version
> git version 1.6.4.4
> $ mkdir a && cd a && git init
> $ echo "Free data" > a
> $ git add a
> $ git commit -m1
> $ echo "Free data allocated by other function" > a
> $ git commit -a -m2
> $ PAGER=cat git log -S'Free' --oneline
> 2f34241 1
>
> I would expect "git log" to show both 1 and 2 commit, but it prints only 1.
>
> Is it the correct behavior?
Junio described how various features in git were invented to realize the goal of "Linus's ultimate content tracking" in his blog http://gitster.livejournal.com/35628.html (and he extended on the article in a chapter in his book that was published in Japan last month).
The "pickaxe" search is one of such components. It is meant to be given the block of lines you are interested in the newer version and used to find the commit that changes anything in the given block of lines. For details, see his blog article (item no. 3) at the above URL (and other items as well, if you are interested in learning the history of other notable features).
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Scott Wiersdorf
Message 15 of 15 in “git log -S not finding all commits?”
  1. DanielOct 8, 2009
  2. Andreas EricssonOct 8, 2009
  3. DanielOct 8, 2009
  4. Matthieu MoyOct 8, 2009
  5. Matthieu MoyOct 8, 2009
  6. DanielOct 8, 2009
  7. Matthieu MoyOct 8, 2009
  8. Randal L. SchwartzOct 8, 2009
  9. Matthieu MoyOct 9, 2009
  10. Scott WiersdorfOct 9, 2009
  11. Randal L. SchwartzOct 9, 2009
  12. Matthieu MoyOct 9, 2009
  13. Randal L. SchwartzOct 9, 2009
  14. Scott WiersdorfOct 9, 2009
  15. Nanako ShiraishiOct 8, 2009

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.