Use Diff to check for modified files in the folder structure, ignoring lines starting with a pattern

Tried below to find file changes in Magento installation:

diff --exclude="cache" --exclude="session" --exclude="tmp" --ignore-matching-lines='\*.+' -urq /folder/modified /folder/original > diff.txt

      

The problem is really the ignore statement not working at all. The file headers in one folder contain:

* @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)

      

and the other

* @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)

      

I'd rather target these lines only, but any comment will be valid.

+3


source to share


2 answers


Working solution:

diff --exclude="cache" --exclude="session" --exclude="tmp" --ignore-matching-lines='copyright *Copyright.*Magento' -urq dir1 dir2

      



regex just changed.

+3


source


In newer versions of Magento, the copyright line has changed slightly:

* @copyright Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)

So now I am using this diff command:



diff -r --exclude="var" --exclude="downloader" --ignore-matching-lines='copyright' 1.9.3.3 1.9.3.1

Council. You can also pipe this output to colordiff

to color it in, or diffstat

to summarize it.

0


source







All Articles