Proposal to remove /tags file from CVS control

Proposal to remove /tags file from CVS control

David Mudrák發表於
Number of replies: 11
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Plugins guardians的相片 Testers的相片 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/' 

評比平均分數: -
In reply to David Mudrák

Re: Proposal to remove /tags file from CVS control

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
I agree.

(However, Martin D uses tags himself, and we must allow him some personal whims.)
In reply to David Mudrák

Re: Proposal to remove /tags file from CVS control

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. 微笑

I agree that every developer has his/her own ways of working.
In reply to David Mudrák

Re: Proposal to remove /tags file from CVS control

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 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.
In reply to Martin Dougiamas

Re: Proposal to remove /tags file from CVS control

David Mudrák發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Plugins guardians的相片 Testers的相片 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.)
In reply to Martin Dougiamas

Re: Proposal to remove /tags file from CVS control

Petr Skoda發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
I never used these, what is required to build this file? Could we just distribute some sh script that builds it instead?
In reply to Petr Skoda

Re: Proposal to remove /tags file from CVS control

Iñaki Arenaza發表於
Core developers的相片 Documentation writers的相片 Peer reviewers的相片 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.
In reply to Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Can't we put it in contrib?
In reply to Tim Hunt

Re: Proposal to remove /tags file from CVS control

Iñaki Arenaza發表於
Core developers的相片 Documentation writers的相片 Peer reviewers的相片 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 微笑

Saludos.
Iñaki.
評比平均分數:Useful (1)
In reply to Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 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.

評比平均分數:Useful (1)
In reply to Iñaki Arenaza

Re: Proposal to remove /tags file from CVS control

David Mudrák發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Plugins guardians的相片 Testers的相片 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.