helper tool for rc file format change (from v3.3 and below to v3.4 and above)

2 views
Skip to first unread message

Sitaram Chamarty

unread,
Jun 23, 2014, 2:16:09 AM6/23/14
to Gitolite Google Groups, gitolite...@googlegroups.com
Hi,

Back in March 2013 when v3.4 came out, the rc file format changed
significantly, to make it easier to enable/disable features.

The old rc file format will always work, since in fact the new one gets
converted to the old one *internally* anyway. So no one needs to worry
about changing anything. As long as they don't want any new features.

But when they do, it becomes a little cumbersome. And I have to
document both ways of enabling whatever new feature there is, for the
benefit of people who have upgraded to a recent gitolite, but whose rc
file is still in the v3.3 format.

If you're in that position, I'd like you to try this tool out. It's in
the "contrib" directory of the gitolite source tree. You will need to
clone the latest gitolite "master" to use it.

You just supply it a filename that contains the OLD format rc file, and
it will spit to STDOUT a NEW format rc file.

It does NOT touch anything else, and definitely not your existing setup.

A usage example with some sample warnings:

$ contrib/utils/rc-format-v3.4 /tmp/old.rc > /tmp/new.rc
WARNING: DEFAULT_ROLE_PERMS has been replaced by per repo option
see http://gitolite.com/gitolite/wild.html

WARNING: the following parts of the old rc were NOT converted:

{
'SOME_LOCAL_VAR' => 123
}

This is not a totally fool proof solution. The code contains the
following WARNING, which I repeat here:

WARNINGS
make sure you also READ ALL ERROR/WARNING MESSAGES GENERATED
make sure you EXAMINE THE FILE AND CHECK THAT EVERYTHING LOOKS GOOD before using it
be especially careful about
variables which contains single/double quotes or other special characters
variables that stretch across multiple lines
features which take arguments (like 'renice')
new features you've enabled which don't exist in the default rc

I'd appreciate feedback.
Reply all
Reply to author
Forward
0 new messages