Proposal to remove /tags file from CVS control

Proposal to remove /tags file from CVS control

autor David Mudrák -
Počet odpovědí: 11
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers Obrázek: Plugins guardians Obrázek: Testers Obrázek: Translators
This is a proposal to remove /tags file from CVS control. Basically, the file is used by ctags utility to jump to a function definition. Here are some reasons:
  • tags file is useful for developers only. Developer should be able to easily create their own tags file if they want to use it. Which is something they need to do anyway, especially when adding or modifying new functions/methods/classes.
  • tags file in CVS does not seem to be updated regularly. Currently, in HEAD, it is 2 months old.
  • Developers may prefer their own settings of what will be tagged by ctags utility. Again, they need to re-create the file manually anyway
  • Locally re-created tags file is likely to be in conflict during update
  • It generally causes conflicts for those using git mirror of the source code base
Conclusion: tags is useful mainly for developers. Developers have to re-create it locally, anyway. Locally generated file is likely to run into conflict.

Hint:
$ cat ~/public_html/moodle-head/Makefile
all : cscope ctags
cscope :
 find `pwd` -type f -name '*.php' > cscope.files
 cscope -b
ctags :
 ctags -R --languages=php --regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/' 

Průměr hodnocení: -
V odpovědi na David Mudrák

Re: Proposal to remove /tags file from CVS control

autor Tim Hunt -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers
I agree.

(However, Martin D uses tags himself, and we must allow him some personal whims.)
V odpovědi na David Mudrák

Re: Proposal to remove /tags file from CVS control

autor Mihai Sucan -
Being a GSOC student the first thing I did was to generate my own tags, for quicker code browsing. I was surprised that the tags file is in the tree. úsměv

I agree that every developer has his/her own ways of working.
V odpovědi na David Mudrák

Re: Proposal to remove /tags file from CVS control

autor Martin Dougiamas -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Testers
Tags are useful for sysadmins looking at code too, not just developers.

We do need to improve the updating. Anyone can do this, but we should probably make moodle.org do it daily or so.
V odpovědi na Martin Dougiamas

Re: Proposal to remove /tags file from CVS control

autor David Mudrák -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers Obrázek: Plugins guardians Obrázek: Testers Obrázek: Translators
But if users are capable of using tags, they should be able to create them localy, right? It is really annoying to have tags file permanently marked as having local modifications (when comparing branches etc.)
V odpovědi na Martin Dougiamas

Re: Proposal to remove /tags file from CVS control

autor Petr Skoda -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers
I never used these, what is required to build this file? Could we just distribute some sh script that builds it instead?
V odpovědi na Petr Skoda

Re: Proposal to remove /tags file from CVS control

autor Iñaki Arenaza -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Peer reviewers Obrázek: Plugin developers
You can use the 'ctags' command to build a vi-compatible tags file, or 'etags' to build a emacs-compatible tags file. You may also need a bit of shell scripting to specify the files you are interested in and exclude the ones you are not.

Saludos.
Iñaki.
V odpovědi na Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

autor Tim Hunt -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers
Can't we put it in contrib?
V odpovědi na Tim Hunt

Re: Proposal to remove /tags file from CVS control

autor Iñaki Arenaza -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Peer reviewers Obrázek: Plugin developers
It's been ages since I used ctags, and I see it already has all the options to recurse directories and exclude files based on patterns, so it's as simple as using ctags (the Exuberant Ctags version from http://ctags.sourceforge.net, packaged in Debian/Ubuntu as 'exuberant-ctags') from the moodle directory with (everything in a single line, may appear wrapped here):


ctags --format=2 --languages=PHP --PHP-kinds=cidf --recurse=yes --exclude=tags --exclude="config*.php" --exclude="lang/*" --exclude="install/lang/*"


to create a vi-compatible tags file excluding the config*.php files at $CFG->dirroot and the language files.

To do the same for an emacs-compatible file:


ctags -e --format=2 --languages=PHP --PHP-kinds=cidf --recurse=yes --exclude=tags --exclude="config*.php" --exclude="lang/*" --exclude="install/lang/*"


Maybe we could add it MoodleDocs, instead of puting a single line script in contrib úsměv

Saludos.
Iñaki.
V odpovědi na Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

autor Martin Dougiamas -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Testers
OK I'll nuke the tags file, and add a tags.txt instead. MDL-19728

I used this invocation to avoid some problems that we had in the past with some of the newer PHP code:


ctags -R --languages=php --exclude="CVS" --php-kinds=f --regex-PHP='/abstract class ([^ ]*)/\1/c/' --regex-PHP='/interface ([^ ]*)/\1/c/' --regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/'


This (and any of the other ctags strings above) don't work on the BSD ctags which comes with Mac OS X so we need a different solution there.

V odpovědi na Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

autor David Mudrák -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers Obrázek: Plugins guardians Obrázek: Testers Obrázek: Translators
Hi Iñaki,

yes, the latest version 5.7 already includes PHP5 regexps. However, there are known problems that it also wrongly tags places like
/**
 * this is abstract class and will be tagged as "and"
 */

I have published a patch for ctags-5.7 so you can recompile and fix it on your own. This behaviour is extremly annoying if you use taglist extension of vim.