git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Gummerer <t.gummerer@gmail.com>
To: Kapil Jain <jkapil.cs@gmail.com>
Cc: Olga Telezhnaya <olyatelezhnaya@gmail.com>,
	git <git@vger.kernel.org>,
	Christian Couder <christian.couder@gmail.com>
Subject: Re: [GSoC] Unify ref-filter formats with other --pretty formats
Date: Sun, 31 Mar 2019 19:49:30 +0100	[thread overview]
Message-ID: <20190331184930.GV32487@hank.intra.tgummerer.com> (raw)
In-Reply-To: <CAMknYEPN2rPsX8CcJVosi-S1W8bLTmMMvgS8E-SwyR74gevtcA@mail.gmail.com>

On 03/31, Kapil Jain wrote:
> On Fri, Mar 29, 2019 at 7:23 PM Kapil Jain <jkapil.cs@gmail.com> wrote:
> >
> > On Thu, Mar 28, 2019 at 11:14 PM Olga Telezhnaya
> > <olyatelezhnaya@gmail.com> wrote:
> > >
> > > Unfortunately, I can't consult you properly about structure of
> > > pretty.c. I guess that would be your first task of the internship to
> > > dive into it and think how to improve it. By the way, you could try to
> > > make more detailed documentation and that could be one of your first
> > > contributions. It will help you to understand the system better, and
> > > other contributors will be happy to read it.
> >
> 
> i traced the cmd_log() to understand the point at which pretty.c could
> be used, i only got to userformat_find_requirements().
> 
> struct userformat_want {
>     unsigned notes:1;
>     unsigned source:1;
> };
> 
> what are notes and source flags used for ?

If you look at what userformat_find_requirements() does, calls
strbuf_expand(), which in turn calls userformat_want_item(), which
fills the 'userformat_want' struct based on the strbuf that has been
passed.

Now if we look at the caller of userformat_find_requirements(), which
is cmd_log_init_finish(), you can see where 'w.notes' and 'w.source'
is used. 

Just this parsing is probably not something that the ref-filter API
can help too much with.

I unfortunately don't have much experience with the pretty, or the
ref-filter API.  But rather than going into the details of the code
already, I'd suggest first looking at what you actually want to
replace (see for example the PRETTY FORMATS section in 'man git-log',
what which verbs you can use in the ref-filter (see 'man
git-for-each-ref') to achieve the same thing.

Then you can see how one format is implemented in 'pretty.c', and see
how a similar thing using the ref-filter is implemented in
'ref-filter.c'.

E.g. the "%(objectname:short) %(contents:subject)" (this is missing
coloring, but just to get you the idea) is similar to
'--pretty=oneline'.  Now you can try to find how 'oneline' is
implemented in 'pretty.c', and you could translate that to use the
'ref-filter' API.

  reply	other threads:[~2019-03-31 18:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 19:26 [GSoC] Unify ref-filter formats with other --pretty formats Kapil Jain
2019-03-25 21:17 ` Olga Telezhnaya
2019-03-27 17:01   ` Kapil Jain
2019-03-28 17:43     ` Olga Telezhnaya
2019-03-29 13:53       ` Kapil Jain
2019-03-31 17:45         ` Kapil Jain
2019-03-31 18:49           ` Thomas Gummerer [this message]
2019-04-01 12:58             ` Kapil Jain
2019-03-31 19:28           ` Olga Telezhnaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190331184930.GV32487@hank.intra.tgummerer.com \
    --to=t.gummerer@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jkapil.cs@gmail.com \
    --cc=olyatelezhnaya@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).