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

Re: Can I enforce required approval on some files

From
BSBruce Stephens <bruce.stephens@isode.com>
Date
Jul 20, 2010, 20:45 UTC
Message-ID
<80pqyhc27m.fsf@tiny.isode.net>
In-Reply-To
<AANLkTinQI9eBnwjzPhYHMM8XZ0ODfHJ1qiZJrNWQWUno@mail.gmail.com>
Dominik Gront <dgront@gmail.com> writes:
Show 6 quoted lines
> I have been a happy SVN user for quite a long time, but now I miss
> some functionality in Subversion. I wonder if it could be done in git.
> If so, I convert to git right away :-)
>
> There are some files in our repository that all their modification
> need to be approved by a project leader.

Either have the repository owned by someone who'll do whatever checking you want (which seems to be common at least amongst the public projects) or use hooks in a shared repository. Specifically the update hook.

The hook can do whatever checking you deem appropriate. At work we have it check the commit message for Signed-off-by names (in our context it really means Reviewed-by; we use sob because that's more convenient to add). The hook could look at which files are changed or whatever else you wanted. (Notice it gets called to update a ref, and that may involve more than one commit, so be sure to check all the relevant commits.)

[...]
Previous: Dominik GrontNext: Sylvain Rabot
Message 2 of 6 in “Can I enforce required approval on some files”
  1. Dominik GrontJul 20, 2010
  2. Bruce StephensJul 20, 2010
  3. Sylvain RabotJul 20, 2010
  4. Jakub NarebskiJul 20, 2010
  5. Ævar Arnfjörð BjarmasonJul 21, 2010
  6. Jakub NarebskiJul 21, 2010

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.