git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Monitoring a repository for changes
@ 2017-06-21 14:27 Tim Hutt
  2017-06-21 15:04 ` Ævar Arnfjörð Bjarmason
  2017-06-21 21:19 ` Jonathan Nieder
  0 siblings, 2 replies; 9+ messages in thread
From: Tim Hutt @ 2017-06-21 14:27 UTC (permalink / raw)
  To: git

Hi,

Currently if you want to monitor a repository for changes there are
three options:

* Polling - run a script to check for updates every 60 seconds.
* Server side hooks
* Web hooks (on Github, Bitbucket etc.)

Unfortunately for many (most?) cases server-side hooks and web hooks
are not suitable. They require you to both have admin access to the
repo and have a public server available to push updates to. That is a
huge faff when all I want to do is run some local code when a repo is
updated (e.g. play a sound).

Currently people resort to polling
(https://stackoverflow.com/a/5199111/265521) which is just ugly. I
would like to propose that there should be a forth option that uses a
persistent connection to monitor the repo. It would be used something
like this:

    git watch https://github.com/git/git.git

or

    git watch git@github.com:git/git.git

It would then print simple messages to stdout. The complexity of what
it prints is up for debate, - it could be something as simple as
"PUSH\n", or it could include more information, e.g. JSON-encoded
information about the commits. I'd be happy with just "PUSH\n" though.

In terms of implementation, the HTTP transport could use Server-Sent
Events, and the SSH transport can pretty much do whatever so that
should be easy.

Thoughts?

Tim

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-21 22:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-21 14:27 Monitoring a repository for changes Tim Hutt
2017-06-21 15:04 ` Ævar Arnfjörð Bjarmason
2017-06-21 19:44   ` Jeff King
2017-06-21 19:55     ` Stefan Beller
2017-06-21 19:52   ` Eric Wong
2017-06-21 21:56     ` Ævar Arnfjörð Bjarmason
2017-06-21 22:20       ` Eric Wong
2017-06-21 22:36         ` Eric Wong
2017-06-21 21:19 ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).