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

Re: [PATCH v3 05/11] ref-filter: add parse_opt_merge_filter()

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 17, 2015, 08:27 UTC
Message-ID
<vpqzj3yzqma.fsf@anie.imag.fr>
In-Reply-To
<CAOLa=ZS_gY-MuGJ86TFpHhMXNYJ1gHWQWyfv71gDCVm1sMXZNw@mail.gmail.com>
karthik nayak <karthik.188@gmail.com> writes:
Show 22 quoted lines
> On Tue, Jun 16, 2015 at 9:48 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>> Karthik Nayak <karthik.188@gmail.com> writes:
>>
>>> This is copied from 'builtin/branch.c' which will eventually be removed
>>> when we port 'branch.c' to use ref-filter APIs.
>>
>> Earlier in the series you took code from tag.c.
>>
>> I think you should focus on either merge or tag, get a ref-filter-based
>> replacement that passes the tests for it, and then consider the other.
>> The fact that the test pass for a rewritten command is important to
>> check the correctness of the these patches.
>>
>> I'm not asking you to remove commits from this series though. Just
>> impatient to see one command fully replaced (actually, I see that you
>> have more commits than you sent in your branch, so I guess it will come
>> soon on the list) :-).
>>
>
> The idea is to currently get ref-filter to support all options and port it over
> to for-each-ref which would be the first command to completely use ref-filter.
Err, for-each-ref already uses it before this series, no?

So, you don't need any extra option to get for-each-ref, because it is already there. Having these extra options is a good side effect, though.

To make sure I'm clear enough, what you're doing is
- add all options to for-each-ref
- port tag.c
- port branch.c
What I'm suggesting is to prioritize this way
- add all options required for tag.c
- port tag.c
- add all options required for branch.c
- port branch.c
> And like you said, the challenge is to then ensure tag.c and branch.c to use
> ref-filter and make them pass all tests.

Not only the challenge, but also the way to validate your work. Think of it as a rather comprehensive set of tests that you get for free once you ported a command.

BTW, talking about tests, did you do some coverage analysis on git branch and git tag? If not, I'd suggest that you do this to make sure that the pieces of code you're rewritting using ref-filter are well tested before being rewritten (a bit like Paul's work on shell -> C). You don't have to actually do this before porting, but it should come befor the port in the patch series to make sure that tests pass both the old and new implementation.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: karthik nayakNext: karthik nayak
Message 11 of 23 in “add options to for-each-ref”
  1. 00/11 add options to for-each-refkarthik nayak, Jun 16, 2015
  2. 01/11 t6301: for-each-ref tests for ref-filter APIsKarthik Nayak, Jun 16, 2015
  3. 02/11 tag: libify parse_opt_points_at()Karthik Nayak, Jun 16, 2015
  4. 03/11 ref-filter: implement '--points-at' optionKarthik Nayak, Jun 16, 2015
  5. 04/11 for-each-ref: add '--points-at' optionKarthik Nayak, Jun 16, 2015
  6. Matthieu MoyJun 16, 2015
  7. karthik nayakJun 16, 2015
  8. 05/11 ref-filter: add parse_opt_merge_filter()Karthik Nayak, Jun 16, 2015
  9. Matthieu MoyJun 16, 2015
  10. karthik nayakJun 16, 2015
  11. Matthieu MoyJun 17, 2015
  12. karthik nayakJun 17, 2015
  13. 06/11 ref-filter: implement '--merged' and '--no-merged' optionsKarthik Nayak, Jun 16, 2015
  14. Matthieu MoyJun 17, 2015
  15. karthik nayakJun 17, 2015
  16. 07/11 for-each-ref: add '--merged' and '--no-merged' optionsKarthik Nayak, Jun 16, 2015
  17. 08/11 parse-option: rename parse_opt_with_commit()Karthik Nayak, Jun 16, 2015
  18. 09/11 parse-options.h: add macros for '--contains' optionKarthik Nayak, Jun 16, 2015
  19. 10/11 ref-filter: implement '--contains' optionKarthik Nayak, Jun 16, 2015
  20. 11/11 for-each-ref: add '--contains' optionKarthik Nayak, Jun 16, 2015
  21. Matthieu MoyJun 17, 2015
  22. Matthieu MoyJun 16, 2015
  23. karthik nayakJun 16, 2015

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.