git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Computer Druid <computerdruid@gmail.com>
To: Chad Joan <chadjoan@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git changes permissions on directories when deleting files.
Date: Mon, 28 Feb 2011 21:19:58 -0500	[thread overview]
Message-ID: <AANLkTinCjaGMe3TnheqORe7Y_qWYTAr3p6UEsK3u4VyE@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikJcOgBAZS=cCWULFYz4U_Mxx1gFMg51+r9qDo0@mail.gmail.com>

On Mon, Feb 28, 2011 at 8:42 PM, Chad Joan <chadjoan@gmail.com> wrote:
> Hello,
>
> What I'm experiencing is this:
>
> $ cd ~/project
> $ ls -dl somedir
> drwxrwx--- 1 cjoan cjoan 0 Feb 28 19:57 somedir
> $ echo "some text" > somedir/somefile.txt
> $ git add somedir/somefile.txt
> $ git rm -f somedir/somefile.txt
> rm 'somedir/somefile.txt'
> $ ls -dl somedir
> drw------- 1 cjoan cjoan 0 Feb 28 19:57 somedir
> $ echo "some text" > somedir/somefile.txt
> bash: somedir/somefile.txt: Permission denied

After you remove the file, is "somedir" empty?

Git doesn't track empty directories, and therefore git rm on the last
file in a directory deletes it:

% git init
Initialized empty Git repository in /home/cdruid/testrepo/.git/
% mkdir dir
% ls -l
total 4
drwxr-xr-x 2 cdruid cdruid 4096 Feb 28 21:14 dir
% touch dir/test.txt
% git add dir/test.txt
% git rm -f dir/test.txt
rm 'dir/test.txt'
% ls -l
total 0

My guess is git is somehow failing to delete the directory, thus
causing your changed permissions issue.

-Dan Johnson

  parent reply	other threads:[~2011-03-01  2:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  1:42 Git changes permissions on directories when deleting files Chad Joan
2011-03-01  1:45 ` Chad Joan
2011-03-01  2:19 ` Computer Druid [this message]
2011-03-01  4:00   ` Chad Joan
2011-03-01 15:51     ` Chad Joan
2011-03-01 17:11       ` Computer Druid
2011-03-01 19:35         ` Chad Joan
2011-03-01 19:44           ` Jeff King
2011-03-01 19:57             ` Chad Joan
2011-03-01 20:08               ` Jeff King
2011-03-01 20:30                 ` Chad Joan
2011-03-01 20:39                   ` Computer Druid
2011-03-01 20:57                     ` Jeff King
2011-03-01 20:43                   ` Matthieu Moy
2011-03-01 20:46                     ` Chad Joan
2011-03-01 21:08                       ` Jeff King
2011-03-03  3:48                         ` Chad Joan
2011-03-03 15:16                           ` Jeff King
2011-03-11  6:09                             ` Chad Joan

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=AANLkTinCjaGMe3TnheqORe7Y_qWYTAr3p6UEsK3u4VyE@mail.gmail.com \
    --to=computerdruid@gmail.com \
    --cc=chadjoan@gmail.com \
    --cc=git@vger.kernel.org \
    /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).