Skip to content

Commit 3a21d57

Browse files
committed
integration-docs: Update the Git integration doc.
1 parent 929e71e commit 3a21d57

File tree

1 file changed

+46
-18
lines changed

1 file changed

+46
-18
lines changed

zulip/integrations/git/doc.md

+46-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,59 @@
1-
Get Zulip notifications for your Git repositories!
1+
# Zulip Git integration
22

3-
1. {!create-an-incoming-webhook.md!}
3+
Get Zulip notifications for pushes to your Git repositories!
44

5-
1. {!download-python-bindings.md!}
5+
Note that Zulip also offers integrations for [GitHub](./github),
6+
[GitLab](./gitlab) and various other
7+
[version control hosting services][other-integrations].
68

7-
1. {!create-channel.md!}
9+
!!! warn ""
810

9-
1. {!change-zulip-config-file.md!}
11+
**Note:** This integration adds a `post-receive` hook to your Git
12+
repository on your Git server.
1013

11-
You may also need to change the value of `STREAM_NAME`.
14+
{start_tabs}
1215

13-
You can specify the branches that will be used for notifications by modifying
14-
the `commit_notice_destination` function. By default,
15-
pushes to the `main`, `master`, and `test-post-receive` branches will result in a
16-
notification.
16+
1. {!create-an-incoming-webhook.md!}
1717

18-
1. Symlink `/usr/local/share/zulip/integrations/git/zulip_git_config.py`
19-
to the `.git/hooks` directory of your Git repository.
18+
1. {!download-python-bindings.md!}
2019

21-
1. Symlink `/usr/local/share/zulip/integrations/git/post-receive`
22-
to the `.git/hooks` directory of your Git repository.
20+
1. If your Git server and your Zulip server are on the same machine,
21+
symlink the `post-receive` hook of your Git repository in your Git
22+
server by running:
23+
24+
`ln -s {{ integration_path }}/post-receive your-repo.git/hooks/post-receive`
25+
26+
Otherwise, copy the `post-receive` hook to your Git repository's
27+
`/hooks` directory.
28+
29+
The `post-receive` hook is triggered on every push to the repository.
30+
31+
1. {!change-zulip-config-file.md!}
32+
33+
1. Copy the config file to the same directory as the `post-receive` hook.
34+
35+
`cp {{ config_file_path }} your-repo.git/hooks`
2336

2437
!!! tip ""
2538

26-
You can test the plugin without changing your `main` branch by
27-
pushing to the `test-post-receive` branch.
39+
Use the `test-post-receive` branch to test the integration without
40+
modifying your `main` branch.
41+
42+
{end_tabs}
43+
44+
### Configuration options
45+
46+
In `{{ config_file_path }}`, you can set:
47+
48+
- The channel where notifications are sent by updating the value of
49+
`STREAM_NAME`. By default, notifications are sent to a channel named
50+
"commits".
51+
52+
- Which branches send notifications when pushed by updating the
53+
`commit_notice_destination` function. By default, pushes to the `main`,
54+
`master`, and `test-post-receive` branches will result in notifications.
2855

29-
{!congrats.md!}
56+
- The message format used in your Zulip notifications by updating the
57+
`format_commit_message` function.
3058

31-
![Git bot message](/static/images/integrations/git/001.png)
59+
[other-integrations]: ../version-control

0 commit comments

Comments
 (0)