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

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

From
Stefan Beller <sbeller@google.com>
Date
Dec 12, 2017, 00:21 UTC
Message-ID
<CAGZ79kaJgCchQKcRMkW-cjRmx_7eYQDqLs5GgDOgLEb1H=w-0g@mail.gmail.com>
In-Reply-To
<xmqqr2s04zxw.fsf@gitster.mtv.corp.google.com>
On Mon, Dec 11, 2017 at 3:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> the information to what is shown. For example:
>>
>>   $ ./git log --oneline --blobfind=v2.0.0:Makefile
>>   b2feb64309 Revert the whole "ask curl-config" topic for now
>>   47fbfded53 i18n: only extract comments marked with "TRANSLATORS:"
>
> This part is a bit stale???
fixed in the next reroll :(
Show 10 quoted lines
>> +--find-object=<object-id>::
>> +     Restrict the output such that one side of the diff
>> +     matches the given object id. The object can be a blob,
>> +     or gitlink entry.
>
> OK.  In principle you should also be able to find a tree, but I do
> not now how useful it would be.  Extending it to gitlink, which is
> another kind of leaf node in the reachability DAG, does make tons of
> sense---it's a no brainer that I feel ashamed not to have thought of
> myself ;-)

The current patch under discussion doesn't find trees, though. Hence the documentation is accurate saying that only blobs and gitlinks work.

Show 7 quoted lines
>
>> +LIB_OBJS += diffcore-oidfind.o
>
> Just to nitpick, but "blobfind" was to find "blob", and if you are
> extending it to find any "object", then that should be "objfind".
> "oid" is _A_ way to refer to an object (i.e. the _name_ of it), and
> name is *not* the same as the thing the name refers to, so...
obj-find sounds good.
Show 11 quoted lines
>
>> +static int parse_oidfind_opt(struct diff_options *opt, const char *arg)
>> +{
>> +     struct object_id oid;
>> +
>> +     /* We don't even need to have the object, any oid works. */
>> +     if (get_oid_blob(arg, &oid))
>> +             return error("unable to resolve '%s'", arg);
>
> Should this still be get_oid_blob(), or should it be less specific
> to blobs?

We could check if it is a tree/commit and die as they are not being handled correctly.

Previous: Junio C HamanoNext: Stefan Beller
Message 15 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.