From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] shared repository settings enhancement.
Date: Fri, 9 Jun 2006 21:39:45 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0606092131150.5498@g5.osdl.org> (raw)
In-Reply-To: <7vver9k5gg.fsf@assigned-by-dhcp.cox.net>
On Fri, 9 Jun 2006, Junio C Hamano wrote:
>
> Yes, the user can mistype "gruop", people would start making
> noises about having "world" as a synonym for "everybody", and
> the parsing becomes somewhat cumbersome, and all that trouble,
> but on the other hand that is probably the easiest to explain.
Actually, it's quite easy to parse using the git config file parsers.
Let's say that 0 means umask, 1 means group, 2 means user and 3 means
everybody. That leaves "0/1" with the old false/true behaviour, and leaves
umask as the default.
So we'd have
enum sharedrepo {
PERM_UMASK = 0,
PERM_GROUP,
PERM_USER,
PERM_EVERYBODY
};
int git_config_perm(const char *var, const char *value)
{
if (!strncmp(value, "umask"))
return PERM_UMASK;
if (!strncmp(value, "group"))
return PERM_GROUP;
if (!strncmp(value, "user"))
return PERM_USER;
if (!strncmp(value, "world") || !strncmp(value, "everybody"))
return PERM_EVERYBODY;
return git_config_bool(var, value);
}
and then in check_repository_format_version() you just have
..
else if (strcmp(var, "core.sharedrepository") == 0)
shared_repository = git_config_perm(var, value);
..
instead of git_config_bool() there, and you're done. That's not so bad, is
it?
Linus
next prev parent reply other threads:[~2006-06-10 4:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 20:52 Git-daemon messing up permissions for gitweb Post, Mark K
2006-06-09 21:06 ` Junio C Hamano
2006-06-10 0:35 ` [PATCH/RFC] Retire SIMPLE_*** stuff Junio C Hamano
2006-06-10 14:13 ` [PATCH] Built-in git-get-tar-commit-id (was: [PATCH/RFC] Retire SIMPLE_*** stuff.) Rene Scharfe
2006-06-10 0:39 ` [PATCH] shared repository settings enhancement Junio C Hamano
2006-06-10 0:46 ` Linus Torvalds
2006-06-10 1:38 ` Jakub Narebski
2006-06-10 3:49 ` Junio C Hamano
2006-06-10 4:08 ` Linus Torvalds
2006-06-10 4:19 ` Junio C Hamano
2006-06-10 4:39 ` Linus Torvalds [this message]
2006-06-10 21:30 ` Git-daemon messing up permissions for gitweb Alex Riesen
2006-06-10 21:41 ` Linus Torvalds
2006-06-10 22:30 ` Alex Riesen
-- strict thread matches above, loose matches on Subject: below --
2006-06-11 17:32 [PATCH] shared repository settings enhancement Post, Mark K
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=Pine.LNX.4.64.0606092131150.5498@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).