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

Re: restriction of pulls

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 10, 2007, 14:50 UTC
Message-ID
<Pine.LNX.4.63.0702101533060.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<45CC941E.9030808@dawes.za.net>
Hi,
On Fri, 9 Feb 2007, Rogan Dawes wrote:
Show 12 quoted lines
> Johannes Schindelin wrote:
> > 
> > On Fri, 9 Feb 2007, Christoph Duelli wrote:
> > 
> > > Is it possible to restrict a chechout, clone or a later pull to some 
> > > subdirectory of a repository?
> > 
> > No. In git, a revision really is a revision, and not a group of file 
> > revisions.
> 
> I thought about how this might be implemented, although I'm not entirely 
> sure how efficient this will be.
There are basically three ways I can think of:
- rewrite the commit objects on the fly. You might want to avoid the use 
of the pack protocol here (i.e. use HTTP or FTP transport).
- try to teach git a way to ignore certain missing objects and 
directories. This might be involved, but you could extend upload-pack 
easily with a new extension for that.
(my favourite:)
- use git-split to create a new branch, which only contains doc/. Do work 
only on that branch, and merge into mainline from time to time.
If you don't need the history, you don't need to git-split the branch.

You only need to make sure that the newly created branch is _not_ branched off of mainline, since the next merge would _delete_ all files outside of doc/ (merge would see that the files exist in mainline, and existed in the common ancestor, too, so would think that the files were deleted in the doc branch).

Ciao, Dscho

Previous: Andy ParkinsNext: Rogan Dawes
Message 10 of 13 in “restriction of pulls”
  1. Christoph DuelliFeb 9, 2007
  2. Jakub NarebskiFeb 9, 2007
  3. Johannes SchindelinFeb 9, 2007
  4. Rogan DawesFeb 9, 2007
  5. Andy ParkinsFeb 9, 2007
  6. Rogan DawesFeb 9, 2007
  7. Andy ParkinsFeb 9, 2007
  8. Rogan DawesFeb 9, 2007
  9. Andy ParkinsFeb 10, 2007
  10. Johannes SchindelinFeb 10, 2007
  11. Rogan DawesFeb 12, 2007
  12. Johannes SchindelinFeb 12, 2007
  13. Rogan DawesFeb 12, 2007

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.