git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Johnny Lee" <johnnylee194@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Error: unable to unlink ... when using "git gc"
Date: Tue, 6 Jan 2009 17:18:21 +0800	[thread overview]
Message-ID: <488807870901060118y2dbc7430ocea5cf9ce4bca3c7@mail.gmail.com> (raw)
In-Reply-To: <7vy6xohkt2.fsf@gitster.siamese.dyndns.org>

Thanks for your consideration Junio,

Peff has already helped me to figure out the root cause of this error
is a possible bad practice on collaboration work.

Here I attached the previous mail.

>>>>>>
Thanks Peff, I've checked the permission of .git/objects/16, it's
created by another user and thus I have no permission to remove it.

In fact, this is coming from a previous bad practice on setting up a
collaboration repository on a SSH server, here is what I've done so
far:
1. I have a server tomato, which has two users: "git" and "johnny"

2. User "git" has cloned a repository from elsewhere as ~git/golf/.git

3. User "johnny" has cloned this repository from git on another
machine, using command:
git clone johnny@tomato:~git/golf/.git localgit

4. It works fine, and user "johnny" has made some local commits and
wants to push the changes to git's repository, so he uses:
git push

5. But it's reported some errors about permissions, like:
error: Unable to append to logs/refs/heads/cupcake: Permission denied
error: Unable to append to logs/refs/remotes/origin/cupcake: Permission denied
error: Unable to append to logs/refs/remotes/origin/cupcake: Permission denied
ng refs/heads/cupcake failed to write
ng refs/remotes/origin/HEAD failed to write
ng refs/remotes/origin/cupcake failed to write
error: failed to push to 'johnny@tomato:~git/golf/.git'

6. That's normal, since the ~git/golf/.git is created by user "git",
and user "johnny" can't write it.

7. Then the user "git" has changed mode for all the files under .git
to writable.

8. This time, user "johnny" can push successfully.

9. But as you can see here, some files are created by user "johnny",
and thus user "git" can't write them.

It seems not a good practice for collaboration work, would you please
share your experiences with us?

Thanks very much and regards,
Johnny

On Tue, Jan 6, 2009 at 4:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> "Johnny Lee" <johnnylee194@gmail.com> writes:
>
>> While I'm looking at these "unable to unlink" files, it seems they are
>> read only:
>> git@tomato:~/golf$ ls -l .git/objects/16/
>> total 4
>> -r--r--r-- 1 johnny johnny 26 2009-01-05 09:25
>> b14f5da9e2fcd6f3f38cc9e584cef2f3c90ebe
>
>
> Check "ls -ld .git/objects/16" and see if it is owned by you and writable
> by you.
>
> In sane POSIX filesystem semantics, it should not pose with problem with
> respect to removal that a file is unwritable.
>
> What counts is the writability of the parent directory.
>



-- 
we all have our crosses to bear

  reply	other threads:[~2009-01-06  9:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06  7:00 Error: unable to unlink ... when using "git gc" Johnny Lee
2009-01-06  7:22 ` Jeff King
     [not found]   ` <488807870901052352w585da727r6d4a1e4ca4238cab@mail.gmail.com>
2009-01-06  8:03     ` Jeff King
2009-01-06  8:09       ` Johnny Lee
2009-01-06 11:57       ` Sitaram Chamarty
2009-01-06 15:05         ` Johnny Lee
2009-01-06 15:33           ` Sitaram Chamarty
2009-01-07  5:59             ` Jeff King
2009-01-07  6:27         ` Boyd Stephen Smith Jr.
2009-01-07 10:55           ` Sitaram Chamarty
2009-01-07 12:29             ` Sitaram Chamarty
2009-01-07 15:48             ` Boyd Stephen Smith Jr.
2009-01-07 18:00               ` Sitaram Chamarty
2009-01-07 19:46                 ` Boyd Stephen Smith Jr.
2009-01-06  8:59 ` Junio C Hamano
2009-01-06  9:18   ` Johnny Lee [this message]
2009-01-06 13:27     ` Matthieu Moy

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=488807870901060118y2dbc7430ocea5cf9ce4bca3c7@mail.gmail.com \
    --to=johnnylee194@gmail.com \
    --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).