wingrunr21 / gitolite

A Ruby interface for the gitolite git backend system
https://github.com/wingrunr21/gitolite
MIT License
82 stars 37 forks source link

Simplify gitolite.conf diffs by sorting repos and adding blank lines #31

Closed japhb closed 12 years ago

japhb commented 12 years ago

The original code changed the order of the entire gitolite.conf file after every commit; this meant that diffs (for e.g. security audits) were essentially useless. This fix includes two small changes that improve this situation greatly:

The latter change also has the side benefit of making the conf file (and thus the diffs) more readable to humans.

Still remaining to fix is the constant reordering of group definitions when there exists no unique dependency ordering between them.

wingrunr21 commented 12 years ago

I am not against this in concept but I think there is a better way of doing this. I am guessing you are running Ruby 1.8.7?

japhb commented 12 years ago

On Tue, 2012-09-25 at 17:42 -0700, Stafford Brunk wrote:

I am not against this in concept but I think there is a better way of doing this. I am guessing you are running Ruby 1.8.7?

Yes. :-)

I considered going the OrderedHash route to maintain the existing repo order in the original file. However, since my gitolite.conf had already been scrambled and I needed to sort it at least once to get back to something sane anyway, I just stayed with the .sort call -- especially since other existing users of this gem will likely be in the same situation, needing to get back to a sane ordering somehow.

Separately, I think the addition of the blank lines is important whatever the ordering method chosen -- git diff gets confused easily by simple permissions changes when all of the repos are together in one big block.

-'f

wingrunr21 commented 12 years ago

Ok, fair enough. I would actually prefer going the OrderedHash route but the sort does give a good human readability factor.

As far as the independent group ordering, I am also looking into that right now since my test breaks on 1.8.7 for that. If you would go ahead and file an issue for that I'd appreciate it.

japhb commented 12 years ago

On Tue, 2012-09-25 at 18:08 -0700, Stafford Brunk wrote:

Ok, fair enough. I would actually prefer going the OrderedHash route but the sort does give a good human readability factor.

:-)

As far as the independent group ordering, I am also looking into that right now since my test breaks on 1.8.7 for that. If you would go ahead and file an issue for that I'd appreciate it.

Done:

https://github.com/wingrunr21/gitolite/issues/32

-'f