git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Does git have "Path-Based Authorization"?

From
GGrant <emailgrant@gmail.com>
Date
Oct 2, 2011, 02:53 UTC
Message-ID
<CAN0CFw2gVH7=LdKhseE3zo+Av_=kVdz=tH3s=BKeTK9bDOprcw@mail.gmail.com>
In-Reply-To
<CAMK1S_icdpCyA8SBcNu8CbCk3N-h8yEYZ9+6N=JVPAeayuzSPw@mail.gmail.com>
Show 49 quoted lines
>>>> Hello, I'm trying to decide between git and subversion.  Subversion
>>>> has "Path-Based Authorization" so I can give a developer access to
>>>> only specific files instead of everything.  Does git have something
>>>> similar?
>>>>
>>>> http://svnbook.red-bean.com/en/1.5/svn.serverconfig.pathbasedauthz.html
>>>
>>> In distributed version control systems each developers gets full copy
>>> (a clone) of a repository (separate repository instance).  This means that
>>> if you want for developer to see only specified subset of repository
>>> (specific subdirectories) you would have to split repository into
>>> submodules, and control access on (sub)repository basis.
>>
>> I do want to prevent reading of all but one or a few specified files
>> at a time.  I did some reading on the differences between centralized
>> and distributed version control systems, and I can see how a
>> distributed system may be better for open source projects, but a
>> business project like mine may work better with centralized control.
>> Would you guys agree in general?  Easier read/write control of
>> individual files in the repository is one benefit of the centralized
>> model I will put to use.
>>
>>> However if you want only to prevent developer from making changes outside
>>> specific subdirectory or specified files, you can do that on publish time
>>> via update / pre-receive hook (like contrib/hooks/update-paranoid), or git
>>> repository management tool such as Gitolite.  That would prevent a push if
>>> any of commits being published touches files that it shouldn't.
>>>
>>> P.S. Karl Fogel in "Producing Open Source Software" (http://producingoss.com)
>>> writes that social solutions wrt. restricting contributors to given area
>>> are better than technical solutions such as (overly-)strict access
>>> control.
>>
>> When I started this thread, I didn't realize the fact that my project
>> is not open-source would help decide which version control system to
>> use.  Now I see that it does factor into the decision so I apologize
>> for not mentioning it previously.
>
> I'm afraid I did not follow the full thread, but I can assure you we
> have several "secret secret" type projects at work, both mine as well
> as many others.
>
> There are a few occasions when they need the kind of stuff you seem to
> want more regularly, (the only one I can really recall is one of our
> largest customers has a custom version of one of our product for
> themselves and do not want people working on the generic version to
> see those changes in case they propagate to their competitors).  We
> just do that by using a different repo entirely, and making sure
> changes to common code migrate only one way.

How would something like that work in a case like mine where I have a series of maybe 100 files and I only want to give my developer read/write access to one or a few files at a time with no read or write access to any of the other files? Wouldn't setting up a different repo for each set of files be difficult to manage?

- Grant
> Git has too many advantages over legacy VCSs like SVN for people to
> throw it over for something as simple as this.
Previous: Sitaram ChamartyNext: Nguyen Thai Ngoc Duy
Message 10 of 15 in “Does git have "Path-Based Authorization"?”
  1. GrantSep 30, 2011
  2. Carlos Martín NietoOct 1, 2011
  3. GrantOct 1, 2011
  4. Nguyen Thai Ngoc DuyOct 1, 2011
  5. GrantOct 1, 2011
  6. david@lang.hmOct 1, 2011
  7. Jakub NarebskiOct 1, 2011
  8. GrantOct 2, 2011
  9. Sitaram ChamartyOct 2, 2011
  10. GrantOct 2, 2011
  11. Nguyen Thai Ngoc DuyOct 2, 2011
  12. GrantOct 2, 2011
  13. Andreas KreyOct 2, 2011
  14. Frans KlaverOct 2, 2011
  15. Enrico WeigeltOct 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.