Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Rafal Rusin <rafal.rusin@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: 'error: unable to set permission to './objects/...'
Date: Sun, 22 Nov 2009 15:27:45 -0800	[thread overview]
Message-ID: <7vd43acf7y.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <9bbf67fa0911221202r605de38coc2496b1f09123725@mail.gmail.com> (Rafal Rusin's message of "Sun\, 22 Nov 2009 21\:02\:12 +0100")

Rafal Rusin <rafal.rusin@gmail.com> writes:

> I'm hosting git repository on filesystem with 'chmod <some-file>'
> causing permission denied error (it's smbfs mounted directory),
> When I was doing push to such repo using file:// protocol, I got
> following error:
> error: unable to set permission to './objects/...'
>
> I did a small fix to sha1_file.c (patch in attachment) and git now
> warns when unable to chmod, and continues push. This resolved problem.
> What do you think about applying it?

Suppose the user wanted to use this as a shared public repository and
configured core.sharedrepository.  If we try to set shared-perm and notice
a failure but keep going, what happens to the resulting repository?  

For example, the umask of the user who is pushing objects, causing this
codepath to run, might be too tight to be usable for the purpose of making
the file readable for other members of the group.  And the chmod() fails
in this codepath.  Then what?  Wouldn't it make the resulting repository
unusable?

I think a _fix_ needs to first know why chmod is failing for you and
either

 (1) make it not to fail; or

 (2) Perhaps your filesystem is lying and the result of chmod happens to
     be Ok (iow, the resulting file may be readable/writable by people who
     are supposed to be able to, accoring to the core.sharedrepository
     settings), in which case make the code notice the situation and keep
     going _only when_ it is safe to do so.

I do not think your change to _unconditionally_ keep going is a fix.

  parent reply	other threads:[~2009-11-22 23:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 20:02 'error: unable to set permission to './objects/...' Rafal Rusin
2009-11-22 22:09 ` Miklos Vajna
2009-11-22 23:27 ` Junio C Hamano [this message]
2009-11-23  9:35   ` Rafal Rusin
2009-11-23 10:54     ` Junio C Hamano
2009-11-24  0:59       ` Rafal Rusin
2009-11-23  9:52   ` Martin Langhoff

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=7vd43acf7y.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rafal.rusin@gmail.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