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

Re: Can't find the revelant commit with git-log

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Feb 10, 2011, 18:50 UTC
Message-ID
<4D54337B.6040307@lsrfire.ath.cx>
In-Reply-To
<7vk4hbsbjr.fsf@alter.siamese.dyndns.org>
Am 07.02.2011 23:51, schrieb Junio C Hamano:
Show 23 quoted lines
> René Scharfe<rene.scharfe@lsrfire.ath.cx>  writes:
>
>> diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
>> index f7181d1..50ffcf4 100755
>> --- a/t/t6016-rev-list-graph-simplify-history.sh
>> +++ b/t/t6016-rev-list-graph-simplify-history.sh
>> @@ -168,6 +168,7 @@ test_expect_success '--graph --full-history --simplify-merges -- bar.txt' '
>>   	echo "|\\  ">>  expected&&
>>   	echo "| * $C4">>  expected&&
>>   	echo "* | $A5">>  expected&&
>> +	echo "* | $A4">>  expected&&
>>   	echo "* | $A3">>  expected&&
>>   	echo "|/  ">>  expected&&
>>   	echo "* $A2">>  expected&&
>
> Thanks for a patch with a test; I am not sure if this is quite correct,
> though.
>
> A4 has three parents, C2, A3 and B2, and does not introduce any change
> with respect to bar.txt.  A6 has bar.txt identical to that of A5, but we
> cannot omit it because we are showing its two parents (A5 and C4), and
> that is why we show it.  A4 isn't even gets shown as a merge, so I don't
> understand why we need to show it?

Yes, this looks a bit silly on closer look. I thought that it matches Francis' use case, but that's wrong -- having --simplify-merges instead of -Sstring makes a difference, obviously.

After looking at the case again, I think I have a simpler solution: no code change, just add --sparse (include all walked commits). This gives the same results as the patched version:

	$ git log --oneline -m --sparse --full-history \
		-Sblacklist_iommu v2.6.26..v2.6.29 -- \
		drivers/pci/intel-iommu.c | wc -l
	    160
Sorry for the noise.

So, the lesson would be: If you want to find commits that removed a certain string in a certain set of files, add --full-history, -m and --sparse to your "git log -Sstring -- files" command. This allows you to catch merges that reverted those files to a state before the string was introduced in the first place, otherwise history simplification can hide them.

I'm not sure if there's a way to make the flags and their interactions more intituitive.

René
Previous: Junio C HamanoNext: René Scharfe
Message 21 of 30 in “Can't find the revelant commit with git-log”
  1. Francis MoreauJan 25, 2011
  2. René ScharfeJan 25, 2011
  3. Francis MoreauJan 25, 2011
  4. Francis MoreauJan 26, 2011
  5. Johannes SixtJan 26, 2011
  6. Francis MoreauJan 26, 2011
  7. Sverre RabbelierJan 26, 2011
  8. Francis MoreauJan 26, 2011
  9. Sverre RabbelierJan 26, 2011
  10. Francis MoreauJan 26, 2011
  11. Junio C HamanoJan 26, 2011
  12. Francis MoreauJan 26, 2011
  13. René ScharfeJan 26, 2011
  14. René ScharfeJan 28, 2011
  15. Junio C HamanoJan 29, 2011
  16. René ScharfeJan 29, 2011
  17. Junio C HamanoJan 29, 2011
  18. René ScharfeJan 29, 2011
  19. Junio C HamanoFeb 1, 2011
  20. Junio C HamanoFeb 7, 2011
  21. René ScharfeFeb 10, 2011
  22. René ScharfeJan 29, 2011
  23. René ScharfeJan 28, 2011
  24. Francis MoreauJan 29, 2011
  25. René ScharfeJan 29, 2011
  26. Francis MoreauJan 29, 2011
  27. René ScharfeJan 29, 2011
  28. Francis MoreauJan 26, 2011
  29. René ScharfeJan 26, 2011
  30. Francis MoreauJan 26, 2011

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.