All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Martin Ågren" <martin.agren@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: Re: [PATCH v2 9/9] doc: git-init: clarify file modes in octal.
Date: Thu, 28 Oct 2021 10:17:29 -0700	[thread overview]
Message-ID: <xmqqilxhrrva.fsf@gitster.g> (raw)
In-Reply-To: <7eef3538f3c3015c4f446961ddca78e2868fe644.1635438124.git.gitgitgadget@gmail.com> (=?utf-8?Q?=22Jean-No=C3=ABl?= Avila via GitGitGadget"'s message of "Thu, 28 Oct 2021 16:22:04 +0000")

"Jean-Noël Avila via GitGitGadget"  <gitgitgadget@gmail.com> writes:

> ---shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
> +--shared[=(false|true|umask|group|all|world|everybody|<umask>)]::
>  
>  Specify that the Git repository is to be shared amongst several users.  This
>  allows users belonging to the same group to push into that
> @@ -110,13 +110,15 @@ the repository permissions.
>  
>  Same as 'group', but make the repository readable by all users.
>  
> -'0xxx'::
> +'<umask>'::
>  
> -'0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will
> -override users' umask(2) value (and not only loosen permissions as 'group' and
> -'all' does). '0640' will create a repository which is group-readable, but not
> -group-writable or accessible to others. '0660' will create a repo that is
> -readable and writable to the current user and group, but inaccessible to others.
> +'<umask>' is an 3-digit octal number prefixed with `0` and each file
> +will have mode '<umask>'. '<umask>' will override users' umask(2)
> +value (and not only loosen permissions as 'group' and 'all'
> +does). '0640' will create a repository which is group-readable, but
> +not group-writable or accessible to others. '0660' will create a repo
> +that is readable and writable to the current user and group, but
> +inaccessible to others.

Giving it a name that reflects the meaning is a great change.

Unfortunately, I think the original text is wrong to call it umask,
as this is bitwise opposite of umask(2).  umask 027 for example
means that we *drop* bits 020 and 007, causing the group members
*losing* write access, and other folks *losing* all access, from the
resulting filesystem entity.  But with this, as the description
says, you would write "0640" to mean "group members cannot write,
others have no access".

How about calling it <perm> (or <perm-bits>)?

----- >8 --------- >8 --------- >8 --------- >8 -----
From: Jean-Noël Avila <jn.avila@free.fr>
Subject: [PATCH] doc: git-init: clarify file modes in octal.

The previous explanation was mixing the format with the identity of
the field.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * Giving a "3-digit octal prefixed with `0`" would work fine, but
   technically, the value is parsed as an octal without the `0`
   prefix and there is no requirement for the number of digits,
   either.  But giving a stricter-than-necessary instruction is
   probably a good idea in this case.  It makes the description
   simpler.

 Documentation/git-init.txt | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index fdb7b3f367..af0d2ee182 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -79,7 +79,7 @@ repository.  If not specified, fall back to the default name (currently
 `master`, but this is subject to change in the future; the name can be
 customized via the `init.defaultBranch` configuration variable).
 
---shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
+--shared[=(false|true|umask|group|all|world|everybody|<perm>)]::
 
 Specify that the Git repository is to be shared amongst several users.  This
 allows users belonging to the same group to push into that
@@ -110,13 +110,15 @@ the repository permissions.
 
 Same as 'group', but make the repository readable by all users.
 
-'0xxx'::
+'<perm>'::
 
-'0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will
-override users' umask(2) value (and not only loosen permissions as 'group' and
-'all' does). '0640' will create a repository which is group-readable, but not
-group-writable or accessible to others. '0660' will create a repo that is
-readable and writable to the current user and group, but inaccessible to others.
+'<perm>' is an 3-digit octal number prefixed with `0` and each file
+will have mode '<perm>'. '<perm>' will override users' umask(2)
+value (and not only loosen permissions as 'group' and 'all'
+does). '0640' will create a repository which is group-readable, but
+not group-writable or accessible to others. '0660' will create a repo
+that is readable and writable to the current user and group, but
+inaccessible to others.
 --
 
 By default, the configuration flag `receive.denyNonFastForwards` is enabled
-- 
2.33.1-984-g9137471b0c

  reply	other threads:[~2021-10-28 17:17 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 15:11 [PATCH] doc: fix grammar rules in commands'syntax Jean-Noël Avila via GitGitGadget
2021-10-26 18:21 ` Eric Sunshine
2021-10-27 13:01   ` Jean-Noël Avila
2021-10-27 18:56 ` Martin Ågren
2021-10-27 20:08   ` Eric Sunshine
2021-10-28  9:31   ` Jean-Noël Avila
2021-10-28 18:47     ` Martin Ågren
2021-10-28 16:21 ` [PATCH v2 0/9] doc: fix grammar rules in commands' syntax Jean-Noël Avila via GitGitGadget
2021-10-28 16:21   ` [PATCH v2 1/9] doc: fix git credential synopsis Jean-Noël Avila via GitGitGadget
2021-10-28 16:21   ` [PATCH v2 2/9] doc: split placeholders as individual tokens Jean-Noël Avila via GitGitGadget
2021-10-28 18:45     ` Martin Ågren
2021-10-28 16:21   ` [PATCH v2 3/9] doc: express grammar placeholders between angle brackets Jean-Noël Avila via GitGitGadget
2021-10-28 17:46     ` Eric Sunshine
2021-10-28 19:36       ` Junio C Hamano
2021-10-28 16:21   ` [PATCH v2 4/9] doc: use only hyphens as word separators in placeholders Jean-Noël Avila via GitGitGadget
2021-10-28 18:47     ` Martin Ågren
2021-10-28 19:35       ` Junio C Hamano
2021-10-31 18:58     ` Eli Schwartz
2021-10-31 20:23       ` Jean-Noël AVILA
2021-11-01  6:47         ` Junio C Hamano
2021-11-03 12:46           ` Jean-Noël Avila
2021-11-03 16:28             ` Junio C Hamano
2021-11-04  0:38               ` Johannes Schindelin
2021-11-04 17:36                 ` Junio C Hamano
2021-11-07 12:40                 ` Eli Schwartz
2021-10-28 16:22   ` [PATCH v2 5/9] doc: git-ls-files: express options as optional alternatives Jean-Noël Avila via GitGitGadget
2021-10-28 16:22   ` [PATCH v2 6/9] doc: use three dots for indicating repetition instead of star Jean-Noël Avila via GitGitGadget
2021-10-28 16:22   ` [PATCH v2 7/9] doc: uniformize <URL> placeholders' case Jean-Noël Avila via GitGitGadget
2021-10-28 17:53     ` Junio C Hamano
2021-10-28 16:22   ` [PATCH v2 8/9] doc: git-http-push: describe the refs as pattern pairs Jean-Noël Avila via GitGitGadget
2021-10-28 17:55     ` Junio C Hamano
2021-10-28 16:22   ` [PATCH v2 9/9] doc: git-init: clarify file modes in octal Jean-Noël Avila via GitGitGadget
2021-10-28 17:17     ` Junio C Hamano [this message]
2021-10-28 17:25       ` Junio C Hamano
2021-10-28 19:22   ` [PATCH v2 0/9] doc: fix grammar rules in commands' syntax Junio C Hamano
2021-11-06 18:48 ` [PATCH v3 00/10] " Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 01/10] doc: fix git credential synopsis Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 02/10] doc: split placeholders as individual tokens Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 03/10] doc: express grammar placeholders between angle brackets Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 04/10] doc: use only hyphens as word separators in placeholders Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 05/10] doc: git-ls-files: express options as optional alternatives Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 06/10] doc: use three dots for indicating repetition instead of star Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 07/10] doc: uniformize <URL> placeholders' case Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 08/10] doc: git-http-push: describe the refs as pattern pairs Jean-Noël Avila
2021-11-06 18:48   ` [PATCH v3 09/10] doc: git-init: clarify file modes in octal Jean-Noël Avila
2021-11-07 13:20     ` Johannes Altmanninger
2021-11-06 18:48   ` [PATCH v3 10/10] init doc: --shared=0xxx does not give umask but perm bits Jean-Noël Avila
2021-11-07 13:22     ` Johannes Altmanninger
2021-11-09 17:32       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqilxhrrva.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jn.avila@free.fr \
    --cc=martin.agren@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.