# [GSoC] Intro and Micro-project

5 messages from 2023-03-21 to 2023-03-21. Participants: Edwin Fernando, Felipe Contreras, Taylor Blau, Junio C Hamano.
Thread: https://gitlist.dev/t/59429

## Edwin Fernando, 2023-03-21 14:38

Subject: [GSoC] Intro and Micro-project
Message-ID: <CAPNJDgcauhz_NraSPTQfiDM61gyghSJShZLPUtt5HOr2xKysZg@mail.gmail.com>
URL: https://gitlist.dev/e/CAPNJDgcauhz_NraSPTQfiDM61gyghSJShZLPUtt5HOr2xKysZg%40mail.gmail.com

```
Hello,
I am Edwin, a first year undergrad in the department of computing,
Imperial College London. This is my first message to this mailing
list! I want to work on the micro-project "avoiding pipelines in test
scripts".
I'm really excited to work on such a massive project (ie, git, not the
microproject) and be in contact with the people who put it all
together. I'm curious about how software development works at this
scale, since it feels quite different from the small projects I've
used to work on. I use bash quite frequently for automating tasks, and
I have experience in C, through a uni project of making an assembler.

I found and looked at a few places with pipes. I have a few thoughts
and questions on making a change. Firstly (if this is relevant), how
do I ensure that the file I write the std output to doesn't have a
name clash with other such files made during tests?

I will follow up with an email of the proposed patch.
Regards,
Edwin.

```

## Felipe Contreras, 2023-03-21 15:59

Subject: Re: [GSoC] Intro and Micro-project
Message-ID: <CAMP44s1VnaM=vVYX-uvN1O0D87cgmWYjZzh+QzVhxr68c8W3Cw@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s1VnaM%3DvVYX-uvN1O0D87cgmWYjZzh%2BQzVhxr68c8W3Cw%40mail.gmail.com
In-Reply-To: <CAPNJDgcauhz_NraSPTQfiDM61gyghSJShZLPUtt5HOr2xKysZg@mail.gmail.com>

```
On Tue, Mar 21, 2023 at 9:32 AM Edwin Fernando
<edwinfernando734@gmail.com> wrote:

> I found and looked at a few places with pipes. I have a few thoughts
> and questions on making a change. Firstly (if this is relevant), how
> do I ensure that the file I write the std output to doesn't have a
> name clash with other such files made during tests?

Every test script is run inside a different directory. You can check the $PWD.

> I will follow up with an email of the proposed patch.

I'm not sure of the usefulness of such patch.

Cheers.

-- 
Felipe Contreras

```

## Taylor Blau, 2023-03-21 17:17

Subject: Re: [GSoC] Intro and Micro-project
Message-ID: <ZBnmsoRmQGKkQt+S@nand.local>
URL: https://gitlist.dev/e/ZBnmsoRmQGKkQt%2BS%40nand.local
In-Reply-To: <CAPNJDgcauhz_NraSPTQfiDM61gyghSJShZLPUtt5HOr2xKysZg@mail.gmail.com>

```
Hi Edwin!

On Tue, Mar 21, 2023 at 02:38:34PM +0000, Edwin Fernando wrote:
> Hello,
> I am Edwin, a first year undergrad in the department of computing,
> Imperial College London. This is my first message to this mailing
> list! I want to work on the micro-project "avoiding pipelines in test
> scripts".

That sounds great! I assume that you meant avoiding pipelines where the
'git' executable is in a non-terminal position of the pipe, e.g.:

    $ git blah | <something else>

Since if "git blah" exited with a non-zero code or crashed, etc., then
we wouldn't see the failure since the pipeline would suppress it.

That has been a long-standing goal within the test suite, and I think
that it's a great project to get you started. It'll ensure that you have
all of the bits in the right place to get Git running on your machine
and that you're able to run the tests.

> I'm really excited to work on such a massive project (ie, git, not the
> microproject) and be in contact with the people who put it all
> together. I'm curious about how software development works at this
> scale, since it feels quite different from the small projects I've
> used to work on. I use bash quite frequently for automating tasks, and
> I have experience in C, through a uni project of making an assembler.

:-).

> I found and looked at a few places with pipes. I have a few thoughts
> and questions on making a change. Firstly (if this is relevant), how
> do I ensure that the file I write the std output to doesn't have a
> name clash with other such files made during tests?

Each of the tests runs in their own "trash directory", which you can
keep around after the tests are finished running if you invoke them with
the '-d' flag. More information about each of those flags is available
in t/README, as is information about the test suite as a whole.

I would also recommend that you take a look through t/test-lib.sh and
t/test-lib-functions.sh, as those give a good overview of both (a) some
of the internals of our integration testing library, and (b) some of the
convenience functions available to you as a test author.

Looking at some example tests in the tree may be useful, too. You might
want to check out t/t5318-commit-graph.sh as an example of our modern
test-writing style.

Let us know if you have any questions or want any pointers on getting
started.

Thanks,
Taylor

```

## Junio C Hamano, 2023-03-21 17:41

Subject: Re: [GSoC] Intro and Micro-project
Message-ID: <xmqqo7omhuia.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqo7omhuia.fsf%40gitster.g
In-Reply-To: <ZBnmsoRmQGKkQt+S@nand.local>

```
Taylor Blau <me@ttaylorr.com> writes:

> That sounds great! I assume that you meant avoiding pipelines where the
> 'git' executable is in a non-terminal position of the pipe, e.g.:
>
>     $ git blah | <something else>
>
> Since if "git blah" exited with a non-zero code or crashed, etc., then
> we wouldn't see the failure since the pipeline would suppress it.
>
> That has been a long-standing goal within the test suite, and I think
> that it's a great project to get you started. It'll ensure that you have
> all of the bits in the right place to get Git running on your machine
> and that you're able to run the tests.

Yes, but can somebody rewrite the micro-project idea page to clarify
what the "pipe" thing is about a bit more, so that you do not have
to repeat the above explanation the next time ;-)?

It is not "we do not want pipe", but it is about "we do not want to
ignore exit status of git".  So just like 

	$ git <subcommand> | <some other command>

sequence is bad, we want to avoid 

	$ <some command> $(git <subcommand>)

that feeds output of Git as an argument to some other command.  And

	<some command> <<EOF
	... some text ...
	$(git <subcommand)
	EOF

is bad too.  But

	var=$(git <subcommand>)

is OK ;-).

```

## Taylor Blau, 2023-03-21 18:10

Subject: Re: [GSoC] Intro and Micro-project
Message-ID: <ZBnzBEqViueKIXHx@nand.local>
URL: https://gitlist.dev/e/ZBnzBEqViueKIXHx%40nand.local
In-Reply-To: <xmqqo7omhuia.fsf@gitster.g>

```
On Tue, Mar 21, 2023 at 10:41:33AM -0700, Junio C Hamano wrote:
> Taylor Blau <me@ttaylorr.com> writes:
>
> > That sounds great! I assume that you meant avoiding pipelines where the
> > 'git' executable is in a non-terminal position of the pipe, e.g.:
> >
> >     $ git blah | <something else>
> >
> > Since if "git blah" exited with a non-zero code or crashed, etc., then
> > we wouldn't see the failure since the pipeline would suppress it.
> >
> > That has been a long-standing goal within the test suite, and I think
> > that it's a great project to get you started. It'll ensure that you have
> > all of the bits in the right place to get Git running on your machine
> > and that you're able to run the tests.
>
> Yes, but can somebody rewrite the micro-project idea page to clarify
> what the "pipe" thing is about a bit more, so that you do not have
> to repeat the above explanation the next time ;-)?

Good suggestion. I did so in the following pull request:

  https://github.com/git/git.github.io/pull/633

Thanks,
Taylor

```
