Skip to content

Commit 7bbf88c

Browse files
author
Junio C Hamano
committed
Merge branch 'jc/daemon'
* jc/daemon: Revert "daemon: add upload-tar service." multi-service daemon: documentation daemon: add upload-tar service.
2 parents 8895cbc + d9edcbd commit 7bbf88c

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

Documentation/git-daemon.txt

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,29 @@ SYNOPSIS
1111
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
1212
[--timeout=n] [--init-timeout=n] [--strict-paths]
1313
[--base-path=path] [--user-path | --user-path=path]
14-
[--reuseaddr] [--detach] [--pid-file=file]
15-
[--user=user [--group=group]] [directory...]
14+
[--enable=service] [--disable=service]
15+
[--allow-override=service] [--forbid-override=service]
16+
[--reuseaddr] [--detach] [--pid-file=file]
17+
[--user=user [--group=group]] [directory...]
1618

1719
DESCRIPTION
1820
-----------
1921
A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT"
20-
aka 9418. It waits for a connection, and will just execute "git-upload-pack"
21-
when it gets one.
22-
23-
It's careful in that there's a magic request-line that gives the command and
24-
what directory to upload, and it verifies that the directory is OK.
22+
aka 9418. It waits for a connection asking for a service, and will serve
23+
that service if it is enabled.
2524

2625
It verifies that the directory has the magic file "git-daemon-export-ok", and
2726
it will refuse to export any git directory that hasn't explicitly been marked
2827
for export this way (unless the '--export-all' parameter is specified). If you
2928
pass some directory paths as 'git-daemon' arguments, you can further restrict
3029
the offers to a whitelist comprising of those.
3130

32-
This is ideally suited for read-only updates, i.e., pulling from git repositories.
31+
By default, only `upload-pack` service is enabled, which serves
32+
`git-fetch-pack` and `git-peek-remote` clients that are invoked
33+
from `git-fetch`, `git-ls-remote`, and `git-clone`.
34+
35+
This is ideally suited for read-only updates, i.e., pulling from
36+
git repositories.
3337

3438
OPTIONS
3539
-------
@@ -105,11 +109,32 @@ Giving these options is an error when used with `--inetd`; use
105109
the facility of inet daemon to achieve the same before spawning
106110
`git-daemon` if needed.
107111

112+
--enable-service, --disable-service::
113+
Enable/disable the service site-wide per default. Note
114+
that a service disabled site-wide can still be enabled
115+
per repository if it is marked overridable and the
116+
repository enables the service with an configuration
117+
item.
118+
119+
--allow-override, --forbid-override::
120+
Allow/forbid overriding the site-wide default with per
121+
repository configuration. By default, all the services
122+
are overridable.
123+
108124
<directory>::
109125
A directory to add to the whitelist of allowed directories. Unless
110126
--strict-paths is specified this will also include subdirectories
111127
of each named directory.
112128

129+
SERVICES
130+
--------
131+
132+
upload-pack::
133+
This serves `git-fetch-pack` and `git-peek-remote`
134+
clients. It is enabled by default, but a repository can
135+
disable it by setting `daemon.uploadpack` configuration
136+
item to `false`.
137+
113138
Author
114139
------
115140
Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki

daemon.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static const char daemon_usage[] =
2222
" [--timeout=n] [--init-timeout=n] [--strict-paths]\n"
2323
" [--base-path=path] [--user-path | --user-path=path]\n"
2424
" [--reuseaddr] [--detach] [--pid-file=file]\n"
25+
" [--[enable|disable|allow-override|forbid-override]=service]\n"
2526
" [--user=user [[--group=group]] [directory...]";
2627

2728
/* List of acceptable pathname prefixes */
@@ -896,12 +897,12 @@ int main(int argc, char **argv)
896897
enable_service(arg + 10, 0);
897898
continue;
898899
}
899-
if (!strncmp(arg, "--enable-override=", 18)) {
900-
make_service_overridable(arg + 18, 1);
900+
if (!strncmp(arg, "--allow-override=", 17)) {
901+
make_service_overridable(arg + 17, 1);
901902
continue;
902903
}
903-
if (!strncmp(arg, "--disable-override=", 19)) {
904-
make_service_overridable(arg + 19, 0);
904+
if (!strncmp(arg, "--forbid-override=", 18)) {
905+
make_service_overridable(arg + 18, 0);
905906
continue;
906907
}
907908
if (!strcmp(arg, "--")) {

0 commit comments

Comments
 (0)