[Kde-games-devel] committing svgz and png to git

Wolfgang Rohdewald wolfgang at rohdewald.de
Mon Sep 10 15:03:20 UTC 2012


Am Montag, 10. September 2012, 08:35:00 schrieb Parker Coates:
> > I can define commit hooks doing that locally, but what if somebody does not
> > define them? Shouldn't there be commit hooks on the server for this
> > transformation?
>
> From my (limited) understanding, server-side hooks can only reject
> pushes or react to pushed commits. They can't actually change the
> contents of a commit, because that would change the hash and cause the
> commits on the server to be different from those in the pusher's
> repository.

correct, my mistake
 
there was some chat about this on #kde-sysadmin this morning. There seems
to be no easy way to find out if a svgz has compression level 0. Best seems to
read part of the file and see if some uncompressed strings are there like
 'xml version' or '<svg'. Then a hook could reject other svgz (maybe only for
kdegame projects).

> You could write a pre-commit hooks to optimise PNGs before they get
> committed locally, but, yes, each developer would be responsible for
> using them. It still seems like a good idea though. 

I am not even sure if that would be the right way. 
http://git.661346.n2.nabble.com/is-it-kosher-for-pre-commit-to-change-what-s-staged-td5725588.html
there, Junio C Hamano (git project leader) says rather not.

a better solution might be smudge/clean filters (man 5 gitattributes),
this would convert files when committing and when checkouting. But I
never used this, would have to play with it a bit. You can define those
filters in a path specific .gitattribute file, and I wonder if that gets pushed
to the server and to other clients. And if kde server hooks would accept
such things.  Of course the filters should do nothing
if the filtering program is missing. (just some brainstorming without really
checking out things....)


-- 
Wolfgang


More information about the kde-games-devel mailing list