Closed aciapetti closed 5 years ago
Hi Andrea, thanks for reporting this issue and I'm glad it is (or was) useful to you. However, as you can see, I haven't touched this repo in ages (since late 2011!). Would you be interested in cloning the repo and sending me a pull request?
I had a quick look and maybe all that needs to be changed is adding a line at the top of git-branch-statusbar-plugin.py
as in this StackOverflow answer: https://stackoverflow.com/a/19305076
Hi Denis, thanks for the quick reply. I'll try to check it during the weekend. Hope of being able to do so.
OK, it seems I was able to figure the things I needed to update for it to work on Ubuntu 18.04:
python3-git
and gettext
instead of the previous libsstr
instead of expect coercion to Strings)I'll push my changes shortly, here's a screenshot from my laptop:
It seems that should do. Please pull from the repo, try installing it on your computer and let me know if it works. Sorry for just going ahead before you tried!
On the other hand, if you find this plugin to be useful, and want to make UX improvements (eg. the label could be prettier, maybe getting rid of that border, or maybe using some padding) you are more than welcome to contribute.
Thanks a lot, Denis. It's working nicely now! On my company repositories, it's not detecting the git branch, though. Do you have any idea why? See images attached.
Perhaps we can add some other simple info, like the status of the repository (are there changed or untracked files? use different colors for different situations...) and a simple icon for git branches. Obtaining the info is pretty simple: print('Repo is in dirty status {}'.format(repo.is_dirty())) print('Repo untracked files {}'.format(len(repo.untracked_files))) print('Repo changed files {}'.format(len(repo.index.diff(None)))) Icons:
Something like this:
WDYT?
On my company repositories, it's not detecting the git branch, though. Do you have any idea why?
I guess what's happening is that the plugin only looks in the directory of the current file being edited, but not recursively on the parent, so if you edit a file like <project-root>/dir1/myfile.txt
it won't find the root of the Git repo. I'll take a look at that this weekend.
Yes. You're right. Try git_repo = git.Repo(dir_path, search_parent_directories=True) instead of repo = git.Repo(dir_path).
Yes, using search_parent_directories=True
did the trick:
@aciapetti I've pushed this change to the repo in the latest commit b8f59c0d10f1f0aad3392c3f210925e78b6c9c7e ... please confirm if it works on your company repos.
For handing the UI enhancements, I'll create a separate issue and some links to the Python-gtk3 tutorial so we can how feasible would be to include a Git logo in the status bar, etc.
Thanks a lot @dfuenzalida, the plugin is now working perfectly on each case I've tested. I think you can close this issue. Thanks again for the prompt reply and for the wonderful collaboration. I'll contact you via mail directly on GMail to show you my small steps forward in the issue #4
In the new Gedit 3 only python3 plugins are supported. Enabling git-branch-statusbar plugin now produces the error: WARNING **: Could not find loader 'python' for plugin "git-branch-statusbar"
Can you please update the plugin to make it work on the Gedit version included in Ubuntu 18.04 LTS?
Thanks Andrea