#684598 filterdiff: Allow filtering by change (in addition to filename)

Package:
patchutils
Source:
patchutils
Description:
Utilities to work with patches
Submitter:
Date:
2015-07-14 17:15:03 UTC
Severity:
wishlist
#684598#5
Date:
2012-08-11 16:17:08 UTC
From:
To:
Hello,

it would be nice if filterdiff had an option to exclude files where
one of the changes to the file matches a pattern.

Use case: When comparing two releases of a software I like to exclude
autogenerated files. For autoconf/automake filename patterns work
reasonably well however the output of GNU autogen cannot be filtered
this way. Something like this would work:

filterdiff --exclude-files-changes ' It has been AutoGen-ed '

part of example diff:
-----------------------------------------------------
diff -Nru autogen-5.16/autoopts/autoopts/options.h autogen-5.16.2~pre9/autoopts/autoopts/options.h
--- autogen-5.16/autoopts/autoopts/options.h    2012-05-07 01:21:03.000000000 +0200
+++ autogen-5.16.2~pre9/autoopts/autoopts/options.h     2012-08-09 17:50:36.000000000 +0200
@@ -2,7 +2,7 @@
  *
  *  DO NOT EDIT THIS FILE   (options.h)
  *
- *  It has been AutoGen-ed  May  6, 2012 at 04:21:03 PM by AutoGen 5.16pre36
+ *  It has been AutoGen-ed  August  9, 2012 at 08:50:36 AM by AutoGen 5.16.2pre7
  *  From the definitions    funcs.def
  *  and the template file   options_h
  *
-----------------------------------------------------

thanks for considering, cu andreas

#684598#10
Date:
2015-07-14 15:04:19 UTC
From:
To:
Andreas Metzler writes:
 
This can be achieved by using grepdiff together with filterdiff, e.g:
 
$ grepdiff ' It has been AutoGen-ed ' my.patch | filterdiff -X /dev/stdin my.patch
 
See the manpage of grepdiff for a similar example.

#684598#15
Date:
2015-07-14 17:13:46 UTC
From:
To:
  
  

That looks like a perfect solution. Thanks.

cu Andreas