git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Son Luong Ngoc <sluongng@gmail.com>
To: "R. Diez" <rdiez1999@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to watch files in a Git repository
Date: Thu, 9 Jun 2022 10:33:20 +0200	[thread overview]
Message-ID: <7E6C6D02-8C56-48B5-B178-2F6B66542DBC@gmail.com> (raw)
In-Reply-To: <68627d29-8ffd-2e22-46ca-c28c9e980177@gmail.com>

Hi Diez,

> On Jun 6, 2022, at 6:04 PM, R. Diez <rdiez1999@gmail.com> wrote:
> 
> Hi all:
> 
> I would like to get a notification e-mail when certain files or directories change in a Git repository.
> 
> In the good old CVS days, you could just 'watch' a file with your favourite CVS GUI.
> 
> Some online services like GitHub offer their own notification mechanism, but I would like something generic. I am not looking for a hook solution, because the Git repositories may not be mine, so I may only have read access.
> 
> The idea is that I can set up a cron job to periodically pull a repository, and run a script to generate the e-mails from the commit history. Any new commits which match the desired branch and modify the desired files and/or directories would trigger the notifications.
> 
> I've searched the Web, but couldn't find anything straightforward.

I would encourage you to try SourceGraph’s CodeMonitoring feature (1).
You can configure a search query which target a file path inside
a repository, then it will send email to you when there are new
commits/diffs touching those files.

I have no affiliation with them except for being a happy end user.
In fact, I used SourceGraph extensively while studying git/git codebase.

> 
> If there is nothing of the sort, I could write my own script in Bash or Perl. I can handle cron and sending e-mails, but I do not know much about Git's internals. Could someone provide a few pointers about how to code this? I would expect there is some command to list commits, and all files touched by a particular commit. And there would be some way to interface with Bash or Perl, which does not need parsing complicated text output from Git.
> 
> Thanks in advance,
>  rdiez

Cheers,
Son Luong

(1): https://docs.sourcegraph.com/code_monitoring

      parent reply	other threads:[~2022-06-09  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 16:04 How to watch files in a Git repository R. Diez
2022-06-08 23:55 ` Jeff King
2022-06-09  6:16   ` rsbecker
2022-06-09 15:07     ` Jeff King
2022-06-09  8:33 ` Son Luong Ngoc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7E6C6D02-8C56-48B5-B178-2F6B66542DBC@gmail.com \
    --to=sluongng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rdiez1999@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).