Patchwork [4,of,4,V2] help: add documentation on include: and subinclude:

login
register
mail settings
Submitter Durham Goode
Date May 22, 2015, 8:50 p.m.
Message ID <2b63a563eb2261724bfe.1432327818@dev2000.prn2.facebook.com>
Download mbox | patch
Permalink /patch/9245/
State Accepted
Delegated to: Augie Fackler
Headers show

Comments

Durham Goode - May 22, 2015, 8:50 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1432158849 25200
#      Wed May 20 14:54:09 2015 -0700
# Node ID 2b63a563eb2261724bfe7af5242513eac2573e10
# Parent  c59d30a0fdb81e9a0a3f1a8c1f45e97752b9b018
help: add documentation on include: and subinclude:

Adds some help text about the new include: and subinclude: match syntax.
Augie Fackler - May 26, 2015, 3:03 p.m.
On Fri, May 22, 2015 at 01:50:18PM -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1432158849 25200
> #      Wed May 20 14:54:09 2015 -0700
> # Node ID 2b63a563eb2261724bfe7af5242513eac2573e10
> # Parent  c59d30a0fdb81e9a0a3f1a8c1f45e97752b9b018
> help: add documentation on include: and subinclude:

Other than my nit on patch 1, I like this series, but need feedback
from match experts (Martin). If I don't hear negative feedback in the
next day or so I'll take these. Thanks!

>
> Adds some help text about the new include: and subinclude: match syntax.
>
> diff --git a/mercurial/help/hgignore.txt b/mercurial/help/hgignore.txt
> --- a/mercurial/help/hgignore.txt
> +++ b/mercurial/help/hgignore.txt
> @@ -68,6 +68,10 @@ the form ``*.c`` will match a file endin
>  and a regexp pattern of the form ``\.c$`` will do the same. To root a
>  regexp pattern, start it with ``^``.
>
> +Subdirectories can have their own .hgignore settings by adding
> +``subinclude:path/to/subdir/.hgignore`` to the root ``.hgignore``. See
> +:hg:`help patterns` for details on ``subinclude:`` and ``include:``.
> +
>  .. note::
>
>    Patterns specified in other than ``.hgignore`` are always rooted.
> diff --git a/mercurial/help/patterns.txt b/mercurial/help/patterns.txt
> --- a/mercurial/help/patterns.txt
> +++ b/mercurial/help/patterns.txt
> @@ -30,6 +30,12 @@ The latter expects null delimited patter
>  feeds. Each string read from the file is itself treated as a file
>  pattern.
>
> +To read a set of patterns from a file, use ``include:`` or ``subinclude:``.
> +``include:`` will use all the patterns from the given file and treat them as if
> +they had been passed in manually.  ``subinclude:`` will only apply the patterns
> +against files that are under the subinclude file's directory. See :hg:`help
> +hgignore` for details on the format of these files.
> +
>  All patterns, except for ``glob:`` specified in command line (not for
>  ``-I`` or ``-X`` options), can match also against directories: files
>  under matched directories are treated as matched.
> @@ -60,3 +66,9 @@ File examples::
>    listfile0:list.txt read list from list.txt with null byte delimiters
>
>  See also :hg:`help filesets`.
> +
> +Include examples::
> +
> +  include:path/to/mypatternfile    reads patterns to be applied to all paths
> +  subinclude:path/to/subignorefile reads patterns specifically for paths in the
> +                                   subdirectory
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Martin von Zweigbergk - May 26, 2015, 3:58 p.m.
On Tue, May 26, 2015 at 8:03 AM Augie Fackler <raf@durin42.com> wrote:

> On Fri, May 22, 2015 at 01:50:18PM -0700, Durham Goode wrote:
> > # HG changeset patch
> > # User Durham Goode <durham@fb.com>
> > # Date 1432158849 25200
> > #      Wed May 20 14:54:09 2015 -0700
> > # Node ID 2b63a563eb2261724bfe7af5242513eac2573e10
> > # Parent  c59d30a0fdb81e9a0a3f1a8c1f45e97752b9b018
> > help: add documentation on include: and subinclude:
>
> Other than my nit on patch 1, I like this series, but need feedback
> from match experts (Martin). If I don't hear negative feedback in the
> next day or so I'll take these. Thanks!
>

Looks good to me too, except for what Augie said about patch 1.
Augie Fackler - May 26, 2015, 6:26 p.m.
On Tue, May 26, 2015 at 03:58:35PM +0000, Martin von Zweigbergk wrote:
> On Tue, May 26, 2015 at 8:03 AM Augie Fackler <raf@durin42.com> wrote:
>
> > On Fri, May 22, 2015 at 01:50:18PM -0700, Durham Goode wrote:
> > > # HG changeset patch
> > > # User Durham Goode <durham@fb.com>
> > > # Date 1432158849 25200
> > > #      Wed May 20 14:54:09 2015 -0700
> > > # Node ID 2b63a563eb2261724bfe7af5242513eac2573e10
> > > # Parent  c59d30a0fdb81e9a0a3f1a8c1f45e97752b9b018
> > > help: add documentation on include: and subinclude:
> >
> > Other than my nit on patch 1, I like this series, but need feedback
> > from match experts (Martin). If I don't hear negative feedback in the
> > next day or so I'll take these. Thanks!
> >
>
> Looks good to me too, except for what Augie said about patch 1.

These are queued, and I'll do a followup to remove the code duplication.

Thanks!

Patch

diff --git a/mercurial/help/hgignore.txt b/mercurial/help/hgignore.txt
--- a/mercurial/help/hgignore.txt
+++ b/mercurial/help/hgignore.txt
@@ -68,6 +68,10 @@  the form ``*.c`` will match a file endin
 and a regexp pattern of the form ``\.c$`` will do the same. To root a
 regexp pattern, start it with ``^``.
 
+Subdirectories can have their own .hgignore settings by adding
+``subinclude:path/to/subdir/.hgignore`` to the root ``.hgignore``. See
+:hg:`help patterns` for details on ``subinclude:`` and ``include:``.
+
 .. note::
 
   Patterns specified in other than ``.hgignore`` are always rooted.
diff --git a/mercurial/help/patterns.txt b/mercurial/help/patterns.txt
--- a/mercurial/help/patterns.txt
+++ b/mercurial/help/patterns.txt
@@ -30,6 +30,12 @@  The latter expects null delimited patter
 feeds. Each string read from the file is itself treated as a file
 pattern.
 
+To read a set of patterns from a file, use ``include:`` or ``subinclude:``.
+``include:`` will use all the patterns from the given file and treat them as if
+they had been passed in manually.  ``subinclude:`` will only apply the patterns
+against files that are under the subinclude file's directory. See :hg:`help
+hgignore` for details on the format of these files.
+
 All patterns, except for ``glob:`` specified in command line (not for
 ``-I`` or ``-X`` options), can match also against directories: files
 under matched directories are treated as matched.
@@ -60,3 +66,9 @@  File examples::
   listfile0:list.txt read list from list.txt with null byte delimiters
 
 See also :hg:`help filesets`.
+
+Include examples::
+
+  include:path/to/mypatternfile    reads patterns to be applied to all paths
+  subinclude:path/to/subignorefile reads patterns specifically for paths in the
+                                   subdirectory