|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: SoC 2018 Applicant Microprojects |
| 4 | +--- |
| 5 | + |
| 6 | +## Introduction |
| 7 | + |
| 8 | +It is strongly recommended that students who want to apply to the Git |
| 9 | +project for the Summer of Code 2018 submit a small code-related patch |
| 10 | +to the Git project as part of their application. Think of these |
| 11 | +microprojects as the "Hello, world" of getting involved with the Git |
| 12 | +project; the coding aspect of the change can be almost trivial, but to |
| 13 | +make the change the student has to become familiar with many of the |
| 14 | +practical aspects of working on the Git project. |
| 15 | + |
| 16 | +Git development is based on sending successive versions of patches or |
| 17 | +patch series to the mailing list until they are considered good and |
| 18 | +correct by the reviewers and Junio Hamano, the maintainer, who will |
| 19 | +merge them. This process usually takes quite some time. By sending |
| 20 | +drafts of your microproject patches to the |
| 21 | +mailing list long before the deadline, you can show us that you are |
| 22 | +willing and able to work well using the Git development process. |
| 23 | + |
| 24 | +It is *expected* that what you send will need several rounds of |
| 25 | +reviews and discussions. If you are not sure at all about a patch you can |
| 26 | +put "[RFC/PATCH]" at the beginning of its subject. |
| 27 | + |
| 28 | +Consider [a sample email thread ](http://public-inbox.org/git/[email protected]/T/#u), |
| 29 | +which shows how a developer proposed a change and a patch to implement |
| 30 | +it. The problem being solved, the design of the proposed solution, |
| 31 | +and the implementation of that design were all reviewed and discussed, |
| 32 | +and after several iterations an improved version of the patch was |
| 33 | +accepted into our codebase. As a GSoC student, you will be playing |
| 34 | +the role of the developer and engaging in a similar discussion. Get |
| 35 | +familar with the flow, need for clarity on both sides (i.e. you need |
| 36 | +to clearly defend your design, and need to ask clarifications when |
| 37 | +questions/suggestions you are offered are not clear enough), the pace |
| 38 | +at which the discussion takes place, and the general tone of the |
| 39 | +discussion, to learn what is expected of you. |
| 40 | + |
| 41 | +To complete a microproject, you will have to go through approximately |
| 42 | +the following steps: |
| 43 | + |
| 44 | +* Download the source code: clone the repository using the |
| 45 | + [Git via Git](http://git-scm.com/downloads) instructions and read |
| 46 | + the `README` file. |
| 47 | + |
| 48 | +* Build the source code: this is described in the file `INSTALL`. |
| 49 | + |
| 50 | +* Glance over our coding guidelines in the file |
| 51 | + `Documentation/CodingGuidelines`. We take things like proper code |
| 52 | + formatting very seriously. |
| 53 | + |
| 54 | +* Read about the process for submitting patches to Git: this is |
| 55 | + described in `Documentation/SubmittingPatches`. |
| 56 | + |
| 57 | +* Select a microproject and check that it has not yet been taken or |
| 58 | + discussed by searching the mailing list. |
| 59 | + [Public Inbox](http://public-inbox.org/git/) is your friend. |
| 60 | + |
| 61 | +* **Make the actual change.** (Funny, this is the only part they teach |
| 62 | + you about in college.) |
| 63 | + |
| 64 | +* Run the test suite and make sure it passes 100%: this is described |
| 65 | + in the file `t/README`. (If you have added new functionality, you |
| 66 | + should also add new tests, but most microprojects will not add new |
| 67 | + functionality.) |
| 68 | + |
| 69 | +* Commit your change. Surprise: we use Git for that, so you will need |
| 70 | + to gain at least |
| 71 | + [a basic familiarity](http://git-scm.com/documentation) with using |
| 72 | + Git. Make sure to write a good commit message that explains the |
| 73 | + reason for the change and any ramifications. Remember to make sure |
| 74 | + that you agree with our "Developer's Certificate of Origin" (whose |
| 75 | + text is contained in `Documentation/SubmittingPatches`), and to |
| 76 | + signify your agreement by adding a `Signed-off-by` line. |
| 77 | + |
| 78 | +* *Optional, but recommended:* |
| 79 | + Create a fork of [Git](https://github.com/git/git) on github.com, |
| 80 | + [sign in to Travis CI](https://travis-ci.org/auth) with your GitHub |
| 81 | + account, accepting the GitHub |
| 82 | + [access permissions confirmation](https://docs.travis-ci.com/user/github-oauth-scopes), |
| 83 | + and enable builds of your Git fork in your Travis CI profile |
| 84 | + (you only have to do these steps once). Afterwards you can push |
| 85 | + your changes to your fork and on https://travis-ci.org/your-github-name/git/builds |
| 86 | + (example [here](https://travis-ci.org/git/git/builds)) you can see |
| 87 | + if your changes pass the Git test suite on Ubuntu Linux and on Mac OS X. |
| 88 | + |
| 89 | +* Submit your change to the Git mailing list. For this step you |
| 90 | + probably want to use the commands `git format-patch` and `git |
| 91 | + send-email`. Make sure that your email is formatted correctly: send |
| 92 | + a test version of the email to yourself and see if you can apply it |
| 93 | + to your repository using `git am`. Alternatively you may use |
| 94 | + [submitGit](https://submitgit.herokuapp.com/). |
| 95 | + |
| 96 | +* Expect feedback, criticism, suggestions, etc. from the mailing list. |
| 97 | + |
| 98 | + *Respond to it!* and follow up with improved versions of your |
| 99 | + change. Even for a trivial patch you shouldn't be surprised if it |
| 100 | + takes two or more iterations before your patch is accepted. *This |
| 101 | + is the best part of participating in the Git community; it is your |
| 102 | + chance to get personalized instruction from very experienced peers!* |
| 103 | + |
| 104 | +The coding part of the microproject should be very small (say, 10-30 |
| 105 | +minutes). We don't require that your patch be accepted into master by |
| 106 | +the time of your formal application; we mostly want to see that you |
| 107 | +have a basic level of competence and especially the ability to |
| 108 | +interact with the other Git developers. |
| 109 | + |
| 110 | +When you submit your patch, please mention that you plan to apply for |
| 111 | +the GSoC. You can use "[GSoC][PATCH ...]" in the subject of the |
| 112 | +emails you send for that purpose. This will ensure that we take |
| 113 | +special care not to overlook your application among the large pile of |
| 114 | +others. |
| 115 | + |
| 116 | +Students: Please attempt only **ONE** microproject. We want quality, |
| 117 | +not quantity! (Also, it takes work to collect the ideas, and it would |
| 118 | +be nice to have enough microprojects for everybody.) If you've |
| 119 | +already done a microproject and are itching to do more, then get |
| 120 | +involved in other ways, like finding and fixing other problems in the |
| 121 | +code, or improving the documentation or code comments, or helping to |
| 122 | +review other people's patches on the mailing list, or answering |
| 123 | +questions on the mailing list or in IRC, or writing new tests, etc., |
| 124 | +etc. In short, start doing things that other Git developers do! |
| 125 | + |
| 126 | +## Ideas for microprojects |
| 127 | + |
| 128 | +The following are just ideas. Any small code-related change would be |
| 129 | +suitable. Just remember to keep the change small! It is much better |
| 130 | +for you to finish a small but complete change than to try something |
| 131 | +too ambitious and not get it done. |
| 132 | + |
| 133 | +### Add more builtin patterns for userdiff |
| 134 | + |
| 135 | +"git diff" shows the function name corresponding to each hunk after |
| 136 | +the @@ ... @@ line. For common languages (C, HTML, Ada, Matlab, ...), |
| 137 | +the way to find the function name is built-in Git's source code as |
| 138 | +regular expressions (see userdiff.c). A few languages are common |
| 139 | +enough to deserve a built-in driver, but are not yet recognized. For |
| 140 | +example, shell. |
| 141 | + |
| 142 | +This project requires a very good knowledge of regular expressions. |
| 143 | + |
| 144 | +### Make "`git tag --contains <id>`" less chatty if `<id>` is invalid |
| 145 | + |
| 146 | +`git tag --contains <id>` prints the whole help text if `<id>` is invalid. |
| 147 | +It should only show the error message instead. [[thread ](https://public-inbox.org/git/[email protected])] |
| 148 | + |
| 149 | +### Git CI Improvements 1 |
| 150 | + |
| 151 | +Automated testing is an important safety net for complex software such |
| 152 | +as Git. This micro project is about to improve the Git Travis CI |
| 153 | +integration. |
| 154 | + |
| 155 | +Investigate if we can trigger Coverity static code analysis for the Git |
| 156 | +master and maint branch (hint: Stefan Beller already looked into this). |
| 157 | +Start here: https://scan.coverity.com/travis_ci |
| 158 | + |
| 159 | +### Git CI Improvements 2 |
| 160 | + |
| 161 | +Automated testing is an important safety net for complex software such |
| 162 | +as Git. This micro project is about to improve the Git Travis CI |
| 163 | +integration. |
| 164 | + |
| 165 | +Investigate if we can enable and run Clang static code analysis for the |
| 166 | +master and maint branch. |
| 167 | + |
| 168 | +### Git CI Improvements 3 |
| 169 | + |
| 170 | +Automated testing is an important safety net for complex software such |
| 171 | +as Git. This micro project is about to improve the Git Travis CI |
| 172 | +integration. |
| 173 | + |
| 174 | +Investigate if we can use pylint to analyze the git-p4 Python code. |
| 175 | + |
| 176 | +### Git CI Improvements 4 |
| 177 | + |
| 178 | +Automated testing is an important safety net for complex software such |
| 179 | +as Git. This micro project is about to improve the Git Travis CI |
| 180 | +integration. |
| 181 | + |
| 182 | +* install CVS on the build machines to run t94?? and t96?? tests |
| 183 | +* install SVN on the build machines to run t91?? tests |
| 184 | +* install Apache Web Server to run 5539, 5550, and 5561 |
| 185 | + |
| 186 | +### Git CI Improvements 5 |
| 187 | + |
| 188 | +Automated testing is an important safety net for complex software such |
| 189 | +as Git. This micro project is about to improve the Git Travis CI |
| 190 | +integration. |
| 191 | + |
| 192 | +Git's test suit is huge and over time we have seen some flaky test. |
| 193 | +Build a web page that analyzes the Travis CI test results and prints |
| 194 | +the tests that fail most often. Use this implementation as starting |
| 195 | +point: https://scribu.github.io/travis-stats/#git/git |
| 196 | + |
| 197 | +After you have done this look at the randomly failing tests and try to |
| 198 | +figure out why they fail. See [here](https://travis-ci.org/git/git/jobs/108417904) |
| 199 | +for an example of such a test failure. |
| 200 | + |
| 201 | +### Avoid pipes in git related commands for test suite |
| 202 | + |
| 203 | +See the commit |
| 204 | +[c6f44e1da5](https://github.com/git/git/commit/c6f44e1da5e88e34) |
| 205 | +for example. |
| 206 | + |
| 207 | + |
| 208 | +### Use unsigned integral type for collection of bits. |
| 209 | + |
| 210 | +Pick one field of a structure that (1) is of signed integral type and (2) is |
| 211 | +used as a collection of multiple bits. Discuss if there is a good reason |
| 212 | +why it has to be a signed integral field and change it to an unsigned |
| 213 | +type otherwise. [[thread ](https://public-inbox.org/git/[email protected])] |
| 214 | + |
| 215 | +### Move `~/.git-credential-cache` to `~/.cache/git` |
| 216 | + |
| 217 | +Most of git dotfiles can be located, at the user's option, in |
| 218 | +`~/.<file>` or in `~/.config/git/<file>`, following the |
| 219 | +[XDG standard](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html). |
| 220 | +`~/.git-credential-cache` is still hardcoded as |
| 221 | +`~/.git-credential-cache`, |
| 222 | +but should allow using the XDG directory layout too as |
| 223 | +`~/.cache/git/credential`, possibly modified by `$XDG_CONFIG_HOME` and |
| 224 | +`$XDG_CACHE_HOME`). |
| 225 | + |
| 226 | +The suggested approach is: |
| 227 | + |
| 228 | +* See how XDG was implemented for other files (run "`git log --grep |
| 229 | + XDG`" in Git's source code) and read the XDG specification. |
| 230 | + |
| 231 | +* Implement and test the new behavior, without breaking compatibility |
| 232 | + with the old behavior. |
| 233 | + |
| 234 | +* Update the documentation |
| 235 | + |
| 236 | +Even though the amount of code to write is small, these projects |
| 237 | +involve a lot of prior work to understand the specification and deal |
| 238 | +with all potential corner-cases. |
| 239 | + |
| 240 | +### Add configuration options for some commonly used command-line options |
| 241 | + |
| 242 | +Many have already been added (e.g. "git am -3" in e97a5e7). |
| 243 | + |
| 244 | +Some people always run the command with these options, and would |
| 245 | +prefer to be able to activate them by default in ~/.gitconfig. |
| 246 | + |
| 247 | +### Use dir-iterator to avoid explicit recursive directory traversal |
| 248 | + |
| 249 | +Some places in git use raw API opendir/readdir/closedir to traverse a |
| 250 | +directory recursively, which usually involves function recursion. Now |
| 251 | +that we have `struct dir_iterator` (see dir-iterator.h), convert these |
| 252 | +to use the dir-iterator to simplify the code. Do only one conversion |
| 253 | +per microproject. |
| 254 | + |
| 255 | +## How to find other ideas for microprojects |
| 256 | + |
| 257 | +If you don't like for some reason the above microprojects or if you |
| 258 | +just want more choice, you may find other ideas for microprojects by |
| 259 | +searching the mailing list (https://public-inbox.org/git/) or the |
| 260 | +code base itself. In the code base you could search the code itself or |
| 261 | +the tests (in the "t" directory). |
| 262 | + |
| 263 | +When you find something you are interested to work on, please ask |
| 264 | +first on the mailing list if it's worth doing and if it's appropriate |
| 265 | +for a microproject before starting to work on what you find. Even if |
| 266 | +it looks straitforward, there could be hidden reasons why it is too |
| 267 | +difficult or just innappropriate. |
| 268 | + |
| 269 | +### Searching for #leftoverbits in the mailing list |
| 270 | + |
| 271 | +People have recently started to add "#leftoverbits" to their emails |
| 272 | +when they think further small work on the topic could be useful. |
| 273 | + |
| 274 | +You can easily search that using: |
| 275 | + |
| 276 | +https://public-inbox.org/git/?q=leftoverbits |
| 277 | + |
| 278 | +But don't forget to search to check if what you find has already been |
| 279 | +addressed. |
| 280 | + |
| 281 | +### Searching the code base itself |
| 282 | + |
| 283 | +Your best bet is probably to search for strings like "FIXME", "TODO", |
| 284 | +"NEEDSWORK", or maybe "NEED-WORK", and "BUG". |
| 285 | + |
| 286 | +You can also search for common patterns in the code and try to find or |
| 287 | +create a function to refactor them. |
| 288 | + |
| 289 | +### Searching the tests |
| 290 | + |
| 291 | +Tests are in the "t" directory and can be run by launching "make" in |
| 292 | +this directory. Doing that you will see that there are a number of |
| 293 | +tests that are marked with "# TODO known breakage", like for example: |
| 294 | + |
| 295 | +"not ok 28 - git checkout -f: replace submodule with a directory must fail # TODO known breakage |
| 296 | + |
| 297 | +These tests start with "test_expect_failure" instead of |
| 298 | +"test_expect_success". They document that something is not working as |
| 299 | +it should perhaps be working. And it might be an interesting |
| 300 | +microproject to fix that. |
| 301 | + |
| 302 | +Note that it is especially wise to first search the mailing list and |
| 303 | +then ask on the list before working on one of these |
| 304 | +"test_expect_failure", because if we bothered to document a failure |
| 305 | +but not fix it, that is often because the fix is non-trivial. |
| 306 | + |
| 307 | +You could also check if some commands have no test for some of their |
| 308 | +options and it could be an interesting microproject to add a test for |
| 309 | +one of those options. |
| 310 | + |
| 311 | +### Searching the mailing list |
| 312 | + |
| 313 | +You can search the mailing list for words like "low hanging fruit", or |
| 314 | +"low-hanging fruits", "hint, hint", "later", "we should", "I plan |
| 315 | +to"... |
| 316 | + |
| 317 | + |
0 commit comments