Re: [GSoC] Unify ref-filter formats with other --pretty formats
- Date: Tue, 26 Mar 2019 00:17:56 +0300
- From: Olga Telezhnaya <olyatelezhnaya@xxxxxxxxx>
- Subject: Re: [GSoC] Unify ref-filter formats with other --pretty formats
пн, 25 мар. 2019 г. в 22:27, Kapil Jain <jkapil.cs@xxxxxxxxx>:
> Below are some two queries concerning
> In pretty.h & pretty.c:
> void get_commit_format(const char *arg, struct rev_info *);
> This function Parses given arguments from "arg", checks it for
> correctness and * fill struct rev_info.
> In ref-filter.h & ref-filter.c:
> int verify_ref_format(struct ref_format *format);
> This function is Used to verify if the given format is correct and to
> parse out the used atoms.
> Now, the verify_ref_format function can be used inside
> get_commit_format function, hence reusing logic.
> Is this a correct example to work on, for this project ?
Hi! Yes, in my opinion your example looks like good starting point.
> If not, please point out an example so as to understand the problem
> statement better.
> Other than this I can't find any other example, for this project in
> pretty.* and ref-filter.*
> Perhaps some examples could be found in command specific files, right ?
Other parts of the project are about reusing other ref-filter logic.
For example, we could try to reuse format_ref_array_item() from
ref-filter.h. I haven't dig into pretty.c logic much, but I guess it
is possible to translate "pretty" formatting commands to ref-filter
ones. That will allow us to remove similar logic from pretty.c. Our
final goal is to minimise code duplication and to have one unified
interface to extract all needed data from object and to print it
> About a recurring term 'atom' in ref-filter and pretty:
> what is atom ? is it a piece of a whole document ? and what is meant
> by used atoms ?
I had the same question in my beginning. Please have a look at .
Another good question - what is object. You could ensure that you
understand this by reading .