Hi Frido,

This nice trick made me wonder if git could beautify the css before making the diff... and of course it does!

https://scripter.co/git-diff-minified-js-and-css/

It requires installing a node package and modifying some git files, but it works really well

Le 29/04/2021 à 17:19, Fridolin SOMERS a écrit :
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


--
Julian Maurice
BibLibre
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/

Reply via email to