User login


Understanding past changes with diff and git log

In figuring out what changed in a theme's files (an incorrectly made subtheme; instead of overriding the base themes stylesheets, changes should have gone into its own files with different names), these commands were useful.

diff -uP themes/bartik/css/colors.css sites/default/themes/dgd7theme/css/style.css > theme.diff
git log --cc sites/default/themes/dgd7theme/css/style.css > log.diff

Kept running them for the three different files, and reloading theme.diff and log.diff in gvim to see the changes. Quite convenient.

Compare two strings in a bash script

bash script compare text

if [ $var == "value" ]
echo is the same

(Numbers are -eq)

Syndicate content