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

Re: thoughts on a possible "pre-upload" hook

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 22, 2009, 16:17 UTC
Message-ID
<20090922161725.GS14660@spearce.org>
In-Reply-To
<vpqd45jvub6.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 8 quoted lines
> >>>>>> "Sitaram" == Sitaram Chamarty <sitaramc@gmail.com> writes:
> > Sitaram> As git is used more and more in corporate-type environments, at some
> > Sitaram> point it becomes convenient to have *branches* (or more accurately,
> > Sitaram> refs) that are not readable.
> 
> But that alone would make it rather painfull for the user : "git
> clone" would fail if any branch in the repository is not readable, for
> example.
No, what Sitaram is asking for is to have upload-pack not advertise
the hidden branches.  By not advertising them, the client cannot
send a "want" request for them, and they won't appear in the list
that clone believes exists when it creates the new local repository.
Thus, clone would succeed.
 
> Also, don't forget that branches are just references, which means that
> if you prevent reference A from being uploaded, then another reference
> B may point to the same commits as A, and then you can bypass the
> safety hook on A by using B.

Yes. But this is no different than having two different git repositories, A.git and B.git. Pushing commits from A.git into B.git allows someone to bypass A.git's filesystem read access control by instead reading those commits from B.git.

IOW, those who have access to the data must protect it. You can't do it entirely in software, especially when you don't control the user's computer.

-- 
Shawn.
Previous: Matthieu MoyNext: Sitaram Chamarty
Message 4 of 9 in “thoughts on a possible "pre-upload" hook”
  1. Sitaram ChamartySep 22, 2009
  2. Randal L. SchwartzSep 22, 2009
  3. Matthieu MoySep 22, 2009
  4. Shawn O. PearceSep 22, 2009
  5. Sitaram ChamartySep 25, 2009
  6. Matthieu MoySep 25, 2009
  7. Sitaram ChamartySep 25, 2009
  8. Adam BrewsterSep 28, 2009
  9. Sitaram ChamartySep 28, 2009

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.