Skip to content

Commit a128927

Browse files
committed
SoC-2026: add 2026 microproject doc
This is basically a copy of 2025 but avoids confusion since the year will be in sync.
1 parent b122c9b commit a128927

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed

SoC-2025-Microprojects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: SoC 2025 Applicant Microprojects
4+
navbar: false
45
---
56

67
## Introduction

SoC-2026-Microprojects.md

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
layout: default
3+
title: SoC 2026 Applicant Microprojects
4+
---
5+
6+
## Introduction
7+
8+
First make sure you read and understand
9+
[our general guidelines and suggestions for microprojects](https://git.github.io/General-Microproject-Information).
10+
11+
There are some suggestions on how you can find some microprojects on your own in the document.
12+
13+
## Ideas for microprojects
14+
15+
### Modernize Test Path Checking in Git's Test Suite
16+
17+
Help improve Git's test suite by converting old-style path checks to use modern
18+
helper functions. We'll be replacing basic shell test commands like `test -f`
19+
with Git's dedicated test helpers like `test_path_is_file`.
20+
21+
#### Steps to Complete
22+
1. Find a test script using old-style path checks:
23+
```sh
24+
git grep "test -[efd]" t/
25+
```
26+
27+
2. Look for patterns like:
28+
```sh
29+
test -f path/to/file # old way
30+
test_path_is_file path/to/file # new way
31+
32+
test -d some/directory # old way
33+
test_path_is_dir some/directory # new way
34+
```
35+
36+
3. Important: Only replace checks that are actually testing for conditions, not
37+
those used in flow control. For example:
38+
```sh
39+
# DON'T change this - it's flow control
40+
if test -e "file.txt"; then
41+
do_something
42+
fi
43+
44+
# DO change this - it's a test assertion
45+
test -e "file.txt" || error "file.txt should exist"
46+
```
47+
48+
#### Notes
49+
- Start small: Pick a test file with just a few instances to convert
50+
- Run the test suite after your changes to ensure nothing breaks
51+
- Follow Git's commit message style
52+
- Include which command you used to find the instances in your commit message
53+
54+
#### Need Help?
55+
- Reference [this discussion](https://public-inbox.org/git/CAPig+cRfO8t1tdCL6MB4b9XopF3HkZ==hU83AFZ38b-2zsXDjQ@mail.gmail.com/)
56+
for detailed examples.
57+
- If you can't find any instances to fix, let us know what search command you
58+
used
59+
60+
61+
### Add more builtin patterns for userdiff
62+
63+
"git diff" shows the function name corresponding to each hunk after
64+
the @@ ... @@ line. For common languages (C, HTML, Ada, Matlab, ...),
65+
the way to find the function name is built-in Git's source code as
66+
regular expressions (see userdiff.c). A few languages are common
67+
enough to deserve a built-in driver, but are not yet recognized. For
68+
example, shell.
69+
70+
This project requires a very good knowledge of regular expressions.
71+
72+
It is easy though to find examples of how this can be done by
73+
searching the code base and the mailing list archive, as this has
74+
already been done for a number of languages.
75+
76+
### Replace a run_command*() call by direct calls to C functions
77+
78+
See for example what Junio did in
79+
[ffcb4e94d3](https://github.com/git/git/commit/ffcb4e94d3) (bisect: do
80+
not run show-branch just to show the current commit, 2021-07-27).
81+
82+
If you can't find one please tell us, along with the command you used
83+
to search, so that we can remove this microproject idea.
84+
85+
### Avoid suppressing `git`'s exit code in test scripts
86+
87+
The Git project uses a large collection of integration tests written in
88+
Shell to guard against regressions when adding new features or fixing
89+
bugs. The scripts in question can be found in the `t` directory
90+
[here][git-t].
91+
92+
While it is perfectly OK to use [pipes][wikipedia-pipes] when writing
93+
integration tests, we must be careful to avoid writing a pipeline that
94+
suppresses the exit code of a Git process, like so:
95+
96+
```
97+
git <subcommand> | <some other command>
98+
```
99+
100+
...since the exit code of `git <subcommand>` would be suppressed by the
101+
pipe. If `git <subcommand>` crashed, we would not catch it in the above
102+
example when running the integration suite.
103+
104+
Other examples to avoid include:
105+
106+
```
107+
# bad:
108+
<some command> $(git <subcommand>)
109+
110+
# also bad:
111+
<some command> <<EOF
112+
... some text ...
113+
$(git <subcommand>)
114+
EOF
115+
```
116+
117+
...since the exit code of `git <subcommand>` is hidden behind the
118+
subshell in both instances.
119+
120+
On the other hand, both of the following examples are OK, since neither
121+
hides the exit code of running `git <subcommand>`:
122+
123+
```
124+
# good:
125+
var=$(git <subcommand>)
126+
127+
# also good:
128+
<some command> | <some other command> | git <subcommand>
129+
```
130+
131+
(provided that neither `<some command>` or `<some other command>` are
132+
`git`).
133+
134+
See the commit
135+
[c6f44e1da5](https://github.com/git/git/commit/c6f44e1da5e88e34)
136+
for example, and then do the same thing in one other test script.
137+
138+
If you can't find one please tell us, along with the command you used
139+
to search, so that we can remove this microproject idea.
140+
141+
[git-t]: https://github.com/git/git/tree/master/t
142+
[wikipedia-pipes]: https://en.wikipedia.org/wiki/Pipeline_(Unix)
143+
144+
### Use unsigned integral type for collection of bits.
145+
146+
Pick one field of a structure that (1) is of signed integral type and (2) is
147+
used as a collection of multiple bits. Discuss if there is a good reason
148+
why it has to be a signed integral field and change it to an unsigned
149+
type otherwise. [[thread](https://public-inbox.org/git/xmqqsiebrlez.fsf@gitster.dls.corp.google.com)]
150+
151+
Even though the amount of code to write is small, these projects
152+
involve a lot of prior work to understand the specification and deal
153+
with all potential corner-cases.
154+
155+
### Modernize a test script
156+
157+
A number of our test scripts have been written a long time ago in a
158+
style that is now outdated.
159+
160+
In the following email it is explained in details how to modernize and
161+
clean up the t7001 test script:
162+
163+
<https://lore.kernel.org/git/CAPig+cQpUu2UO-+jWn1nTaDykWnxwuEitzVB7PnW2SS_b7V8Hg@mail.gmail.com/>
164+
165+
t7001 is not the only test script where similar changes could be made
166+
though.
167+
168+
Find one test script that needs some of the same changes and make
169+
them. Please make sure that the test script is not already being
170+
worked on by asking on the mailing list before starting to work on it.
171+
172+
There should be only one kind of change per commit. For example if one
173+
of your commits indents test bodies with TABs, instead of spaces, then
174+
this should be the only kind of change in this commit.
175+
176+
#### Notes
177+
- only work on `t/t????-*.sh` scripts.
178+
- pick just one script (so as to avoid exhausting the pool for other candidates).
179+
- When converting `test -[def]` to use `test_path_exists()` and cousins
180+
only convert instances which semantically are assertions (i.e. used as part
181+
of a &&-chain).

0 commit comments

Comments
 (0)