dfuenzalida / gedit-git-branch-statusbar

Gedit plugin: Shows the Git branch of the current file on the status bar
https://github.com/dfuenzalida/gedit-git-branch-statusbar
10 stars 0 forks source link

Git-branch-statusbar dont work on Fedora 16 #2

Closed thangola closed 12 years ago

thangola commented 12 years ago

Hi,

I'm using Fedora 16 with Gedit 3. I've successfully installed the plugin. Unfortunately it doesn't work: I can activate it in the Preference, but the branch isnt shown on the status bar.

Can you tell me, did I do smth wrong or was it a bug?

Thanks,

P/S: I have GitPython installed, and have /usr/bin/msgfmt from gettext package.

dfuenzalida commented 12 years ago

Hi,

The easiest thing way to find out what happened is: Open a Terminal, run the "gedit" command and open a file under version control with Git. If there's any error message on the Terminal, copy/paste it here and I'll check what can I do.

2012/2/4 thangola < reply@reply.github.com

Hi,

I'm using Fedora 16 with Gedit 3. I've successfully installed the plugin. Unfortunately it doesn't work: I can activate it in the Preference, but the branch isnt shown on the status bar.

Can you tell me, did I do smth wrong or was it a bug?

Thanks,

P/S: I have GitPython installed, and have /usr/bin/msgfmt from gettext package.


Reply to this email directly or view it on GitHub: https://github.com/dfuenzalida/gedit-git-branch-statusbar/issues/2

"Music is not the expression of a feeling, it's the feeling itself". -- Claude Debussy

thangola commented 12 years ago

Thanks for quickly responding, but when I ran Gedit as that, the output was nothing. What should I do to debug now?

dfuenzalida commented 12 years ago

Try the following: If you have a Git project, open a Terminal and change directory to the location of your project files

$ cd /home/myuser/some/project

Look for a file which is versioned with Git. Then, try running the following python code, which tries to find out the branch name, just like my plugin (change "./README.txt") with any of your project's files.

$ python Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) [GCC 4.5.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import git repo = git.Repo("./README.txt") repo.active_branch 'master' ^D

If you notice any error, it's likely you're missing the right git-python binding, OR the file you have opened is not versioned with Git, OR the statusbar is hidden (View > Statusbar)

thangola commented 12 years ago

This is my output:

$ python Python 2.7.2 (default, Oct 27 2011, 01:36:46) [GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import git repo=git.Repo("./README") repo.active_branch <git.Head "refs/heads/sign-up">

It looks good. But when I changed the default value of label_text variable in your do_update_state() function, the new default value shown on the status bar.

Hope this help.

dfuenzalida commented 12 years ago

It seems that Fedora is using a different version of the git-python library, on which repo.active_branch returns an Object, not a String, but probably, that Object has a 'name' attribute.

Try the following: On the folder where you cloned the git repo, edit git-branch-statusbar-plugin.py on line 74. Where it reads

repo.active_branch

change it to

repo.active_branch.name

Then reinstall the plugin and relaunch gedit.

2012/2/4 Thang Pham < reply@reply.github.com

This is my output:

$ python Python 2.7.2 (default, Oct 27 2011, 01:36:46) [GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import git repo=git.Repo("./README") repo.active_branch <git.Head "refs/heads/sign-up">

It looks good. But when I changed the default value of label_text variable in your do_update_state() function, the new default value shown on the status bar.

Hope this help.


Reply to this email directly or view it on GitHub:

https://github.com/dfuenzalida/gedit-git-branch-statusbar/issues/2#issuecomment-3812507

"Music is not the expression of a feeling, it's the feeling itself". -- Claude Debussy

thangola commented 12 years ago

It works. Thank you very much.

dfuenzalida commented 12 years ago

You're welcome!

2012/2/4 Thang Pham < reply@reply.github.com

It works. Thank you very much.


Reply to this email directly or view it on GitHub:

https://github.com/dfuenzalida/gedit-git-branch-statusbar/issues/2#issuecomment-3812621

"Music is not the expression of a feeling, it's the feeling itself". -- Claude Debussy