bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing the configuration madness


From: Shigio YAMAGUCHI
Subject: Re: Fixing the configuration madness
Date: Mon, 3 Mar 2014 16:17:20 +0900

2014-03-02 23:25 GMT+09:00 Leo Liu <address@hidden>:
> Yes but we are using the two forms at the same time and that is
> confusing. For a while I thought gtags.conf is for gtags (the
> exectuable) and globalrc is for global (the exectuable).

What you say is reasonable. However, changing names will cause new
confusion. In fact, its name was 'global.conf' in early days.
But it had much contrary because it is too generic as a file name in
'/etc'.  So, it was renamed to 'gtags.conf' in GLOBAL-4.1.
But now, changing name brings new confusion.

Though I don't think the present name is good, I am not willing for
changing it again. Naming which everyone satisfies is difficult,
and changing name is always troublesome for users.

> It might be slightly complicated but gives the users the option to have
> project-wise settings. Think, for example, how to use .m extension for both
> ObjC and Matlab without project-wise settings.

It's simple.

[gtags.conf]
objc:\
:langmap=ObjC\:.m:\
:gtags_parser=/XXX/XXX.la:\
:tc=gtags:

(in Objective-C project)

$ gtags --gtagslabel=objc

> Environment variables are global and can be messy to get right for
> different projects.

How about enabling users to set environment variable in the config file
like this?

:GTAGSFORCECPP=1:GTAGSLOGGING=1:...

> The idea is instead of:
> GTAGSCACHE
> GTAGSCONF
> GTAGSFORCECPP
> GTAGSLABEL
> GTAGSLOGGING
> MAKEOBJDIR
> MAKEOBJDIRPREFIX
> ......
> We use a single configuration file to tweak settings. For example, we
> can have a global.config file look like:
> cache=whatever
> config=whatever
> langmap=.......
> use_idutils=false
> nonfunctions = a,b,c,... ## no .notfunction file any more
> files=.... ## list of files to index, no gtags.files any more
> color_match=green
> color_file=yellow
> ........................
> other gazillion options to add in future

GTAGSCONF and GTAGSLABEL cannot be defined in config record,
because they are used to select a config record.

About color settings, we should follow grep style, because
same setup is applied to the both commands.

Including gtags.files seems to be unreal, because it can become
very large.

> See the following git config examples
> ## setting core.filemode to true
> $ git config core.filemode true
> ## To delete the entry for renames, do
> $ git config --unset diff.renames
> ## To query the value
> $ git config --get core.filemode
> There is also --global that instead of changing current project
> settings, it stores the changes in ~/.gitconfig and affects all
> projects.

Is it more convenient than this?

$ vi $HOME/.globalrc
# vi /etc/gtags.conf

> To sum up, the most important feature to have is a way to configure
> gnu global on a per-project basis.

I agree. How about making 'gtags.conf' in the project root directory
configuration file by default?

$ vi gtags.conf
$ gtags   # == gtags --gtagsconf=gtags.conf


--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]