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

Re: [PATCH] diffcore: add a filter to find a specific blob

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2017, 22:44 UTC
Message-ID
<xmqqefnxrktm.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171214212234.GC32842@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 18 quoted lines
> Putting it in context, we have:
>
> 	pickaxe options:
> 	-S: detect changes in occurence count of a string
> 	-G: grep lines in diff for a string
>
> 	--pickaxe-all:
> 		do not filter the diff when the patch matches pickaxe
> 		conditions.
>
> 		kind of like log --full-diff, but restricted to pickaxe
> 		options.
> 	--pickaxe-regex: treat -S argument as a regex, not a string
>
> Is this another kind of pickaxe option?  It feels similar to -S, but
> at an object level instead of a substring level, so in a way it would
> be appealing to call it --pickaxe-object.  Does --pickaxe-all affect
> it like it affects -S and -G?
It does feel quite close to -S, but is slightly different.

Instead of spelling out the exact contents to pass as the argument to the -S option, you are giving a blob object name instead.

However, if you rename path F to G without any modification, or if you flip only the mode bits, -S would reject such a filepair, as both sides have the same number of the sought-after string, I think. Unlike -S, this new thing should show such a filepair because it is designed to show any filepair with either (or both) side has the sought-after object.

We could make this identical to -S, i.e. only when a filepair has sought-after object on either (or both) sides *and* its pre and post image sides do not talk about the same object.

    Note.  I am phrasing the above awkwardly because we can ask for
    more than one object, and a filepair that changes a path from
    object A to object B, both of which are what we are looking for,
    want to be caught.  If I phrased the above as "only when only
    one side of a filepair has an object we are looking for and the
    other side does not", such a filepair would not be shown.
I have a suspicion that such a change may be worthwhile.
Show 5 quoted lines
> Another context to put it in is:
>
> 	--diff-filter:
> 		limit paths (but not commits?) to those with a change
> 		matching optarg

IIUC, this is applied at the output phase after all of the rename, pickaxe etc. are done (e.g. "Now you have the diff to give me, show me only the additions in it"). It is a poor match for this new thing, as "Now you have the diff to give me, show me only the ones that involve these blobs" does not sound all that useful.

Previous: Junio C Hamano
Message 25 of 25 in “diffcore-blobfind”
  1. 0/1 diffcore-blobfindStefan Beller, Dec 8, 2017
  2. 1/1 diffcore: add a filter to find a specific blobStefan Beller, Dec 8, 2017
  3. Jeff KingDec 8, 2017
  4. Ramsay JonesDec 8, 2017
  5. Jeff KingDec 8, 2017
  6. Stefan BellerDec 8, 2017
  7. Jeff KingDec 8, 2017
  8. Junio C HamanoDec 8, 2017
  9. Junio C HamanoDec 8, 2017
  10. Stefan BellerDec 8, 2017
  11. Junio C HamanoDec 8, 2017
  12. 0/1 diff-core blobfindStefan Beller, Dec 11, 2017
  13. 1/1 diffcore: add a filter to find a specific blobStefan Beller, Dec 11, 2017
  14. Junio C HamanoDec 11, 2017
  15. Stefan BellerDec 12, 2017
  16. diffcore: add a filter to find a specific blobStefan Beller, Dec 12, 2017
  17. Junio C HamanoDec 12, 2017
  18. Jonathan NiederDec 14, 2017
  19. Stefan BellerDec 14, 2017
  20. Jonathan NiederDec 14, 2017
  21. Junio C HamanoDec 15, 2017
  22. Stefan BellerDec 27, 2017
  23. Jonathan NiederDec 27, 2017
  24. Junio C HamanoDec 27, 2017
  25. Junio C HamanoDec 14, 2017

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.