From: Jeff King <peff@peff.net>
To: Chad Joan <chadjoan@gmail.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Computer Druid <computerdruid@gmail.com>,
git@vger.kernel.org
Subject: Re: Git changes permissions on directories when deleting files.
Date: Thu, 3 Mar 2011 10:16:09 -0500 [thread overview]
Message-ID: <20110303151608.GD1074@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTi=nFMDHR5WL=TiFmshFkxLMF9N4dNEjqw+r7wyh@mail.gmail.com>
On Wed, Mar 02, 2011 at 10:48:00PM -0500, Chad Joan wrote:
> It seems to be working! I've tried it with 'git rm' and when pulling
> deletions.
Great.
> I imagine that race condition can happen if files in the directory are
> being modified while git does an rmdir? If that's the case then I'm
> not too worried. There is only one other programmer that might be
> working with me at the same time on an infrequently used directory.
The race condition I mentioned earlier was for a different workaround.
Basically there are two strategies, each with a difference race:
1. Don't rmdir on non-empty directories. This means we have to opendir
the directory and look for entries before rmdir(). If there is file
activity in the directory while we are looking we may think it is
empty when it's not and rmdir(), screwing up the permissions.
2. Before any rmdir, check permissions. Do the rmdir, and then restore
the permissions if rmdir fails. The race here is if somebody is
modifying the permissions on a non-empty directory, we may
overwrite their changes.
Obviously the patch does (2), so there is still that race.
> diff -crB git-1.7.3.4/dir.c git-1.7.3.4-new/dir.c
Context diff? Eww. There is this awesome tool called "git" that can help
you with managing versions of software. :)
-Peff
next prev parent reply other threads:[~2011-03-03 15:16 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
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 [this message]
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=20110303151608.GD1074@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=chadjoan@gmail.com \
--cc=computerdruid@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).