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

Re: Restricting access to a branch

From
Jakub Narebski <jnareb@gmail.com>
Date
May 22, 2008, 08:16 UTC
Message-ID
<m3d4ne4uts.fsf@localhost.localdomain>
In-Reply-To
<7v63t7xgdg.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 22 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
> > What you *can* do is:
> >
> >  - rename the branch to something that includes a slash (aka 
> >    subdirectory). Let's call it "frozen/mybranch" as an example.
> >
> >  - do a 'git gc' to make sure that branch is in the packed refs file.
> >
> >  - make the subdirectory of that branch is unwritable (ie just do 
> >    something like "chmod -w refs/heads/frozen")
> >
> > and now the filesystem permissions should mean that you can't actually 
> > update that branch any more, even though you can read it.
> 
> Hmmmmm... and deleting of the branch would take the same lock used for
> updating, which is under frozen/ directory, so that is also safe.
> 
> That's sneaky.
> 
> I'd however throw that into "happens to work, unsure if we would want to
> promise supporting it as a _feature_ forever" category.

Another solution would be to make it lightweight tag, i.e. change if from refs/heads/somebranch to refs/tags/somebranch (by tagging, for example).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C Hamano
Message 5 of 5 in “Restricting access to a branch”
  1. Stephen HemmingerMay 21, 2008
  2. Junio C HamanoMay 22, 2008
  3. Linus TorvaldsMay 22, 2008
  4. Junio C HamanoMay 22, 2008
  5. Jakub NarebskiMay 22, 2008

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.