On 01/17/2014 10:18 AM, Chris Evich wrote:
On 01/17/2014 09:53 AM, Dongsheng Yang wrote:
What about make 'pyscopeupd' as a local "command" for us, then we can
find it in $PATH and autocomplete it with TAB.
Sure, whatever works for you.  The point was just to avoid having to
type in that big long command-line every time you change something.
IIRC, there's way to integrate it into git, so it runs automatically
whenever you switch branches.

I guess you mean git hooks. We can add a hook for post checkout for it.

Example:
  * Create a file named post-checkout in .git/hooks/
  [root@localhost virt]# cat .git/hooks/post-checkout
#!/bin/sh
. git-sh-setup
pyscopeupd

  * There is no cscope related files in virt/
[root@localhost virt]# ls cscope*
ls: cannot access cscope*: No such file or directory

  * checkout to master
[root@localhost virt]# git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 125 commits.
  (use "git push" to publish your local commits)
Building cross-reference...
> Building symbol database 360 of 1187

  * pyscopeupd command in .git/hooks/post-checkout was executed.
[root@localhost virt]# ls cscope*
cscope.files  cscope.out

In this way, we can make it run automatically in any git-checkout.
And we need it for git-pull, git-reset and other command will
change our source code.

  I'm not sure how to do that, though I'd
happily take somebody else's wisdom :D

I find cscope really handy for tracking down definitions of things or
finding out what the callers are of a method/function.  It beats the
living-snot out of trying to do this just with grep.



_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to