git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Clarify how repository service parameters are used

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2007, 09:34 UTC
Message-ID
<7vr6lmr8fa.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<absa3doz.fsf@cante.net>
Jari Aalto <jari.aalto@cante.net> writes:
Show 26 quoted lines
> At upload-archive service, mention repository option
> daemon.uploadarchive. Add a paragrah and example to show how the
> service parameters are added to the repository's config file.
>
> Signed-off-by: Jari Aalto <jari.aalto@cante.net>
> ---
>  Documentation/git-daemon.txt |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
> index f902161..0aeff70 100644
> --- a/Documentation/git-daemon.txt
> +++ b/Documentation/git-daemon.txt
> @@ -164,7 +164,21 @@ upload-pack::
>  	item to `false`.
>  
>  upload-archive::
> -	This serves `git-archive --remote`.
> +	This serves `git-archive --remote`. This is the
> +        repository setting `daemon.uploadarchive`.
> +
> +Instead of globally using `--enable=service`, it might be more
> +advisable to configure these items by repository basis. The
> +configuration file is ./config, supposing that the repository
> +was created with `git --bare init [--share]`. The services would
> +be listed as:

"This is the repository setting"? The service is not repository setting. It can be controlled by the configuration variable.

"It might be more advisable"? If you advise, indicate what considerations there are when picking between the two. Otherwise you would confuse users.

The filename is ./config only because it is $GIT_DIR/config; there is nothing new here, and not worth mentioning. If you are running git-daemon, you should be at least familiar enough to know that per-repository configuration file is always there.

Saying the configuration file is ./config (and not .git/config), and the part "supposing that ..." both imply that use of bare repository is recommended. While I like the idea of strongly encouraging the use of bare repositories for the purpose of git-daemon, I do not think SERVICES section is the place to do so. These implications are not strong enough either, so if we want to have something to encourage bare repositories, we should dedicate a separate paragraph to do so.

I think the last item might be controvercial, so I'd rather omit the "bare" part. Here is a suggested rewrite.

---
 Documentation/git-daemon.txt |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
index f902161..5dbf016 100644
--- a/Documentation/git-daemon.txt
+++ b/Documentation/git-daemon.txt
@@ -157,6 +157,12 @@ the facility of inet daemon to achieve the same before spawning
 SERVICES
 --------
 
+These services can be globally enabled/disabled using the command
+line options of this command.  If a finer-grained control is
+desired (e.g. to allow `git-archive` to be run against only a
+selected repositories the daemon serves), per-repository
+configuration file can be used to enable/disable them.
+
 upload-pack::
 	This serves `git-fetch-pack` and `git-peek-remote`
 	clients.  It is enabled by default, but a repository can
@@ -164,7 +170,18 @@ upload-pack::
 	item to `false`.
 
 upload-archive::
-	This serves `git-archive --remote`.
+	This serves `git-archive --remote`.  It is disabled by
+	default, but a repository can enable it by setting
+	`daemon.uploadarchive` configuration item to `true`.
+
+receive-pack::
+	This serves `git-send-pack` clients, allowing anonymous
+	push.  It is disabled by default, as there is _no_
+	authentication in the protocol (for that, use the
+	"git over ssh" protocol, not `git-daemon`).  It can be
+	enabled by `daemon.receivepack` configuration item to
+	`true`.
+
 
 EXAMPLES
 --------
@@ -229,6 +246,18 @@ Repositories can still be accessed by hostname though, assuming
 they correspond to these IP addresses.
 
 
+To enable `git-archive --remote` and disable `git-fetch` against
+a repository, have this in the configuration file in the
+repository (that is the file 'config' next to 'HEAD', 'refs' and
+'objects').
++
+----------------------------------------------------------------
+[daemon]
+	uploadpack = false
+	uploadarchive = true
+----------------------------------------------------------------
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki
Previous: Jari Aalto
Message 2 of 2 in “Clarify how repository service parameters are used”
  1. Clarify how repository service parameters are usedJari Aalto, Aug 29, 2007
  2. Junio C HamanoAug 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.