[PATCH 3 of 5 rfc] posix: give checkexec a fast path; keep the check files and test read only

Matt Mackall mpm at selenic.com
Mon Nov 2 18:26:10 UTC 2015


On Sat, 2015-10-24 at 18:32 +0200, Mads Kiilerich wrote:
> +                if m & EXECFLAGS:
> +                    # checknoexec exists but is exec
> +                    os.unlink(checknoexec)
> +                    return False

I don't think this is sufficient. This case can occur, for instance, if
someone naively copies a repo from one machine to another with a USB
stick. Or perhaps they've done a naive recursive chmod. Then we're
permanently stuck thinking our filesystem doesn't have exec bits. If
our fast-path files don't have the right permissions (for who knows
what reasons), then we have to do the entire slow path.

Also, putting knowledge of the existence of .hg/cache here is a classic
layering violation.

But generally, this idea of keeping files in the cache that visibly
demonstrate properties of the filesystem is a good one.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list