Switched the storage for the merge-file lists from a single,
[rsync/rsync-patches.git] / filter.diff
1 After applying this patch and running configure, you MUST run this
2 command before "make":
3
4     make proto
5
6 This patch adds the ability to merge rules into your excludes/includes
7 using a ". FILE" idiom.  If you specify a name without slashes, that
8 filename will be looked for in every subdirectory that rsync visits,
9 and the rules found in that subdirectory's file will affect that dir
10 and its subdirectories.
11
12 For example:
13
14   rsync -av --exclude='. .excl' from/ to
15
16 The above will look for a file named ".excl" in every directory of the
17 hierarchy that rsync visits, and it will exclude (by default) names
18 based on the rules found therein.  If one of the .excl files contains
19 this:
20
21   + *.c
22   . .excl2
23   . ./.excl3
24   *.o
25
26 Then the file ".excl2" will also be read in the current dir, and all
27 subdirs of the current dir.  The file ".excl3" would just be read in
28 for the current dir because its name contained a slash.
29
30 ..wayne..
31
32 --- exclude.c   16 May 2004 23:54:12 -0000      1.80
33 +++ exclude.c   17 May 2004 16:16:23 -0000
34 @@ -30,13 +30,54 @@ extern int verbose;
35  extern int eol_nulls;
36  extern int list_only;
37  extern int recurse;
38 +extern int io_error;
39 +extern int sanitize_paths;
40  
41  extern char curr_dir[];
42  
43  struct exclude_list_struct exclude_list = { 0, 0, "" };
44 -struct exclude_list_struct local_exclude_list = { 0, 0, "per-dir .cvsignore " };
45  struct exclude_list_struct server_exclude_list = { 0, 0, "server " };
46  char *exclude_path_prefix = NULL;
47 +int merge_list_cnt = 0;
48 +
49 +struct mergelist_save {
50 +    struct exclude_list_struct *array;
51 +    int count;
52 +};
53 +
54 +static char dirbuf[MAXPATHLEN];
55 +static unsigned int dirbuf_offset = 0;
56 +
57 +/* Each exclude_list_struct describes a singly-linked list by keeping track
58 + * of both the head and tail pointers.  The list is slightly unusual in that
59 + * a parent-dir's content can be appended to the end of the local list in a
60 + * special way:  the last item in the local list has its "next" pointer set
61 + * to point to the inherited list, but the local list's tail pointer points
62 + * at the end of the local list.  Thus, if the local list is empty, the head
63 + * will be pointing at the inherited content but the tail will be NULL.  To
64 + * help you visualize this, here are the possible list arrangements:
65 + *
66 + * Completely Empty                     Local Content Only
67 + * ==================================   ====================================
68 + * head -> NULL                         head -> Local1 -> Local2 -> NULL
69 + * tail -> NULL                         tail -------------^
70 + *
71 + * Inherited Content Only               Both Local and Inherited Content
72 + * ==================================   ====================================
73 + * head -> Parent1 -> Parent2 -> NULL   head -> L1 -> L2 -> P1 -> P2 -> NULL
74 + * tail -> NULL                         tail ---------^
75 + *
76 + * This means that anyone wanting to traverse the whole list to USE it just
77 + * needs to start at the head and use the "next" pointers until it goes
78 + * NULL.  To add new local content, we insert the item after the tail item
79 + * and update the tail (obviously, if "tail" was NULL, we insert it at the
80 + * head).  To clear the local list, WE MUST NOT FREE THE INHERITED CONTENT
81 + * because it is shared between the current list and our parent list(s).
82 + * The easiest way to handle this is to simply truncate the list after the
83 + * tail item and then free the local list from the head.  When inheriting
84 + * the list for a new local dir, we just save off the exclude_list_struct
85 + * values (so we can pop back to them later) and set the tail to NULL.
86 + */
87  
88  /** Build an exclude structure given an exclude pattern. */
89  static void make_exclude(struct exclude_list_struct *listp, const char *pat,
90 @@ -46,6 +87,24 @@ static void make_exclude(struct exclude_
91         const char *cp;
92         unsigned int ex_len;
93  
94 +       if (mflags & MATCHFLG_MERGE_FILE) {
95 +               struct exclude_struct *ex;
96 +               /* If the local include file was already mentioned, don't
97 +                * add it again. */
98 +               for (ex = listp->head; ex; ex = ex->next) {
99 +                       if (ex->match_flags & MATCHFLG_MERGE_FILE
100 +                           && strlen(ex->pattern) == pat_len
101 +                           && memcmp(ex->pattern, pat, pat_len) == 0)
102 +                               return;
103 +               }
104 +               if ((pat_len == 10 || (pat_len > 10 && pat[pat_len-11] == '/'))
105 +                   && strncmp(pat+pat_len-10, ".cvsignore", 10) == 0) {
106 +                       mflags |= MATCHFLG_CVSIGNORE;
107 +                       mflags &= ~MATCHFLG_INCLUDE;
108 +               } else
109 +                       mflags &= ~MATCHFLG_CVSIGNORE;
110 +       }
111 +
112         ret = new(struct exclude_struct);
113         if (!ret)
114                 out_of_memory("make_exclude");
115 @@ -81,14 +140,28 @@ static void make_exclude(struct exclude_
116                 mflags |= MATCHFLG_DIRECTORY;
117         }
118  
119 -       for (cp = ret->pattern; (cp = strchr(cp, '/')) != NULL; cp++)
120 -               ret->slash_cnt++;
121 +       if (mflags & MATCHFLG_MERGE_FILE) {
122 +               struct exclude_list_struct *lp
123 +                   = new_array(struct exclude_list_struct, 1);
124 +               if (!lp)
125 +                       out_of_memory("make_exclude");
126 +               lp->head = lp->tail = NULL;
127 +               if (asprintf(&lp->debug_type, "per-dir %s ", ret->pattern) < 0)
128 +                       out_of_memory("make_exclude");
129 +               ret->u.merge_list = lp;
130 +               merge_list_cnt++;
131 +       } else {
132 +               for (cp = ret->pattern; (cp = strchr(cp, '/')) != NULL; cp++)
133 +                       ret->u.slash_cnt++;
134 +       }
135  
136         ret->match_flags = mflags;
137  
138 -       if (!listp->tail)
139 +       if (!listp->tail) {
140 +               ret->next = listp->head;
141                 listp->head = listp->tail = ret;
142 -       else {
143 +       } else {
144 +               ret->next = listp->tail->next;
145                 listp->tail->next = ret;
146                 listp->tail = ret;
147         }
148 @@ -96,22 +169,128 @@ static void make_exclude(struct exclude_
149  
150  static void free_exclude(struct exclude_struct *ex)
151  {
152 +       if (ex->match_flags & MATCHFLG_MERGE_FILE) {
153 +               free(ex->u.merge_list->debug_type);
154 +               free(ex->u.merge_list);
155 +       }
156         free(ex->pattern);
157         free(ex);
158  }
159  
160 -void clear_exclude_list(struct exclude_list_struct *listp)
161 +static void clear_exclude_list(struct exclude_list_struct *listp)
162  {
163 -       struct exclude_struct *ent, *next;
164 -
165 -       for (ent = listp->head; ent; ent = next) {
166 -               next = ent->next;
167 -               free_exclude(ent);
168 +       if (listp->tail) {
169 +               struct exclude_struct *ent, *next;
170 +               /* Truncate any inherited items from the local list. */
171 +               listp->tail->next = NULL;
172 +               for (ent = listp->head; ent; ent = next) {
173 +                       next = ent->next;
174 +                       free_exclude(ent);
175 +               }
176         }
177  
178         listp->head = listp->tail = NULL;
179  }
180  
181 +static struct exclude_list_struct *
182 +push_merge_files(struct exclude_struct *ent, struct exclude_list_struct *array)
183 +{
184 +       struct exclude_list_struct *lp;
185 +
186 +       for (; ent; ent = ent->next) {
187 +               int flags;
188 +               if (!(ent->match_flags & MATCHFLG_MERGE_FILE))
189 +                       continue;
190 +               lp = ent->u.merge_list;
191 +
192 +               if (verbose > 2) {
193 +                       rprintf(FINFO, "[%s] pushing %sexclude list\n",
194 +                               who_am_i(), lp->debug_type);
195 +               }
196 +
197 +               memcpy(array++, lp, sizeof (struct exclude_list_struct));
198 +
199 +               array = push_merge_files(lp->head, array);
200 +
201 +               if (ent->match_flags & MATCHFLG_CVSIGNORE) {
202 +                       lp->head = NULL; /* CVS doesn't inherit rules. */
203 +                       flags = XFLG_WORD_SPLIT | XFLG_WORDS_ONLY;
204 +               } else {
205 +                       flags = ent->match_flags & MATCHFLG_INCLUDE
206 +                           ? XFLG_DEF_INCLUDE : 0;
207 +               }
208 +               lp->tail = NULL; /* Switch any local rules to inherited. */
209 +               if (strlcpy(dirbuf +  dirbuf_offset, ent->pattern,
210 +                   MAXPATHLEN - dirbuf_offset) < MAXPATHLEN - dirbuf_offset)
211 +                       add_exclude_file(lp, dirbuf, flags);
212 +               else {
213 +                       io_error |= IOERR_GENERAL;
214 +                       rprintf(FINFO,
215 +                           "cannot add local excludes in long-named directory %s\n",
216 +                           full_fname(dirbuf));
217 +               }
218 +       }
219 +
220 +       return array;
221 +}
222 +
223 +void *push_local_excludes(char *fname, unsigned int offset)
224 +{
225 +       struct mergelist_save *push;
226 +
227 +       /* Make it easy to construct the full path for a merge-file that was
228 +        * specified with a relative path by saving off the current dir. */
229 +       memcpy(dirbuf, fname, offset);
230 +       dirbuf_offset = offset;
231 +
232 +       if (!(push = new_array(struct mergelist_save, 1)))
233 +               out_of_memory("push_local_excludes");
234 +
235 +       push->count = merge_list_cnt;
236 +       push->array = new_array(struct exclude_list_struct, merge_list_cnt);
237 +       if (!push->array)
238 +               out_of_memory("push_local_excludes");
239 +
240 +       push_merge_files(exclude_list.head, push->array);
241 +
242 +       return (void*)push;
243 +}
244 +
245 +static struct exclude_list_struct *
246 +pop_merge_files(struct exclude_struct *ent, struct exclude_list_struct *array)
247 +{
248 +       struct exclude_list_struct *lp;
249 +
250 +       for (; ent; ent = ent->next) {
251 +               if (!(ent->match_flags & MATCHFLG_MERGE_FILE))
252 +                       continue;
253 +               lp = ent->u.merge_list;
254 +
255 +               if (verbose > 2) {
256 +                       rprintf(FINFO, "[%s] popping %sexclude list\n",
257 +                               who_am_i(), lp->debug_type);
258 +               }
259 +
260 +               clear_exclude_list(lp);
261 +               memcpy(lp, array++, sizeof (struct exclude_list_struct));
262 +
263 +               array = pop_merge_files(lp->head, array);
264 +       }
265 +
266 +       return array;
267 +}
268 +
269 +void pop_local_excludes(void *mem)
270 +{
271 +       struct mergelist_save *pop = (struct mergelist_save*)mem;
272 +
273 +       pop_merge_files(exclude_list.head, pop->array);
274 +       merge_list_cnt = pop->count;
275 +
276 +       free(pop->array);
277 +       free(pop);
278 +}
279 +
280  static int check_one_exclude(char *name, struct exclude_struct *ex,
281                               int name_is_dir)
282  {
283 @@ -122,7 +301,7 @@ static int check_one_exclude(char *name,
284         /* If the pattern does not have any slashes AND it does not have
285          * a "**" (which could match a slash), then we just match the
286          * name portion of the path. */
287 -       if (!ex->slash_cnt && !(ex->match_flags & MATCHFLG_WILD2)) {
288 +       if (!ex->u.slash_cnt && !(ex->match_flags & MATCHFLG_WILD2)) {
289                 if ((p = strrchr(name,'/')) != NULL)
290                         name = p+1;
291         }
292 @@ -148,9 +327,9 @@ static int check_one_exclude(char *name,
293         if (ex->match_flags & MATCHFLG_WILD) {
294                 /* A non-anchored match with an infix slash and no "**"
295                  * needs to match the last slash_cnt+1 name elements. */
296 -               if (!match_start && ex->slash_cnt
297 +               if (!match_start && ex->u.slash_cnt
298                     && !(ex->match_flags & MATCHFLG_WILD2)) {
299 -                       int cnt = ex->slash_cnt + 1;
300 +                       int cnt = ex->u.slash_cnt + 1;
301                         for (p = name + strlen(name) - 1; p >= name; p--) {
302                                 if (*p == '/' && !--cnt)
303                                         break;
304 @@ -221,6 +400,13 @@ int check_exclude(struct exclude_list_st
305         struct exclude_struct *ent;
306  
307         for (ent = listp->head; ent; ent = ent->next) {
308 +               if (ent->match_flags & MATCHFLG_MERGE_FILE) {
309 +                       int rc = check_exclude(ent->u.merge_list, name,
310 +                                              name_is_dir);
311 +                       if (rc)
312 +                               return rc;
313 +                       continue;
314 +               }
315                 if (check_one_exclude(name, ent, name_is_dir)) {
316                         report_exclude_result(name, ent, name_is_dir,
317                                               listp->debug_type);
318 @@ -254,11 +440,16 @@ static const char *get_exclude_tok(const
319                 p = (const char *)s;
320         }
321  
322 -       /* Is this a '+' or '-' followed by a space (not whitespace)? */
323 +       /* Is this a +/-/. followed by a space (not whitespace)? */
324         if (!(xflags & XFLG_WORDS_ONLY)
325 -           && (*s == '-' || *s == '+') && s[1] == ' ') {
326 +           && (*s == '-' || *s == '+' || *s == '.') && s[1] == ' ') {
327                 if (*s == '+')
328                         mflags |= MATCHFLG_INCLUDE;
329 +               else if (*s == '.') {
330 +                       mflags |= MATCHFLG_MERGE_FILE;
331 +                       if (xflags & XFLG_DEF_INCLUDE)
332 +                               mflags |= MATCHFLG_INCLUDE;
333 +               }
334                 s += 2;
335         } else if (xflags & XFLG_DEF_INCLUDE)
336                 mflags |= MATCHFLG_INCLUDE;
337 @@ -307,11 +498,42 @@ void add_exclude(struct exclude_list_str
338                         continue;
339                 }
340  
341 +               if (mflags & MATCHFLG_MERGE_FILE) {
342 +                       char name[MAXPATHLEN];
343 +                       if (pat_len >= sizeof name) {
344 +                               rprintf(FERROR,
345 +                                       "merge filename too long: %s\n", cp);
346 +                               continue;
347 +                       }
348 +                       strlcpy(name, cp, pat_len+1);
349 +                       if (strchr(name, '/') != NULL) {
350 +                               if (sanitize_paths)
351 +                                       sanitize_path(name, curr_dir);
352 +                               if (*name == '/')
353 +                                       cp = name;
354 +                               else {
355 +                                       if (strlcpy(dirbuf + dirbuf_offset,
356 +                                           name, MAXPATHLEN - dirbuf_offset)
357 +                                           >= MAXPATHLEN - dirbuf_offset) {
358 +                                               rprintf(FERROR,
359 +                                                   "merge filename too long: %s...\n",
360 +                                                   dirbuf);
361 +                                               continue;
362 +                                       }
363 +                                       cp = dirbuf;
364 +                               }
365 +                               add_exclude_file(listp, cp,
366 +                                   xflags | XFLG_FATAL_ERRORS);
367 +                               continue;
368 +                       }
369 +               }
370 +
371                 make_exclude(listp, cp, pat_len, mflags);
372  
373                 if (verbose > 2) {
374 -                       rprintf(FINFO, "[%s] add_exclude(%.*s, %s%sclude)\n",
375 +                       rprintf(FINFO, "[%s] add_exclude(%.*s, %s%s%sclude)\n",
376                                 who_am_i(), pat_len, cp, listp->debug_type,
377 +                               mflags & MATCHFLG_MERGE_FILE ? "FILE " : "",
378                                 mflags & MATCHFLG_INCLUDE ? "in" : "ex");
379                 }
380         }
381 @@ -403,7 +625,11 @@ void send_exclude_list(int f)
382                 if (ent->match_flags & MATCHFLG_INCLUDE) {
383                         write_int(f, l + 2);
384                         write_buf(f, "+ ", 2);
385 -               } else if ((*p == '-' || *p == '+') && p[1] == ' ') {
386 +               } else if (ent->match_flags & MATCHFLG_MERGE_FILE) {
387 +                       write_int(f, l + 2);
388 +                       write_buf(f, ". ", 2);
389 +               } else if ((*p == '-' || *p == '+' || *p == '.')
390 +                   && p[1] == ' ') {
391                         write_int(f, l + 2);
392                         write_buf(f, "- ", 2);
393                 } else
394 @@ -444,6 +670,7 @@ void add_cvs_excludes(void)
395         char fname[MAXPATHLEN];
396         char *p;
397  
398 +       add_exclude(&exclude_list, ". .cvsignore", 0);
399         add_exclude(&exclude_list, default_cvsignore,
400                     XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
401  
402 --- flist.c     16 May 2004 23:54:12 -0000      1.224
403 +++ flist.c     17 May 2004 16:16:24 -0000
404 @@ -39,8 +39,6 @@ extern int module_id;
405  extern int ignore_errors;
406  extern int numeric_ids;
407  
408 -extern int cvs_exclude;
409 -
410  extern int recurse;
411  extern char curr_dir[MAXPATHLEN];
412  extern char *files_from;
413 @@ -65,7 +63,6 @@ extern int write_batch;
414  
415  extern struct exclude_list_struct exclude_list;
416  extern struct exclude_list_struct server_exclude_list;
417 -extern struct exclude_list_struct local_exclude_list;
418  
419  int io_error;
420  
421 @@ -210,8 +207,6 @@ int link_stat(const char *path, STRUCT_S
422   */
423  static int check_exclude_file(char *fname, int is_dir, int exclude_level)
424  {
425 -       int rc;
426 -
427  #if 0 /* This currently never happens, so avoid a useless compare. */
428         if (exclude_level == NO_EXCLUDES)
429                 return 0;
430 @@ -233,10 +228,7 @@ static int check_exclude_file(char *fnam
431         if (exclude_level != ALL_EXCLUDES)
432                 return 0;
433         if (exclude_list.head
434 -           && (rc = check_exclude(&exclude_list, fname, is_dir)) != 0)
435 -               return rc < 0;
436 -       if (local_exclude_list.head
437 -           && check_exclude(&local_exclude_list, fname, is_dir) < 0)
438 +           && check_exclude(&exclude_list, fname, is_dir) < 0)
439                 return 1;
440         return 0;
441  }
442 @@ -946,15 +938,7 @@ void send_file_name(int f, struct file_l
443  
444         if (recursive && S_ISDIR(file->mode)
445             && !(file->flags & FLAG_MOUNT_POINT)) {
446 -               struct exclude_list_struct last_list = local_exclude_list;
447 -               local_exclude_list.head = local_exclude_list.tail = NULL;
448                 send_directory(f, flist, f_name_to(file, fbuf));
449 -               if (verbose > 2) {
450 -                       rprintf(FINFO, "[%s] popping %sexclude list\n",
451 -                               who_am_i(), local_exclude_list.debug_type);
452 -               }
453 -               clear_exclude_list(&local_exclude_list);
454 -               local_exclude_list = last_list;
455         }
456  }
457  
458 @@ -965,6 +949,7 @@ static void send_directory(int f, struct
459         struct dirent *di;
460         char fname[MAXPATHLEN];
461         unsigned int offset;
462 +       void *save_excludes;
463         char *p;
464  
465         d = opendir(dir);
466 @@ -988,18 +973,7 @@ static void send_directory(int f, struct
467                 offset++;
468         }
469  
470 -       if (cvs_exclude) {
471 -               if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset)
472 -                   < MAXPATHLEN - offset) {
473 -                       add_exclude_file(&local_exclude_list, fname,
474 -                                        XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
475 -               } else {
476 -                       io_error |= IOERR_GENERAL;
477 -                       rprintf(FINFO,
478 -                               "cannot cvs-exclude in long-named directory %s\n",
479 -                               full_fname(fname));
480 -               }
481 -       }
482 +       save_excludes = push_local_excludes(fname, offset);
483  
484         for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {
485                 char *dname = d_name(di);
486 @@ -1019,6 +993,8 @@ static void send_directory(int f, struct
487                 io_error |= IOERR_GENERAL;
488                 rsyserr(FERROR, errno, "readdir(%s)", dir);
489         }
490 +
491 +       pop_local_excludes(save_excludes);
492  
493         closedir(d);
494  }
495 --- rsync.h     16 May 2004 07:28:24 -0000      1.204
496 +++ rsync.h     17 May 2004 16:16:25 -0000
497 @@ -496,11 +496,16 @@ struct map_struct {
498  #define MATCHFLG_INCLUDE       (1<<4) /* this is an include, not an exclude */
499  #define MATCHFLG_DIRECTORY     (1<<5) /* this matches only directories */
500  #define MATCHFLG_CLEAR_LIST    (1<<6) /* this item is the "!" token */
501 +#define MATCHFLG_MERGE_FILE    (1<<7) /* specifies a file to merge */
502 +#define MATCHFLG_CVSIGNORE     (1<<8) /* parse this as a .cvsignore file */
503  struct exclude_struct {
504         struct exclude_struct *next;
505         char *pattern;
506         unsigned int match_flags;
507 -       int slash_cnt;
508 +       union {
509 +               int slash_cnt;
510 +               struct exclude_list_struct *merge_list;
511 +       } u;
512  };
513  
514  struct exclude_list_struct {
515 --- rsync.yo    7 May 2004 00:18:37 -0000       1.169
516 +++ rsync.yo    17 May 2004 16:16:26 -0000
517 @@ -1075,6 +1075,72 @@ itemize(
518    it would be excluded by the "*")
519  )
520  
521 +manpagesection(MERGING EXCLUDE FILES)
522 +
523 +You can merge whole files into an exclude file using a rule that starts
524 +with a ". " (a dot followed by a space) and has a filename in place of the
525 +pattern.  There are two types of merge rules, single-instance and
526 +per-directory:
527 +
528 +itemize(
529 +  it() If the filename has no slashes in it, it is a per-directory merge;
530 +  rsync scans every directory that it traverses for the named file, merging
531 +  its contents (when it exists) file at the start of this per-directory
532 +  sub-list (subdirectories inherit the contents of their parent directories
533 +  by default, and each subdirectory's rules have precedence over the parent
534 +  directory's rules).
535 +
536 +  it() If a filename has a slash in it, it is a single-instance merge; the
537 +  named file's contents will be merged into the current exclude file,
538 +  replacing the merge rule.  Thus, you should use the name ./foo instead of
539 +  foo if you don't want to scan for "foo" in all the subdirectories of the
540 +  current directory.
541 +)
542 +
543 +Note also that you can eliminate all the inherited rules for the current
544 +per-directory ruleset by putting the list-clearing token (!) in the file.
545 +This only clears the rules for the current per-directory sub-list (up
546 +through the ! token) and only for the current directory and its
547 +subdirectories.
548 +
549 +Here's an example exclude file (which you'd specify via the normal
550 +--exclude-from option):
551 +
552 +verb(
553 +    . /home/user/.global_excludes
554 +    - *.gz
555 +    . .excl
556 +    + *.[ch]
557 +    - *.o
558 +)
559 +
560 +This will merge the contents of the /home/user/.global_excludes file at the
561 +start of the list and also turns the ".excl" filename into a per-directory
562 +exclude file whose local contents will be merged into the list in place of
563 +the .excl line.
564 +
565 +Additionally, you can affect where the --cvs-exclude (-C) option's
566 +inclusion of a per-directory .cvsignore file gets placed into your rules by
567 +adding an explicit merge rule for ".cvsignore".  For instance, specifying
568 +this:
569 +
570 +verb(
571 +  rsync -avC --exclude='. .cvsignore' --exclude-from=foo a/ b
572 +)
573 +
574 +will merge all the per-directory .cvsignore rules at the start of your list
575 +rather than at the end.  This allows their dir-specific rules to supersede
576 +your rules instead of being subservient to them.  (The global rules taken
577 +from the $HOME/.cvsignore file and from $CVSIGNORE are not affected by
578 +this.)
579 +
580 +Note also that the parsing of any merge-file named ".cvsignore" is always
581 +done in a CVS-compatible manner (even if -C wasn't specified) -- i.e. the
582 +rules are always exclude rules (even when specified by an include option),
583 +they are split on whitespace, no special prefixes or list-clearing tokens
584 +are honored, and (for per-directory files) subdirectories don't inherit the
585 +parent directory's rules.
586 +
587  manpagesection(BATCH MODE)
588  
589  bf(Note:) Batch mode should be considered experimental in this version