git plugin is ineffective when the user does not own the .git parent folder

Bug #2042950 reported by jean-christophe manciot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gedit-plugins (Ubuntu)
New
Undecided
Unassigned

Bug Description

Environment:
- Ubuntu lunar 23.04 with gedit-plugin-git 44.1-2
- or Ubuntu mantic 23.10 with gedit-plugin-git 44.1-2

There is no issue when the user owns the parent folder where the .git folder is located.

Now, let's consider

However, when the following conditions are met, no modified lines are highlighted rendering the git plugin useless:
- the user has only group R/W access to the file to modify it
- the user has only group R/W access to the .git folder
- the user has only group R/W access to the parent folder where the .git folder is located
- the user does not own the parent folder where the .git folder is located

Furthermore, the following errors are logged in syslog:

Nov 7 14:57:23 hostname gedit[1176655]: Traceback (most recent call last):
Nov 7 14:57:23 hostname gedit[1176655]: File "/usr/lib/x86_64-linux-gnu/gedit/plugins/git/appactivatable.py", line 89, in get_repository
Nov 7 14:57:23 hostname gedit[1176655]: repo = self.__git_repos[repo_uri]
Nov 7 14:57:23 hostname gedit[1176655]: ~~~~~~~~~~~~~~~~^^^^^^^^^^
Nov 7 14:57:23 hostname gedit[1176655]: KeyError: 'file:///<git_parent_folder>/.git'
Nov 7 14:57:23 hostname gedit[1176655]: During handling of the above exception, another exception occurred:
Nov 7 14:57:23 hostname gedit[1176655]: Traceback (most recent call last):
Nov 7 14:57:23 hostname gedit[1176655]: File "/usr/lib/x86_64-linux-gnu/gedit/plugins/git/viewactivatable.py", line 116, in update_location
Nov 7 14:57:23 hostname gedit[1176655]: repo = self.app_activatable.get_repository(self.location, False)
Nov 7 14:57:23 hostname gedit[1176655]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 7 14:57:23 hostname gedit[1176655]: File "/usr/lib/x86_64-linux-gnu/gedit/plugins/git/appactivatable.py", line 92, in get_repository
Nov 7 14:57:23 hostname gedit[1176655]: repo = Ggit.Repository.open(repo_file)
Nov 7 14:57:23 hostname gedit[1176655]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 7 14:57:23 hostname gedit[1176655]: gi.repository.GLib.GError: ggit-error: repository path '/<git_parent_folder>/' is not owned by current user (-36)

summary: - git plugin is ineffective when the user does not own the folder
+ git plugin is ineffective when the user does not own the git parent
+ folder
summary: - git plugin is ineffective when the user does not own the git parent
+ git plugin is ineffective when the user does not own the .git parent
folder
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.