Removing Redundant Templates from a Subtheme using a Diff command
In Drupal 7, templates in a base theme will be used if an active subtheme does not have that template. This means that there is never a reason to have a template that is identical to what is already in the base theme.
Best Way to See Identical Files
diff --recursive --brief -s issybase issymobile
The -s flag makes diff mention identical files as well as modified ones.
Even better:
diff --recursive --brief -s issybase issymobile | grep identical
This shows only files that are exactly the same in the "issybase/" and "issymobile/" directories (this command would be run from sites/all/themes for instance.
Less Optimal Solutions
Probably can be better yet, but better than visually scanning the output of a recursive diff versus repeated ls (list) commands, which is what i did before...
To see everything different in two directories with diff, but not the detail of each difference, this command can be used:
ben@Onyx:~/code/sdl/web/sites/all/themes (master)$ diff --recursive --brief issybase/ issy/
Producing output like:
Only in issy/: c
Only in issybase/: issybase.info
Only in issy/: issy.info
Files issybase//j/continuum.js and issy//j/continuum.js differ
Files issybase//j/scripts.js and issy//j/scripts.js differ
Only in issy/: sass
Files issybase//template.php and issy//template.php differ
Files issybase//templates/ds-2col.tpl.php and issy//templates/ds-2col.tpl.php differ
Files issybase//templates/page.tpl.php and issy//templates/page.tpl.php differ
So looking at all the files that really were there, deleted the ones that weren't different:
deleted: issy/templates/ds-1col.tpl.php
deleted: issy/templates/field/field--addressfield.tpl.php
deleted: issy/templates/field/field.tpl.php
deleted: issy/templates/file--image--media_viewbook.tpl.php
deleted: issy/templates/html.tpl.php
deleted: issy/templates/html5-1-col--node-project-teaser.tpl.php
deleted: issy/templates/node/node--event.tpl.php
deleted: issy/templates/search-result.tpl.php
deleted: issy/templates/views-view-list.tpl.php
deleted: issy/templates/views-view-table--press-project-images.tpl.php
deleted: issy/templates/views-view.tpl.php
Credit to: http://www.unixtutorial.org/2008/06/how-to-compare-directories-in-unix/
Comments
Post new comment