git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GSOC] [PROPOSAL v3] Draft of proposal for "Unify ref-filter formats with other pretty formats"
@ 2023-04-03 17:45 Zhang Yi
  2023-04-10  8:10 ` Zhang Yi
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Yi @ 2023-04-03 17:45 UTC (permalink / raw)
  To: Zhang Yi, git, christian.couder, hariom18599

Thanks for Christian Couder's comments. I realize that I should have a deeper
understanding of this project. So I have tried related commands and read related
documents.

Improvement vs v2:
1. A re-designed plan.
2. Put section "Estimated Timeline" next to "Steps".
3. Add parts about works of Nsengiyumva Wilberforce.
4. Fix some spell mistakes.

There seems no time left for a cycle of re-draft. Could I submit this proposal?

Thanks for all comments.

* Unify ref-filter formats with other pretty formats

* Personal Information

Full name: Zhang Yi

E-mail: 18994118902@163.com
Tel: (+86)18994118902

Education: Wuhan University of Technology (China)
Major: Computer engineering 
Year: First-year postgraduate student

Github: https://github.com/zhanyi22333

*  Synopsis

** Motivation

Git has different implements to format command output, which makes chaos and
hinder improvement of code quality.

Aim to unify the different implementations to format output for different
commands, we want to transform pretty into ref-filter formatting logic. According
to the present situation, I may need to add more ref-filter atoms to replace
pretty. After all pretty atoms have corresponding atoms in ref-filter, we still
need to reuse ref-filter in pretty. To promise the backward compatibility, it is
better to translate a pretty formatting string to a ref-filter formatting string,
then use ref-filter's functions to complete the formatting process.


** Previous Work

  - `git for-each-ref`, `git branch` and `git tag` formats into the
ref-filter formats:

done by Karthik Nayak (GSoC 2015)

  -  `git cat-file` formats and the ref-filter formats:

started by Olga Telezhnaya (Outreachy 2017-2018),
continued by ZheNing Hu (GSoC 2021),
but still not finished due to tricky performance issues.

  - ref-filter formats and pretty formats:

tarted by Hariom Verma (GSoC 2020)
continued a bit by Jaydeep Das. (GSoC 2022)
Nsengiyumva Wilberforce continued to work on this during the time of Outreachy
and after Outreachy with persistence. His work on the "signature" atom
should be mostly over when the GSoC starts. (Outreachy 2022-2023)

Here are links to their blogs or works.
- Olga Telezhnaya: Here are Olga Telezhnaya's detailed and helpful blogs.[1]
- ZheNing Hu: There are a lot of patches which are concluded in his final
blog [2]
- Hariom Verma: There are also a lot of patches which are concluded in his final
blog [3]
- Jaydeep Das: Patch: gpg-interface: add function for converting trust level to
string [4]
- Nsengiyumva Wilberforce:Patch: ref-filter: add new atom "signature" atom [5]

** What is left

Since the work of "signature" atoms will be finished by Nsengiyumva Wilberforce,
There may be some other atoms left for ref-filter formats and pretty formats.
After I checked the documents of pretty and ref-filter, I found that the '%w' in
pretty seems has no substitute in ref-filter. And the '%m' placeholder may also
need a substitute.

** Steps

1. Try best to understand related code. It is necessary to understand the way
ref-filter works. Since the work of adding signature atom by Nsengiyumva 
Wilberforce is strongly related and latest, I think I should pay great attention.
What's more, I may need to understand how align atom works because '%w' has a
range influence and it is better to have the power to control the scale of range
with the help of "%end".
2. Add a file name which is a substitute for '%w'. The code should pass tests and
has related documents.
3. Add a file name which is a substitute for '%m'. The code should pass tests and
has related documents.
4. Recheck the correspondence between the atoms of pretty and ref-filter. There
should be none left.
5.  Work on reusing ref-filter logic in pretty, which looks like a huge project.
I need to have a good understanding on previous works about what should and
shouldn't. It seems a bit earlier for me to think about it.
(Hope I can get to this step)

** Estimated Timeline

The official GSOC code time starts from 05-29 to 08-28, which is 13 weeks.
The period from 06-05 to 06~30 is near the end of the semester. There are many
classes for me. So I guess I may not be productive during this period.
I think it is a bit time-limited if I follow the official timeline. It seems
necessary to do some work in advance.

1. Preparatory work:
 Period:
  04-01 ~ 05-28
  About 8 weeks
 Tasks:
   1. Trying to understand the formatting logic behind pretty and ref-filter.
   2. Make some trial changes to help understanding.
   3. Understand the work of Nsengiyumva Wilberforce.
   4. Figure out the way align atom works.

2. Add a new field name.
 Period:
  05-29 ~ 07-07 (include inactive period)
  Week 1~6
  6 weeks
 Tasks:
  Based on the preparatory work, write a new field name for 'w' placeholder in
  pretty. It should pass tests and be well-documented.
 Deliverables:
    A new field name for 'w' placeholder in pretty.
    Test scripts.
    Added documents.

3. Active code period 1
 Period:
  07-10 ~ 07-28
  Week 7~9
  3 weeks
 Tasks:
  Work on a new filed name to replace 'm' placeholder. Also it need to pass
  tests and be well-documented.
 Deliverables:
    A new field name for 'm' placeholder in pretty.
    Test scripts.
    Added documents.

4. Finishing touches
 Period:
  07-31 ~ 08-26
  Week 10~13
  4 weeks
 Tasks:
  If the previous estimate is over-optimistic, it is time for fault-tolerant.In
  the best condition, I should finish the two new field names. After that, I will
  recheck the correspondence between the atoms of pretty and ref-filter. If
  all preparatory work is done, I will put effort on reusing ref-filter logic in
  pretty.

* Benefits to Community

I'm willing to stay around after the project. By that time, I will be in my
second year without classes. And my tutor has an open mind about my request to
involve in an open source project by now. Considering the subjective and
objective conditions, I think there is a high possibility that I will stay
around.

Particularly, I wish to be a co-mentor if I have the ability. There may be some
difficulties. But what I learn from my finite experience is that you should not
refuse something positive just because of the difficulties in the mind. A
fresh new job may be difficult, but it can show me the possibilities of the
world, which means changing my mind.

What's more, I tried to persuade a schoolmate who I think is kind of obsessed
with technology to take part in an open source community for both self-growth and
companion. And I failed, because he thinks it is hard.  It's always hard to
change Others' deep-rooted ideas by word. But I think the actions speak louder
than words. Maybe after the project, I can change the minds of people around me
about joining an open source community. There may be no visual benefits to the
Git Community but should be beneficial to the whole open source community.

* Microproject

t9700: modernize test scripts [6]

The microproject patches have been merged. The merge info is as below:

commit 8760a2b3c63478e8766b7ff45d798bd1be47f52d
Merge: a2d2b5229e 509d3f5103
Author: Junio C Hamano <gitster@pobox.com>
Date:   Tue Feb 28 16:38:47 2023 -0800

    Merge branch 'zy/t9700-style'

    Test style fixes.

    * zy/t9700-style:
      t9700: modernize test scripts



* Grasp from related work

** From Hariom Verma's blog
Walking through the blogs of Hariom Verma, I find many things useful.

*** Debugging

An extremely informative(step-by-step) debugging guide by Christian. [7]

*** 11 questions for understanding someone's work. [8]

1. What was the goal of each patch?
2. which approach did she took to achieve the goal?
3. what were the goals of the patch series?
4. which approach did she took to achieve the goals?
5. what was the goal of her previous patch series?
6. what was the general direction her patch series were going?
7. why did she took that direction?
8. are there ways to continue in the same direction?
9. are there ways to achieve similar goals?
10. how were her goals similar and different from the goals in my proposal?
11. is it possible to use the same approach?

*** Else

There are many details about his work progress. I can refer to them when I am in
similar situations.

** From ZheNing Hu's blog

*** Time analyzing

Use performance testing tools to analyze the time-consuming steps of
`git cat-file --batch`.

 Using Google's `gperftools`:
1. Add the link parameter `-lprofiler` in `config.mak`: `CFLAGS += -lprofiler`.
2. `make`.
3. Use `CPUPROFILE=/tmp/prof.out /<path>/git cat-file --batch-check
--batch-all-objects`
to run the git and general `prof.out`, which contains the results of
performance analysis.
4. Use `pprof --text /<path>/git /tmp/prof.out` to display the result
in the terminal.

*** About Github CI

"GitHub-Travis CI hints" in Documentation/SubmittingPatches

*** Else

He also writes his process of debugging and optimization in detail. It's worth
deepening into when I need them.

This proposal draft benefits from the works of predecessors much. Thanks.

** From Olga Telezhnaia's blog

1. There is potential emotional problems related to remote works.
2. It may be a good idea to try different ways of communication.
3. I should learn needed expertise. For example, I should learn more about shell
scripts.
4. The plan may change from time to time. But I should talk about it with mentors
every 2-3 weeks to focus on the final goal and middle steps.

* Biograhical information

It is always funny to recall that I first learned about Linux in a stimulated
hacker game in my fresh year in college. After that, I tried to teach myself
Linux and started to know open source projects. Overcome many difficulties and I
finally know something shallow about Linux. As a side effect, I am more
enthusiastic and better at programming compared with my schoolmates. But the
period of stagnation came, I began to write some meaningless projects for school
tasks and repeated myself without progress. The best out of the worst, I touched
excellent open source software during the time, such as vim, emacs, visual
studio code, Qt, VLC and, of course, git. Near the end of my junior year, I read
an article about learning by contributing to an open source project by a geek
in the community of emacs. Almost at the same time, I knew the GSOC and preferred
to take part in git. But it was near the start date of my plan for postgraduate
qualifying examination. So I just postponed the stuff for GSOC.  Luckily, I
passed the examination. After I got used to life as a postgraduate student, I
felt the motivation to progress again. Then I tried to contribute for git. Now I
just finished a micro project, which seems trivial. But it really let me have a
deeper understanding of open source and free software and more motivation to
contribute. I hope I can stay here a long time before being involved with other
interesting projects since the quality is more important than the quantity.
I know it seems a bit stubborn to believe that contributing will lead to
progress, which is also influenced by my learning attitude. But without action,
I can not verify the belief.  Sooat least I will try to contribute for one year.
After that, I hope I can have a better understanding.

Sorry, the above text may be messing. In short, I will try to contribute for
git for at least one year.

* Closing remarks

It seems blogs will help much for later work. I think It worth rebuilding my
blog site on github.

Thanks for Christian Couder's and Hariom Verma's help.


[1] https://medium.com/@olyatelezhnaya
[2] https://public-inbox.org/git/CAOLTT8SxHuH2EbiSwQX6pyJJs5KyVuKx6ZOPxpzWLH+Tbz5F+A@mail.gmail.com/
[3] https://harry-hov.github.io/blogs/posts/the-final-report
[4] https://public-inbox.org/git/pull.1281.git.1657202265048.gitgitgadget@gmail.com/
[5] https://public-inbox.org/git/pull.1452.git.1672102523902.gitgitgadget@gmail.com/#t
[6] https://lore.kernel.org/git/20230222040745.1511205-1-18994118902@163.com/
[7] https://public-inbox.org/git/CAP8UFD3Bd4Af1XZ00VyuHnQs=MFrdUufKeePO1tyedWoReRjwQ@mail.gmail.com/
[8] https://harry-hov.github.io/blogs/posts/week1-the-ten-questions

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

* Re:[GSOC] [PROPOSAL v3] Draft of proposal for "Unify ref-filter formats with other pretty formats"
  2023-04-03 17:45 [GSOC] [PROPOSAL v3] Draft of proposal for "Unify ref-filter formats with other pretty formats" Zhang Yi
@ 2023-04-10  8:10 ` Zhang Yi
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang Yi @ 2023-04-10  8:10 UTC (permalink / raw)
  To: git, christian.couder, hariom18599



Hi, I have done some preparatory work. I read most part of the patch
"ref-filter: add new "signature" atom"[1] but the part of the test script is
left.
I plan to read details about test scripts if the previous work of the patch is
well down.
* My questions
** Are there more aspects I need to focus when reading other's
patches?
** Are there other patches necessary to read?


Thanks for all suggestions.
Below is what I grasp from ref-filter: add new "signature" atom patches. I will
put it on my blog site later.


* v1
** The goal of v1
Add "signature" atom with `grade`,`signer`, `key`, `fingerprint`,
`primarykeyfingerprint`, `trustlevel` as arguments.
To get constitutes for %GG, %G?, %GS, %GK, %GF, %GP, and %GT pretty formats.
** The approach
*** enum
atom_type; ATOM_SIGNATURE: used as the index of valid_atom array.
*** struct
used_atom; struct {...} signature: add signature atom and its options.
valid_atom ; [ATOM_SIGNATURE]: seems build a map between "signature" and
function "signature_atom_parser".
*** function
**** add
static int signature_atom_parser: Set "signature.option" according to args.
static void grab_signature: Set the result string in atom_value.value for
signature options. There are more details need to understand.
**** modify
static void grab_values: add grab_signature in case OBJ_COMMIT.
*** document
*** test scripts
** Others' comments on v1
*** Junio C Hamano
1. Lack motivation.
2. Need to deal with signed tag.
3. Improve the style of "if else".
4. Rename grab_signature to grab_commit_signature. This make easier for future
developers to understand and add "grab_tag_signature".
5. Add space between cast and value.
6. Check used-atom to make sure there is need to do signature processing.
7. A call to check_commit_signature() should have a matching call to
signature_check_clear().
*** Jeff King
1. Add an annotation for the unused parameter, which is necessary when
-Wunused-parameter is on.
2. In signature_atom_parser, return err_bad_arg for wrong arg. This make the
error message match the others.
* v2 seems meet some mistake about message ID
1. More detailed commit message.
2. Add parse_signature_option(), which return value for struct signature.option
or -1 when get wrong arg. This function is used in grab_signature() and
signature_atom_parser().
3. Modify signature_atom_parser(). Use parse_signature_option() to get opt and
return err_bad_arg for wrong arg.
4. Modify grab_signature(). Use parse_signature_option() to check name in
used_atom and use check_commit_signature() with signature_check_clear() only
once.
5. Add test for bare signature atom(%(signature)).
* v3 and v4
1. Remove test for bare signature atom because the result of the test is not
same on different platform.
** Junio C Hamano's comments
Avoid calling check_commit_signature() when no %(signature) atoms is used.
* v5
1. Add a signature_checked flag to avoid calling check_commit_signature()
unnecessarily.
2. Fix the test for bare signature atom(%(signature)) about trustdb.
** Junio C Hamano's comments
A question about differences between versions of GPG. It seems no relationship
with my work.
* View these patches a whole
** The general direction
1. Register a new signature and its options in enum atom_type and struct used
atom.
2. Define a foo_atom_parser() to convert string arg to int option.
3. Bind atom with its foo_atom_parser() in valid_atom.
4. Define a grab_foo() to set string s in struct atom_value according to option.
5. Insert the grab_foo() into grab_values() function.
** ls it possible to use the similar approach
Yes. I can follow the general idea of this patch. Of course, I need to finetune
the details according to the atom I work on.
* Else
check_commit_signature() is defined in commit.c.
What is GPG?
https://gnupg.org/
GnuPG allows you to encrypt and sign your data and communications.


[1] https://public-inbox.org/git/pull.1452.git.1672102523902.gitgitgadget@gmail.com/ 


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

end of thread, other threads:[~2023-04-10  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 17:45 [GSOC] [PROPOSAL v3] Draft of proposal for "Unify ref-filter formats with other pretty formats" Zhang Yi
2023-04-10  8:10 ` Zhang Yi

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).