git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GSoC] [RFC] Unify ref-filter formats with other --pretty formats
@ 2019-04-03 19:54 Kapil Jain
  2019-04-04 12:02 ` Olga Telezhnaya
  0 siblings, 1 reply; 2+ messages in thread
From: Kapil Jain @ 2019-04-03 19:54 UTC (permalink / raw)
  To: git, Olga Telezhnaya, Christian Couder, Thomas Gummerer, peff,
	Johannes.Schindelin

Reference: https://git.github.io/SoC-2019-Ideas/#unify-ref-filter-formats-with-other---pretty-formats

I have spent some time with both pretty.* and ref-filter.*

First off, we are aiming to reuse ref-filter, so avoiding any sort of
re-implementation is recommended.

Now, coming to pretty.* and ref-filter.*

suppose, a function named xyz() in ref-filter.c seems like it could be
reused in pretty.c.
since ref-filter doesn't use any struct of pretty.c. The xyz()
function in its original form is not useful for pretty.c.
So now, in order for the xyz() function to be useful in pretty.c.
Function xyz() should be using structs of pretty.*

now, if we make xyz() use the pretty.* structs, then its
re-implementation and not reusing. its like keeping two different
functions one for ref-filter and another for pretty.*.
which is what is already happening.

please provide any starting point for reusing ref-filter. i don't see
any in pretty.*.
reusing ref-filter specifically in pretty.* is not the motive. please
point out any file in entire code base, that you may feel can reuse
some ref-filter logic.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GSoC] [RFC] Unify ref-filter formats with other --pretty formats
  2019-04-03 19:54 [GSoC] [RFC] Unify ref-filter formats with other --pretty formats Kapil Jain
@ 2019-04-04 12:02 ` Olga Telezhnaya
  0 siblings, 0 replies; 2+ messages in thread
From: Olga Telezhnaya @ 2019-04-04 12:02 UTC (permalink / raw)
  To: Kapil Jain
  Cc: git, Christian Couder, Thomas Gummerer, Jeff King,
	Johannes Schindelin

ср, 3 апр. 2019 г. в 22:54, Kapil Jain <jkapil.cs@gmail.com>:
>
> Reference: https://git.github.io/SoC-2019-Ideas/#unify-ref-filter-formats-with-other---pretty-formats
>
> I have spent some time with both pretty.* and ref-filter.*
>
> First off, we are aiming to reuse ref-filter, so avoiding any sort of
> re-implementation is recommended.

It is recommended, but it's normal situation to re-implement something
as a middle step.

>
> Now, coming to pretty.* and ref-filter.*
>
> suppose, a function named xyz() in ref-filter.c seems like it could be
> reused in pretty.c.
> since ref-filter doesn't use any struct of pretty.c. The xyz()
> function in its original form is not useful for pretty.c.
> So now, in order for the xyz() function to be useful in pretty.c.
> Function xyz() should be using structs of pretty.*
>
> now, if we make xyz() use the pretty.* structs, then its
> re-implementation and not reusing. its like keeping two different
> functions one for ref-filter and another for pretty.*.
> which is what is already happening.

It's OK as the middle step. Another approach is to add using
ref-filter structures and continue using existing ones, so that you
have 2 duplicating flows of data. Reuse ref-filter logic, and then in
the end of the patch delete duplicating logic from pretty. Both these
approaches could be useful, choose any of them or design your own way.
I deleted so much code that I wrote, I advice you try not to afraid of
it. It's OK to make something and then rewrite it several times. The
only thing that matters is the final result.

>
> please provide any starting point for reusing ref-filter. i don't see
> any in pretty.*.
> reusing ref-filter specifically in pretty.* is not the motive. please
> point out any file in entire code base, that you may feel can reuse
> some ref-filter logic.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-04 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 19:54 [GSoC] [RFC] Unify ref-filter formats with other --pretty formats Kapil Jain
2019-04-04 12:02 ` Olga Telezhnaya

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).