[Koha-devel] git trick for compiled CSS

Fridolin SOMERS fridolin.somers at biblibre.com
Thu Apr 29 17:19:14 CEST 2021


Hi,

I'd like to share a trick.

When generating compiled CSS files, no way to check the git diff since 
all is on one line.

I've managed to find a trick :

git show --word-diff shows chucks deleted/added so with some regexp :

git show --word-diff $SHA1 | egrep '(\[\-)|(\{\+)' | sed -r 
's/^.*(\[\-.*\-\]\{\+.*\+\}).*$/\1/g'

For example :

aebd3f6a53 Bug 27566: Compiled CSS

[-textarea{font-family:NotoSans}.navbar-]{+textarea{font-family:NotoSans,sans-serif}.navbar+}
[-textarea{font-family:NotoSans}.navbar-]{+textarea{font-family:NotoSans,sans-serif}.navbar+}
[-textarea{font-family:NotoSans}.navbar-]{+textarea{font-family:NotoSans,sans-serif}.navbar+}
[-textarea{font-family:NotoSans}.navbar-]{+textarea{font-family:NotoSans,sans-serif}.navbar+}

This is very usefull to check that compilation worked and did not broke 
the 90% of the file XD

Best regards :D

-- 
Fridolin SOMERS <fridolin.somers at biblibre.com>
Software and system maintainer 🦄
BibLibre, France


More information about the Koha-devel mailing list