Menu

#4 '--ignore=filepattern' option

open
nobody
None
5
2002-10-24
2002-10-24
No

This patch adds a new argument to syncmail, '-i'
('--ignore'). It takes a glob-like pattern as argument,
and ignores all files that match the pattern. It
doesn't send diffs for them, and if all files are
ignored, doesn't send mail at all (but the subject is
currently not altered for ignored files.)

- Multiple -i or --ignore arguments can be given to
ignore multiple patterns
- The usual *, ?, [seq] and [!seq] patternmagic work
- '**' matches any number of directories (including 0)
- All matching is case sensitive
- All filenames are relative to the CVS *module* root

- If the pattern contains no '/', the pattern is
matched against a file's basename only (so '*.c' as
pattern matches all files ending in '.c' in all
directories.)

- If the pattern ends with a '/', the pattern is
matched against dirname only (so 'tmp/' ignores all
*files* in tmp/, but not files in subdirectories of tmp/.

- Otherwise, the pattern is matched against the whole
path, relative to the CVS *module* root.

- To match a single file only in the topmost directory
(but not files with the same name everywhere) prepend
the pattern with './'.

The patch includes a _filter_test() function that shows
some examples.

Problems:
- It's not tested to death. The pattern matching
magic is tested fairly thoroughly, but the modified
script has not seen much use yet.

- The '**' logic may be confusing, especially when
prepending '**' with something.

- The subject isn't modified to reflect ignored files
(May be a feature :)

- There is no 'IGNORED' indicator in the diff output
(Probably a feature :)

- The string.split(filespec, ",") now occurs in two
places.

Discussion

  • Thomas Wouters

    Thomas Wouters - 2002-10-24
     
  • Allen R. Marshall

    Logged In: YES
    user_id=147690

    Couldn't the .cvsignore files help here?

     
  • Thomas Wouters

    Thomas Wouters - 2005-01-10

    Logged In: YES
    user_id=34209

    .cvsignore serves a completely different purpose. This -i
    option is for ignoring (for instance) autogenerated files
    that *should* be in CVS, but you don't want to see the
    updates of. 'configure', for example, which is usually
    autogenerated from configure.in.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.