Git development
 help / color / mirror / Atom feed
From: "Josh England" <jjengla@sandia.gov>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>, git@vger.kernel.org
Subject: Re: tracking perms/ownership
Date: Fri, 24 Aug 2007 01:22:51 -0600	[thread overview]
Message-ID: <1187940171.6357.59.camel@beauty> (raw)
In-Reply-To: <7vtzqpsy3q.fsf@gitster.siamese.dyndns.org>

On Thu, 2007-08-23 at 15:08 -0700, Junio C Hamano wrote: 
> "Josh England" <jjengla@sandia.gov> writes:
> 
> > Looking at the index struct, it already has fields in it for file mode
> > uid and gid (woohoo!).
> 
> I can see that storing textual names in gitattributes and having
> the root user run git so that it can chown(), would work.
> 
> But this is only about checkout.  After you chown a file in the
> work tree and run update-index, next write-tree would not record
> it, as there is no place in tree objects to record uid/gid.
> You would need to arrange so that a matching change is made in
> the gitattributes file if you go that route.

That's ok.  Any place to store the data is fine by me.  I'm just
concerned about some comments I saw in attrs.c <line13>:
/*
The basic design decision here is that we are not going to have insanely
large number of attributes.
This is a randomly chosen prime.
*/
#define HASHSIZE 257

Using a brute force perm/ownership attribute set for every file,
assuming a modestly populated linux distribution image having upwards of
150,000 files/directories in it, thats sticking over 100,000 attributes
into some .gitattributes file somewhere.  Do you think the gitattributes
system can handle this kind of abuse?

> If you had:
> 
> 	etc/*		owner=root
>         etc/frotz	owner=nobody
> 
> in gitattributes, and you did a checkout.  You chown etc/nitfol
> with "chown printer etc/nitfol".  Somebody needs to add a line
> 
> 	etc/nitfol	owner=printer
> 
> to gitattributes before you make the commit.

Unless this 'somebody' is an automated process that will never fly. I
want git to do it for me when the right config/attr is set (maybe at
update_index time).  Thats where my concern about the gitattributes
system comes from.  What's going to happen when I stick 150,000 (est)
attributes in there?

> Maybe the chown
> was not about etc/nitfol but about making etc/frotz owned by
> root.  Then you would, instead of adding the etc/nitfol line,
> remove existing etc/frotz line so that earlier glob would
> capture and express the idea of making everything owned by
> root.  I suspect this would get rather tricky quickly.

Maybe doable though.  Starting from the root of the tree, traverse
downwards and only add new attributes when a file or dir's ownership
has changed from the parent, maybe.  This could optimize away many of
the attributes needed.  I think a good place might be right in
index_path() because the lstat data is fresh and accessible.  Writing
attrs out to file if necessary should hopefully not add too much overhead.

-JE

  parent reply	other threads:[~2007-08-24  7:22 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 17:14 empty directories Josh England
2007-08-21 17:40 ` Sean
2007-08-22 21:25   ` Josh England
2007-08-22 23:25     ` Linus Torvalds
2007-08-22 23:55       ` David Kastrup
2007-08-23 15:24       ` Josh England
2007-08-23 21:51       ` tracking perms/ownership [was: empty directories] Josh England
2007-08-23 22:08         ` tracking perms/ownership Junio C Hamano
2007-08-23 23:30           ` Linus Torvalds
2007-08-24  6:16             ` David Kastrup
2007-08-24  6:37               ` Linus Torvalds
2007-08-24  7:38                 ` Josh England
2007-08-24  7:50                 ` David Kastrup
2007-08-24 17:51                   ` Linus Torvalds
2007-08-24 18:15                     ` Josh England
2007-08-24 18:23                       ` Linus Torvalds
2007-08-24 18:56                         ` Josh England
2007-08-24 20:37                           ` Junio C Hamano
2007-08-24 21:26                             ` Josh England
2007-08-24 19:33                       ` Robin Rosenberg
2007-08-24 21:30                     ` David Kastrup
2007-08-24  7:22           ` Josh England [this message]
2007-08-24  7:39             ` Junio C Hamano
2007-08-24  8:19               ` Josh England
2007-08-24 16:11           ` Josh England
2007-08-24 16:27             ` Josh England
2007-08-24  9:38         ` tracking perms/ownership [was: empty directories] Johannes Schindelin
2007-08-24  9:52           ` Jeff King
2007-08-24 15:50             ` Josh England
2007-08-24 20:58               ` Jeff King
2007-08-25 14:31                 ` Johannes Schindelin
2007-08-25 14:46                   ` tracking perms/ownership Junio C Hamano
2007-08-25 19:35                     ` Junio C Hamano
2007-08-24 10:05           ` tracking perms/ownership [was: empty directories] Jeff King
2007-08-25 14:30             ` Johannes Schindelin
2007-08-24 17:10       ` empty directories Jason Garber
2007-08-22 23:40     ` Jakub Narebski
2007-08-22  0:06 ` Jakub Narebski
2007-08-22  4:31 ` Salikh Zakirov
2007-08-22 18:46   ` Linus Torvalds
2007-08-22 19:12     ` David Kastrup

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=1187940171.6357.59.camel@beauty \
    --to=jjengla@sandia.gov \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.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