Re: Git changes permissions on directories when deleting files.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 28, 2011 at 9:19 PM, Computer Druid <computerdruid@xxxxxxxxx> wrote:
> On Mon, Feb 28, 2011 at 8:42 PM, Chad Joan <chadjoan@xxxxxxxxx> 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?
>

Nope.

> 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
>

'somedir' still has plenty of files in it after the deletion, so I'm
afraid this isn't the case.

- Chad
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]