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

Re: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts

From
Christian Couder <christian.couder@gmail.com>
Date
Feb 13, 2024, 17:35 UTC
Message-ID
<CAP8UFD2ypikjKEVMmHMg7=jwv8J0y5xhx6PxsiLsGdhz2+S3PQ@mail.gmail.com>
In-Reply-To
<cbb450b3-b333-4391-ac83-66c2daf0ae4d@gmail.com>
Hi,

On Tue, Feb 13, 2024 at 5:10 PM Vincenzo MEZZELA <vincenzo.mezzela@gmail.com> wrote:

Show 12 quoted lines
>
> Hello everyone,
>
> I'm Vincenzo, a Master's degree student in Computer Engineering and
> Cybersecurity.
>
> As I'm approaching the end of my academic journey, I'm eager to
> contribute to the Git project
> and the GSoC represents a good opportunity to do so. Upon exploring the
> online documentation
> of git for the application to the GSoC I'm keen to begin the required
> microproject.
Thanks for your interest in working on Git!
Show 5 quoted lines
> Among the microproject proposed here
> https://git.github.io/SoC-2024-Microprojects/ , I would like to
> work on replacing 'test -(e|f|g|...)' with test_path_is* .
>
> Can you confirm if this task has already been taken by someone else?

This is a generic microproject so even if someone else is working on this microproject, you can also work on it as long as you don't work on the same file as that person.

Show 12 quoted lines
> Approach:
>
> As far as I understood, The work consists in replacing the shell 'test'
> command in the test
> script under 't/' directory with the ones present in the
> t/test_lib_functions.sh as follows:
>
> - test -f --> test_path_is_file
>
> - test -d --> test_path_is_dir
>
> - test -e --> test_path_exists

Note that you only need to do that replacement in one test script under the 't/' directory.

Show 33 quoted lines
> To approximately measure the number of required replacement, I run the
> following commands from the
> 't/' directory (branch master):
>
> > # Files  that requires a replacement
>  > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c |
> sort -n -r
> >>    190 t7301-clean-interactive.sh:
> >>     147 t7300-clean.sh:
> >>      21 t2004-checkout-cache-temp.sh:
> >>      17 t2401-worktree-prune.sh:
> >>      16 t2003-checkout-cache-mkdir.sh:
> >>      14 t0601-reffiles-pack-refs.sh:
> >>      13 t4200-rerere.sh:
> >>      12 t9146-git-svn-empty-dirs.sh:
> >>      12 t7603-merge-reduce-heads.sh:
> >>      12 lib-submodule-update.sh:
> >>    ...
>  >>
>  > # Number of replacements
>  > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c |
> sort -n -r | awk '{sum += $1} END {print sum}'
>  >> 853
>  > # Number of files that requires a patch
>  > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c |
> wc -l
>  >> 169
>
> Although the replacement work might not be difficult, it spans over many
> different test files.
> Do you want me to submit a patch for each of them as part of the
> microproject?
> If not, How many patches do you expect me to submit?

We would like a single patch that performs the necessary replacements in a single file.

For reference in https://git.github.io/General-Microproject-Information/ we say:
"Change only a few files"
and

"This means that for a microproject that consists in refactoring or rewriting a small amount of code, your patch should change only ONE file, or perhaps 2 files if they are closely related, like “foo.c” and “foo.h”."

Thanks, Christian.

Previous: Vincenzo MEZZELANext: Eric Sunshine
Message 2 of 5 in “[GSOC][RFC] microproject: use test_path_is_* functions in test scripts”
  1. Vincenzo MEZZELAFeb 13, 2024
  2. Christian CouderFeb 13, 2024
  3. Eric SunshineFeb 13, 2024
  4. Junio C HamanoFeb 13, 2024
  5. vincenzo mezzelaFeb 14, 2024

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.