Document project origin behaviour in man

This commit is contained in:
Félix Saparelli 2022-04-13 09:09:13 +12:00
parent 036d9a27e8
commit 6b0f626441
3 changed files with 42 additions and 2 deletions

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "WATCHEXEC" "1" "March 2022" "" ""
.TH "WATCHEXEC" "1" "April 2022" "" ""
.
.SH "NAME"
\fBwatchexec\fR \- execute commands when watched files change
@ -146,6 +146,21 @@ Print the version of watchexec\.
\fB\-h\fR, \fB\-\-help\fR
Print a help message\.
.
.SH "PATHS"
By default, Watchexec watches the current directory\. This can be changed with the \fB\-\-watch\fR option, which can be passed multiple times\.
.
.P
Upon starting, Watchexec resolves a "project origin" from the watched paths\. To do so, it recurses up every parent directory from each watched path, looking for file and directory patterns which indicate a project origin among many different software systems, such as a Git repo, Cargo crate, licensing files, readmes, workspace configuration, etc\. For the full current list, consult the source at \fBlib/src/project\.rs\fR\.
.
.P
Once it has a list of "potential project origins", it resolves the common prefix they all have, and uses this as the overall project origin\. Note that the home directory is excluded from potential origins unless it\'s explicitly requested as a watched path\.
.
.P
The overall project origin is used to find and resolve ignore files, such that in most cases it acts as one would expect for a tool that runs anywhere inside a project\.
.
.P
For this reason, it is not recommended to use Watchexec for watching disparate folders in a filesystem, where those would resolve to a too\-broad project origin\.
.
.SH "ENVIRONMENT"
In variables that contain lists of paths, the separator is as for the \fB$PATH\fR environment variable (a colon, or semicolon on Windows)\.
.

View File

@ -63,6 +63,7 @@
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#PATHS">PATHS</a>
<a href="#ENVIRONMENT">ENVIRONMENT</a>
<a href="#FILES">FILES</a>
<a href="#EXAMPLES">EXAMPLES</a>
@ -148,6 +149,18 @@
</dl>
<h2 id="PATHS">PATHS</h2>
<p>By default, Watchexec watches the current directory. This can be changed with the <code>--watch</code> option, which can be passed multiple times.</p>
<p>Upon starting, Watchexec resolves a "project origin" from the watched paths. To do so, it recurses up every parent directory from each watched path, looking for file and directory patterns which indicate a project origin among many different software systems, such as a Git repo, Cargo crate, licensing files, readmes, workspace configuration, etc. For the full current list, consult the source at <code>lib/src/project.rs</code>.</p>
<p>Once it has a list of "potential project origins", it resolves the common prefix they all have, and uses this as the overall project origin. Note that the home directory is excluded from potential origins unless it's explicitly requested as a watched path.</p>
<p>The overall project origin is used to find and resolve ignore files, such that in most cases it acts as one would expect for a tool that runs anywhere inside a project.</p>
<p>For this reason, it is not recommended to use Watchexec for watching disparate folders in a filesystem, where those would resolve to a too-broad project origin.</p>
<h2 id="ENVIRONMENT">ENVIRONMENT</h2>
<p>In variables that contain lists of paths, the separator is as for the <code>$PATH</code> environment variable (a colon, or semicolon on Windows).</p>
@ -267,7 +280,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>March 2022</li>
<li class='tc'>April 2022</li>
<li class='tr'>watchexec(1)</li>
</ol>

View File

@ -108,6 +108,18 @@ Print the version of watchexec.
* `-h`, `--help`:
Print a help message.
## PATHS
By default, Watchexec watches the current directory. This can be changed with the `--watch` option, which can be passed multiple times.
Upon starting, Watchexec resolves a "project origin" from the watched paths. To do so, it recurses up every parent directory from each watched path, looking for file and directory patterns which indicate a project origin among many different software systems, such as a Git repo, Cargo crate, licensing files, readmes, workspace configuration, etc. For the full current list, consult the source at `lib/src/project.rs`.
Once it has a list of "potential project origins", it resolves the common prefix they all have, and uses this as the overall project origin. Note that the home directory is excluded from potential origins unless it's explicitly requested as a watched path.
The overall project origin is used to find and resolve ignore files, such that in most cases it acts as one would expect for a tool that runs anywhere inside a project.
For this reason, it is not recommended to use Watchexec for watching disparate folders in a filesystem, where those would resolve to a too-broad project origin.
## ENVIRONMENT
In variables that contain lists of paths, the separator is as for the `$PATH` environment variable (a colon, or semicolon on Windows).