Skip to content

Commit ddb1b57

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

File tree

1 file changed

+41
-18
lines changed

1 file changed

+41
-18
lines changed

zulip/integrations/git/doc.md

+41-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,54 @@
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+
{start_tabs}
810

9-
1. {!change-zulip-config-file.md!}
11+
1. {!create-an-incoming-webhook.md!}
1012

11-
You may also need to change the value of `STREAM_NAME`.
13+
1. {!download-python-bindings.md!}
1214

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.
15+
1. If your Git server and your Zulip server are on the same machine,
16+
symlink the `post-receive` hook of your Git repository in your Git
17+
server by running:
1718

18-
1. Symlink `/usr/local/share/zulip/integrations/git/zulip_git_config.py`
19-
to the `.git/hooks` directory of your Git repository.
19+
`ln -s {{ integration_path }}/post-receive your-repo.git/hooks/post-receive`
2020

21-
1. Symlink `/usr/local/share/zulip/integrations/git/post-receive`
22-
to the `.git/hooks` directory of your Git repository.
21+
Otherwise, copy the `post-receive` hook to your Git repository's
22+
`/hooks` directory.
23+
24+
The `post-receive` hook is triggered on every push to the repository.
25+
26+
1. {!change-zulip-config-file.md!}
27+
28+
1. Copy the config file to the same directory as the `post-receive` hook.
29+
30+
`cp {{ config_file_path }} your-repo.git/hooks`
2331

2432
!!! tip ""
2533

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

29-
{!congrats.md!}
51+
- The message format used in your Zulip notifications by updating the
52+
`format_commit_message` function.
3053

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

0 commit comments

Comments
 (0)