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

Re: renaming remote branches

From
Jeff King <peff@peff.net>
Date
Apr 16, 2009, 08:18 UTC
Message-ID
<20090416081835.GA26972@coredump.intra.peff.net>
In-Reply-To
<buoab6h2fko.fsf@dhlpc061.dev.necel.com>
On Thu, Apr 16, 2009 at 05:00:39PM +0900, Miles Bader wrote:
Show 7 quoted lines
> > If you are not sharing your repo over a dumb transport (like http), then
> > the contents of .git/info/refs shouldn't matter. If you are, then you
> > should enable the post-update hook to run update-server-info after every
> > push (i.e., it is not just the deletion that is a problem, but none of
> > your pushes is being marked in .git/info/refs).
> 
> Hmmm, there's no way to update the hooks without shell access, right...?

No, not through any means shipped with git itself. There are obvious security implications to arbitrarily modifying hooks, since they are runnable code. In other words, updating hooks is a great way to _get_ shell access. :)

There is no reason to forbid enabling hooks which have been pre-approved by the site admin, but such a policy decision is outside the scope of git itself. The only mechanism git provides is the "templates" feature of init (so that a site admin can apply the same hook setup to all repos as they are created).

> [lots of stuff seems undoable without shell access, i.e., changing
> .git/descriptions; it'd be nice if there was at least some way to frob
> all this stuff ...]

In general, git takes the approach that users can edit files in .git/ directly, and for setups where they can't, it is up to the site admin to make wrappers implementing whatever policy they want. Third party tools can provide the mechanism for accomplishing that (I don't know what support something like gitosis has for enabling hooks, updating descriptions, or moving branches, though).

-Peff
Previous: Miles BaderNext: Jay Soffian
Message 4 of 9 in “renaming remote branches”
  1. Miles BaderApr 16, 2009
  2. Jeff KingApr 16, 2009
  3. Miles BaderApr 16, 2009
  4. Jeff KingApr 16, 2009
  5. Jay SoffianApr 16, 2009
  6. Jeff KingApr 16, 2009
  7. Miles BaderApr 17, 2009
  8. Jeff KingApr 17, 2009
  9. Dmitry PotapovApr 17, 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.