[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git: how to figure out with a script what the last commit on remote repo is without fetching it



Joel Rees <joel.rees@gmail.com> writes:

> 2014/09/14 6:55 "lee" <lee@ <lee@yun.yagibdah.de>yun.yagibdah.de
> <lee@yun.yagibdah.de>>:
>>
>> Joel Rees <joel.rees <joel.rees@gmail.com>@ <joel.rees@gmail.com>gmail.com
> <joel.rees@gmail.com>> writes:
>>
>> > 2014/09/12 3:35 "lee" <lee@ <lee@yun.yagibdah.de>yun.yagibdah.de
> <lee@yun.yagibdah.de>>:
>> >>
>> >> [...]
>> >> Well, I don't want to program some sort of meta-git ...  I merely want
> a
>> >> simple way to be informed about new commits.
>> >
>> > I'm still wondering whether a cron job that does a status request on the
>> > head in question wouldn't be good enough.
>>
>> Like Jonathan suggested?  That would probably work fine for what I'm
>> doing with the repos reachable via https.
>
> I can't think of any reason it would be dependent on https connectivity.
> Any way you can reach the repository should allow scripted query, thus
> checking by a cron job.

Oh I don't think it's limited; the problem is to figure out how to use
other protocols like git to get the information.

>> > I don't recall svn or cvs doing this without using a hook, either, even
>> > though a commit does mean something else there.
>>
>> I suspect that the makers of these systems might not want users to pull
>> the information and thus decided not to implement a feature that allows
>> to get it in some easy way ...
>
> I know svn has such hooks.

Git does, too.  The difference is that when you set up a hook to, say,
send an email to some users, this doesn't burden the server as much as
when you have lots of people connecting all the time to poll
information.  The email is sent in one go, and its delivery can be
offloaded to an MTA that sends it to 50k users or so within its own
time.

With polling, these 50k users each connecting three times a day makes
150k connections to the git server.  The git server would have to be
able to completely handle each connection within 0.576 seconds, and it
might become unreachable during spikes.


-- 
Knowledge is volatile and fluid.  Software is power.


Reply to: