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

Git server side "pre-receive" hook to create new repositories

From
DJDimitri Joukoff <dimitri.joukoff@griffithuni.edu.au>
Date
Mar 9, 2019, 10:46 UTC
Message-ID
<SYXPR01MB095712C6765970605923A2FDDD4E0@SYXPR01MB0957.ausprd01.prod.outlook.com>

Some time ago, Feb 2018, I put in a proposal at Swift.org , that would allow the Swift Package Manager to clone packages from the Internet to a local git server and use the local version without requiring updates to the Swift package: https://forums.swift.org/t/proposal-to-enable-spm-to-use-a-local-repository-mirror/10291/5 . At the time, I also raised an issue at https://github.com/github/platform-samples/issues/171 asking for the feature described below. However, today I realised that that was not the right place to make such a request, and hence I've written this email.

The above thread contains a solution to the local mirror problem whose only drawback was that new repositories had to be MANUALLY initialised bare on the local server. In all other respects, in my opinion, the solution worked perfectly and saved me downloading huge amounts of data each time I performed a distribution clean on the project or switched to another project that used the same package. The solution published at Swift.org used a Ubuntu 16.04.2 server running Git 2.16.2, and the client was a Macbook Pro running MacOS with its default git.

Thus, this feature request is asking that the 'pre-receive' hook triggers when someone tries to push to a repository regardless of whether the repository exists. This would allow automatic creation of new repositories and smooth the work-flow described above. If the semantics of the existing 'pre-receive' hook are such that it would not be suitable for such a purpose, then an alternative way of providing the call-back ability would be implemented.

Best regards, Dimitri.

Next: Jeff King
Message 1 of 5 in “Git server side "pre-receive" hook to create new repositories”
  1. Dimitri JoukoffMar 9, 2019
  2. Jeff KingMar 19, 2019
  3. Ævar Arnfjörð BjarmasonMar 19, 2019
  4. Dimitri JoukoffMar 19, 2019
  5. Sitaram ChamartyMar 21, 2019

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.