From: Alex Riesen <raa.lkml@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH] Restore umasks influence on the permissions of work tree created by clone
Date: Sat, 7 Jul 2012 23:50:30 +0200 [thread overview]
Message-ID: <20120707215029.GA26819@blimp.dmz> (raw)
In-Reply-To: <alpine.LNX.2.00.1207061700060.2056@iabervon.org>
The original (shell coded) version of the git-clone just used mkdir(1)
to create the working directories. The builtin changed the mode argument
to mkdir(2) to 0755, which was a bit unfortunate, as there are use
cases where umask-controlled creation is preferred and in any case
it is a well-known behaviour for new directory/file creation.
---
On Fri, 6 Jul 2012, Daniel Barkalow wrote:
> On Fri, 6 Jul 2012, Alex Riesen wrote:
>> when git-clone was built in, its treatment of umask has changed: the shell
>> version respected umask for newly created directories by using plain mkdir(1),
>> and the builtin version just uses mkdir(work_tree, 0755).
>>
>> Is it intentional?
>
> I have the vague feeling that it was intentional, but it's entirely
> plausible that I just overlooked that mkdir(2) applies umask and went for
> the mode that you normally want. I don't think there's any particular need
> for this operation to be more restrictive than umask.
I didn't look hard enough, but still, I found not much of complaining either
way (frankly - none, but as I said, I didn'l look hard): none before - for
being too permissive, the only one in original post after building the thing
in - for being too restrictive.
Maybe we should reconsider and go back to the old permission handling?
builtin/clone.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index d3b7fdc..e314b0b 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -708,7 +708,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (safe_create_leading_directories_const(work_tree) < 0)
die_errno(_("could not create leading directories of '%s'"),
work_tree);
- if (!dest_exists && mkdir(work_tree, 0755))
+ if (!dest_exists && mkdir(work_tree, 0777))
die_errno(_("could not create work tree dir '%s'."),
work_tree);
set_git_work_tree(work_tree);
--
1.7.11.1.185.g5abe2c9
next prev parent reply other threads:[~2012-07-07 21:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 19:27 git-clone ignores umask for working tree Alex Riesen
2012-07-06 21:20 ` Daniel Barkalow
2012-07-07 21:50 ` Alex Riesen [this message]
2012-07-09 1:41 ` [PATCH] Restore umasks influence on the permissions of work tree created by clone Junio C Hamano
2012-07-09 18:21 ` Alex Riesen
2012-07-09 22:58 ` Jeff King
2012-07-09 23:07 ` Junio C Hamano
2012-07-09 23:18 ` Junio C Hamano
2012-07-09 23:28 ` [PATCH] rerere: make rr-cache fanout directory honor umask Junio C Hamano
2012-07-10 6:37 ` Jeff King
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=20120707215029.GA26819@blimp.dmz \
--to=raa.lkml@gmail.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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).