~akspecs/aqoli-docs

dcd0fb78e461665f90e8025c876e424d2d85305a — Andrei Khartchenko 8 months ago b424690
docs: add submitting_a_patch.md
1 files changed, 62 insertions(+), 0 deletions(-)

A docs/submitting_a_patch.md
A docs/submitting_a_patch.md => docs/submitting_a_patch.md +62 -0
@@ 0,0 1,62 @@
# Submitting a patch

## About patches

On sourcehut, rather than using merge requests, people contribute code
by emailing a patch (or a set of patches) of their changes to a public
mailing list.

A patch is a set of changes in plaintext that can be applied as commits
to a git repository.

## git-send-email.io

This article takes information from [https://git-send-email.io][gse],
which includes an interactive tutorial which allows you to practice
sending patches. If you'd like to practice, you should go there now
and follow the tutorial. Otherwise, keep reading this article to learn
what you need to do to send a patch to one of the project's
repositories.

[gse]: https://git-send-email.io

## Submitting a patch to numbeo-scraping

(You'll need to first configure git for email as described on
git-send-email.io.)

If you haven't yet, clone the repository that you want to edit. Here's
how you clone one of the project repositories: `git clone
https://git.sr.ht/~akspecs/aqoli` or `git clone
https://git.sr.ht/~akspecs/numbeo-scraping`

Depending on which project you would like to contribute to, set the
default email address: `git config sendemail.to
'~akspecs/numbeo-scraping-dev@lists.sr.ht'` or `git config sendemail.to
'~akspecs/aqoli-dev@lists.sr.ht'`

Create a topic branch to work on: `git checkout -b my-cool-changes`

Make the changes you want to make using a text editor.

Add and commit your changes to the topic branch.

Email the patch to the mailing list: `git send-email master`

(`master` here represents which commits you want to send. Everything
_after_ the specified revision will be sent, so `master` will send
everything on your topic branch. You can also try `HEAD^` to send the
latest commit, `HEAD^3` to send the latest 3, or `abcdef1` to send
everything after a specific commit.)

If you're asked to make changes, it's okay to use `git commit --amend`
and `git rebase` if you wish to. When you've made the changes, use `git
send-email -v2 master`. If you have to go back for a third attempt, use
`-v3`, and so on.

If you run into problems, you can ask for help [on matrix] or by
composing an email to the relevant repository's mailing list, either
`~akspecs/aqoli.lists.sr.ht`, or
`~akspecs/numbeo-scraping-dev@lists.sr.ht`.

[on matrix]: https://matrix.to/#/#2021_fall_cs195_general:matrix.org