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

Re: preventing a push

From
CDChristoph Duelli <duelli@melosgmbh.de>
Date
Dec 18, 2007, 16:53 UTC
Message-ID
<4767FAF6.6050204@melosgmbh.de>
In-Reply-To
<alpine.LFD.0.9999.0712180819480.21557@woody.linux-foundation.org>
Linus Torvalds schrieb:
Show 8 quoted lines
> 
> On Tue, 18 Dec 2007, Christoph Duelli wrote:
>> Is there a (recommended?) way to prevent accidental pushing (or pulling) from
>> one repository into another (like the level command from bk days)?
> 
> I used BK for years, never knew about any level thing. I assume that was 
> some way to introduce an "ordering" between repositories, where you could 
> only push/pull in a controlled manner?
Indeed, you can not move changes to a repo with a lower level.
Show 5 quoted lines
> There's no obvious way to do exactly that, but the hooks git has may or 
> may not be ok. For example, if you want to disallow pushing into some 
> repository entirely (because you _only_ expect people to pull into it), 
> you should be able to just make a "pre-receive" hook that always returns 
> false. See Documentation/hooks.txt.
Ok, I will give hooks a try here.
Show 11 quoted lines
> NOTE! There is no way to figure out what the pushing repository status is, 
> which is why I say there is no way to do a "level"-equivalent thing 
> (assuming I guessed what "level" does from the name). However, depending 
> on how you allow people to access the machine, the hook obviously can look 
> at things like $USER or other environment variables (ie you could make it 
> look at what machine the user connected from etc).
> 
> But nothing really ever identifies the source repository (on a "git 
> level") for a push: as far as git is concerned, all repositories are 
> equal, and your hooks would invariably have to use non-git knowledge to 
> figure out whether some operation should be allowed or not.

Perhaps it would be more git-like to use branches here. An accidental merge from a branch to another is probably less likely than an accidental push.

Thanks, and best regards
Christoph
Previous: Linus Torvalds
Message 3 of 3 in “preventing a push”
  1. Christoph DuelliDec 18, 2007
  2. Linus TorvaldsDec 18, 2007
  3. Christoph DuelliDec 18, 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.