Update/Generate GTAGS With Git Update

Tumblr에 작성했던 내용을 옮겨왔습니다. 기존에는 vi와 cscope를 활용해서 tag를 관리하다가 gnu에서 만든 global(gtags)를 알게되서 이를 활용할 수 있는 방법을 찾아보던 중에 ctags와 git을 활용하는 방법이 있어 이를 개선해서 gtags용으로 변경한 방법을 공유합니다.

Why GTAGS(GNU Global)?

  • Find better than ctags
  • Find faster than ctags/cscope
  • Build faster thant ctags/cscope
  • Integrate better with emacs

Why git and gtags

  • git is good scm tool used everywhere :)
  • gtags made good reference with many languages
  • git only maintains original source code
  • gtags can update partially - git use diff for commit!

How to setup

  1. Instatll git and gnu global(gtags) to your system
  2. make ~/.git_template/hooks directory
  3. move directory: cd ~/.git_template/hooks
  4. make gtags file include below contents
  5. make post-checkout, post-commit, post-merge as below (same contents)
  6. make post-rewrite as below
  7. run below command to add default git template.

refer from Effortless Ctags with Git

 
comments powered by Disqus