# git-p4 + watchman - watching the p4 repo?

2 messages from 2018-01-08 to 2018-01-08. Participants: Luke Diamand, Ben Peart.
Thread: https://gitlist.dev/t/47567

## Luke Diamand, 2018-01-08 17:15

Subject: git-p4 + watchman - watching the p4 repo?
Message-ID: <CAE5ih79t8N969E-8qm9JMNZZo6qvRqw6GA=b6UTHskB-ozt7Fg@mail.gmail.com>
URL: https://gitlist.dev/e/CAE5ih79t8N969E-8qm9JMNZZo6qvRqw6GA%3Db6UTHskB-ozt7Fg%40mail.gmail.com

```
Hi!

I could be wrong about this, but I when I tried mixing watchman with
git-p4, I found that on "git p4 submit" it ended up watching the p4
repo, which seems a bit pointless (and was also very slow).

$ [create git-p4 clone of some p4 repo]
$ : >bar
$ git add bar && git commit -m 'adding bar'
$ git p4 submit --origin HEAD^ --shelve
Perforce checkout for depot path //depot/ located at /tmp/p4/cli/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying 4ce4057 change
//depot/bar#1 - opened for edit
Adding '/tmp/p4/cli' to watchman's watch list.

Is there any way to stop it doing this?

Thanks!
Luke

```

## Ben Peart, 2018-01-08 17:42

Subject: RE: git-p4 + watchman - watching the p4 repo?
Message-ID: <DM5PR2101MB0902FE564628A5604AB860F9F4130@DM5PR2101MB0902.namprd21.prod.outlook.com>
URL: https://gitlist.dev/e/DM5PR2101MB0902FE564628A5604AB860F9F4130%40DM5PR2101MB0902.namprd21.prod.outlook.com
In-Reply-To: <CAE5ih79t8N969E-8qm9JMNZZo6qvRqw6GA=b6UTHskB-ozt7Fg@mail.gmail.com>

```
I haven't used perforce so am unfamiliar with any behaviors specific to that but the logic to have git automatically tell watchman to start watching repos is just a convenience feature.  Feel free to remove/disable/modify it in the fsmonitor-watchman integration script:

	if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) {
		print STDERR "Adding '$git_work_tree' to watchman's watch list.\n";
		$retry--;
		qx/watchman watch "$git_work_tree"/;

Ben

> -----Original Message-----
> From: Luke Diamand [mailto:luke@diamand.org]
> Sent: Monday, January 8, 2018 12:15 PM
> To: Git Users <git@vger.kernel.org>
> Cc: Alex Vandiver <alexmv@dropbox.com>; Ben Peart
> <Ben.Peart@microsoft.com>
> Subject: git-p4 + watchman - watching the p4 repo?
> 
> Hi!
> 
> I could be wrong about this, but I when I tried mixing watchman with git-p4, I
> found that on "git p4 submit" it ended up watching the p4 repo, which seems
> a bit pointless (and was also very slow).
> 
> $ [create git-p4 clone of some p4 repo]
> $ : >bar
> $ git add bar && git commit -m 'adding bar'
> $ git p4 submit --origin HEAD^ --shelve
> Perforce checkout for depot path //depot/ located at /tmp/p4/cli/
> Synchronizing p4 checkout...
> ... - file(s) up-to-date.
> Applying 4ce4057 change
> //depot/bar#1 - opened for edit
> Adding '/tmp/p4/cli' to watchman's watch list.
> 
> Is there any way to stop it doing this?
> 
> Thanks!
> Luke

```
