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

Re: what are the chances of a 'pre-upload' hook?

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Nov 25, 2011, 16:18 UTC
Message-ID
<CAMK1S_i8e4q8kJxkQam+Tim1mPfo7dGPbi8bmgLt=ZqeA=1MOQ@mail.gmail.com>
In-Reply-To
<4ECF939D.8020706@op5.se>
On Fri, Nov 25, 2011 at 6:39 PM, Andreas Ericsson <ae@op5.se> wrote:
Show 5 quoted lines
> People who fetch but don't push is, by far, the vast majority of git users.
> Think of everyone fetching from any public software repository without
> having write access to it. If you think of git.git and linux.git alone
> I think it's safe to assume the number of "fetch-no-push" outnumber the
> "push-and-whatnot" group by some quarter million to one.

But in those environments the person pulling does not even have an ID so how is he at risk with the hook running?

Show 12 quoted lines
>> I may be wrong but I imagine shared environments are those where
>> almost everyone will push at least once in a while.  It's a closed
>> group of people, probably all developers, etc etc etc...
>>
>
> Not really. We fetch from each other quite a lot at work, and from
> each others semi-public repositories on a shared server where we've
> all got accounts (ie, write access), but we very, very rarely push
> into each others repositories. The sharepoint is the "official" repo
> on the repo-server, which the buildbots gets its code from and where
> everything to be released, maintained or handled in some way in the
> future resides.

Yes, and this is the only situation where it does have the issue. I'm just not sure how common this is.

It's fine if you tell me I'm wrong and that this *is* still very common. I'll back off.

But everyone seems to be bringing in github and public repos as part of the argument, and I don't see how they're relevant to the original security issue of the guy who pulls having his account compromised.

Show 5 quoted lines
> Anyways. Shooting down the arguments *against* pre-upload hooks are
> quite silly if it's not combined with some fresh arguments *for* such
> a hook.
>
> So... What usecase do you envision where you'd need one?

I'm writing a caching proxy that helps with bandwidth issues when too many people in a bad-WAN site want to clone some huge repo from its canonical site. The only one I found by googling fiddles with the git protocol itself, and I hate doing things like that.

Ignoring all the details, the pre-upload hook would have checked some conditions and fired off a fetch from the remote site if those checks passed.

It's easy enough to do it from cron but it would have been more elegant this way.

Previous: Andreas EricssonNext: Jeff King
Message 6 of 23 in “what are the chances of a 'pre-upload' hook?”
  1. Sitaram ChamartyNov 25, 2011
  2. Martin FickNov 25, 2011
  3. Martin FickNov 25, 2011
  4. Sitaram ChamartyNov 25, 2011
  5. Andreas EricssonNov 25, 2011
  6. Sitaram ChamartyNov 25, 2011
  7. Jeff KingNov 25, 2011
  8. Junio C HamanoNov 26, 2011
  9. Jeff KingNov 26, 2011
  10. Junio C HamanoNov 26, 2011
  11. Jeff KingNov 26, 2011
  12. Junio C HamanoNov 27, 2011
  13. Jeff KingNov 26, 2011
  14. Jeff KingNov 27, 2011
  15. Junio C HamanoNov 27, 2011
  16. Sitaram ChamartyNov 27, 2011
  17. Junio C HamanoNov 28, 2011
  18. Jeff KingNov 28, 2011
  19. Sitaram ChamartyNov 28, 2011
  20. Sitaram ChamartyNov 28, 2011
  21. Jeff KingNov 28, 2011
  22. Jeff KingNov 28, 2011
  23. Jeff KingNov 28, 2011

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.