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

Re: Having grep support the -o option

From
Christian Couder <christian.couder@gmail.com>
Date
Mar 22, 2022, 06:08 UTC
Message-ID
<CAP8UFD1+3FWYWZscMgg13T7tYxgB7HKSFiierehdYhuHq54F-A@mail.gmail.com>
In-Reply-To
<CANsrJQdqoz7mZ9Fj08owgVWGKs25nPzE1g1dLASL=fz9j485hw@mail.gmail.com>
On Sun, Mar 20, 2022 at 8:14 PM Jayati Shrivastava <gaurijove@gmail.com> wrote:
Show 20 quoted lines
>
> On Sat, Mar 19, 2022 at 9:49 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> >
> >
> > One thing I'd *really* like to see is the bits of %(if) %(then)
> > etc. extracted from ref-filter.c into some general API other commands
> > could use with strbuf_expand() and friends.
> >
> > I.e. if you could in addition to the strbuf_expand() callback define
> > what verbs you support for "if" and the like, or have callbacks for
> > their comparison functions.
> >
> > Then have that machinery drive the whole format expansion, which
> > eventually would expand your %(some-custom-thing) via a callback.
> >
> > I.e. the whole "valid_atom" state machine in ref-filter.c.
>
> So, the end goal is to design a formatting API that can be used by any
> command that takes --format option?

It might be nice if we get closer to this after your GSoC project, but I don't think it should become the main goal of the GSoC.

> Previous interns worked on
> unifying pretty.c and cat-file.c with ref-filter.c and so the next task can
> be to extend "valid_atom" state machine to work with more commands.

Note that performance issues have been a really big issue in unifying cat-file.c with ref-filter.c.

> Do you have any suggestions for new atoms/verbs I could add
> support for or any such similar small exercise to start with?

It would be nice if we first got an idea of the features in pretty.c that do not yet have something similar in ref-filter.c. I think Hariom used to show how features in pretty.c corresponded to features in ref-filter.c, and this helped with deciding about the next steps to take.

Previous: Jayati ShrivastavaNext: Ævar Arnfjörð Bjarmason
Message 11 of 13 in “[GSoC] Some #leftoverbits for anyone looking for little projects”
  1. Ævar Arnfjörð BjarmasonMar 17, 2018
  2. Matheus TavaresMay 20, 2019
  3. Ævar Arnfjörð BjarmasonMay 20, 2019
  4. Matheus Tavares BernardinoMay 21, 2019
  5. Johannes SchindelinMay 28, 2019
  6. Matheus Tavares BernardinoMay 28, 2019
  7. Johannes SchindelinMay 28, 2019
  8. Johannes SchindelinMay 29, 2019
  9. Johannes SchindelinMay 29, 2019
  10. Jayati ShrivastavaMar 20, 2022
  11. Christian CouderMar 22, 2022
  12. Ævar Arnfjörð BjarmasonMar 22, 2022
  13. Jayati ShrivastavaMar 23, 2022

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.