New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to open submodule #606

Closed
MikHulk opened this Issue Oct 10, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@MikHulk

MikHulk commented Oct 10, 2016

I have a repo with a submodule. This appears in "Status" window when I open main repo in git-cola. When submodule is selected, the commit history appears in "Diff" window. If I try a right click on submodule in Status windows, a submenu is opened suggest me to "Launch git-cola", assuming is the means to browse the submodule I select it. Then I get an error:

Traceback (most recent call last):

File "/usr/share/git-cola/lib/cola/cmds.py", line 1863, in do_cmd
    return cmd.do()

  File "/usr/share/git-cola/lib/cola/cmds.py", line 1081, in do
    self.model.set_worktree(old_repo)

  File "/usr/share/git-cola/lib/cola/models/main.py", line 118, in set_worktree
    self.git.set_worktree(worktree)

  File "/usr/share/git-cola/lib/cola/git.py", line 150, in set_worktree
    path = core.decode(path)

  File "/usr/share/git-cola/lib/cola/core.py", line 49, in decode
    return enc.decode('utf-8', errors='ignore')

AttributeError: 'tuple' object has no attribute 'decode'

I suppose something went wrong with submodule handling.

Does Git-cola support git sub module ? According to #17 it seems something was done for this.

What is the status of submodule support in git cola ?

@davvid davvid closed this in 702a8a3 Oct 14, 2016

@MikHulk

This comment has been minimized.

Show comment
Hide comment
@MikHulk

MikHulk Dec 3, 2016

I got a git-cola fresh clone. With this new version I don't get an error, but action on 'launch git-cola' when right click on sub module does nothing.

MikHulk commented Dec 3, 2016

I got a git-cola fresh clone. With this new version I don't get an error, but action on 'launch git-cola' when right click on sub module does nothing.

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Dec 4, 2016

Member

I just tried it here and I think it's working.. are there any messages in your terminal?

It doesn't actually launch a separate session.. it's kind of subtle. What it does is switch projects/directories to the submodule. If they both don't have any modified or untracked files they might look the same. Any hints?

Member

davvid commented Dec 4, 2016

I just tried it here and I think it's working.. are there any messages in your terminal?

It doesn't actually launch a separate session.. it's kind of subtle. What it does is switch projects/directories to the submodule. If they both don't have any modified or untracked files they might look the same. Any hints?

@MikHulk

This comment has been minimized.

Show comment
Hide comment
@MikHulk

MikHulk Dec 4, 2016

No message on my terminal. I don't know what should be the behaviour. I didn't find documentation about it.
I just tried to change one file in my sub-module. In git cola I see the master project. In status panel I see a line related to my sub module. If I select it, a summary is displayed in diff panel:

Submodule soap_helper contains modified content
Submodule soap_helper 2d3411b..3663b95:
   > add encoding in fake response
   > add logging facilities`

I would like to work on my submodule in the same way I do with master. But if I try to open via "File -> open" I return directly in the previous view, with master project and sub module in status panel. If I try to use contextual menu with right click on sub-module name in status panel nothing happens.

So it is impossible to do something on my submodule in git-cola, and I must use command-line.

I have just made some tests. Below the creation of project and initialisation of a sub module inner from the command line (sorry for the terminal responses in french):

[mik@sp-77 ~]$ mkdir test_gc
[mik@sp-77 ~]$ cd test_gc/
[mik@sp-77 test_gc]$ git init
Dépôt Git vide initialisé dans /home/mik/test_gc/.git/
[mik@sp-77 test_gc]$ git submodule add https://github.com/kenoph/bottle-json-rpc.git a_sub_module
Clonage dans 'a_sub_module'...
remote: Counting objects: 12, done.
remote: Total 12 (delta 0), reused 0 (delta 0), pack-reused 12
Dépaquetage des objets: 100% (12/12), fait.
Vérification de la connectivité... fait.
[mik@sp-77 test_gc]$ git status
Sur la branche master

Validation initiale

Modifications qui seront validées :
  (utilisez "git rm --cached <fichier>..." pour désindexer)

	nouveau fichier : .gitmodules
	nouveau fichier : a_sub_module

[mik@sp-77 test_gc]$ git commit -m 'add a sub mdule'
[master (commit racine) 0bc5d49] add a sub mdule
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 a_sub_module
[mik@sp-77 test_gc]$ git status
Sur la branche master
rien à valider, la copie de travail est propre
[mik@sp-77 test_gc]$ cd a_sub_module/
[mik@sp-77 a_sub_module]$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.
rien à valider, la copie de travail est propre
[mik@sp-77 a_sub_module]$ ls
bottle_jsonrpc.py  example.py  LICENSE  README.rst  setup.cfg  setup.py
[mik@sp-77 a_sub_module]$ echo test > test
[mik@sp-77 a_sub_module]$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.
Fichiers non suivis:
  (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé)

	test

aucune modification ajoutée à la validation mais des fichiers non suivis sont présents (utilisez "git add" pour les suivre)
[mik@sp-77 a_sub_module]$ cd ..
[mik@sp-77 test_gc]$ git status
Sur la branche master
Modifications qui ne seront pas validées :
  (utilisez "git add <fichier>..." pour mettre à jour ce qui sera validé)
  (utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail)
  (valider ou annuler le contenu non suivi ou modifié dans les sous-modules)

	modifié :         a_sub_module (contenu non suivi)

aucune modification n'a été ajoutée à la validation (utilisez "git add" ou "git commit -a")
[mik@sp-77 test_gc]$ 

I tried to display the sub module in git-cola but i got the same problem. I have no mean to work on "a_sub_module" from git-cola.

Thx,

MikHulk commented Dec 4, 2016

No message on my terminal. I don't know what should be the behaviour. I didn't find documentation about it.
I just tried to change one file in my sub-module. In git cola I see the master project. In status panel I see a line related to my sub module. If I select it, a summary is displayed in diff panel:

Submodule soap_helper contains modified content
Submodule soap_helper 2d3411b..3663b95:
   > add encoding in fake response
   > add logging facilities`

I would like to work on my submodule in the same way I do with master. But if I try to open via "File -> open" I return directly in the previous view, with master project and sub module in status panel. If I try to use contextual menu with right click on sub-module name in status panel nothing happens.

So it is impossible to do something on my submodule in git-cola, and I must use command-line.

I have just made some tests. Below the creation of project and initialisation of a sub module inner from the command line (sorry for the terminal responses in french):

[mik@sp-77 ~]$ mkdir test_gc
[mik@sp-77 ~]$ cd test_gc/
[mik@sp-77 test_gc]$ git init
Dépôt Git vide initialisé dans /home/mik/test_gc/.git/
[mik@sp-77 test_gc]$ git submodule add https://github.com/kenoph/bottle-json-rpc.git a_sub_module
Clonage dans 'a_sub_module'...
remote: Counting objects: 12, done.
remote: Total 12 (delta 0), reused 0 (delta 0), pack-reused 12
Dépaquetage des objets: 100% (12/12), fait.
Vérification de la connectivité... fait.
[mik@sp-77 test_gc]$ git status
Sur la branche master

Validation initiale

Modifications qui seront validées :
  (utilisez "git rm --cached <fichier>..." pour désindexer)

	nouveau fichier : .gitmodules
	nouveau fichier : a_sub_module

[mik@sp-77 test_gc]$ git commit -m 'add a sub mdule'
[master (commit racine) 0bc5d49] add a sub mdule
 2 files changed, 4 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 a_sub_module
[mik@sp-77 test_gc]$ git status
Sur la branche master
rien à valider, la copie de travail est propre
[mik@sp-77 test_gc]$ cd a_sub_module/
[mik@sp-77 a_sub_module]$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.
rien à valider, la copie de travail est propre
[mik@sp-77 a_sub_module]$ ls
bottle_jsonrpc.py  example.py  LICENSE  README.rst  setup.cfg  setup.py
[mik@sp-77 a_sub_module]$ echo test > test
[mik@sp-77 a_sub_module]$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.
Fichiers non suivis:
  (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé)

	test

aucune modification ajoutée à la validation mais des fichiers non suivis sont présents (utilisez "git add" pour les suivre)
[mik@sp-77 a_sub_module]$ cd ..
[mik@sp-77 test_gc]$ git status
Sur la branche master
Modifications qui ne seront pas validées :
  (utilisez "git add <fichier>..." pour mettre à jour ce qui sera validé)
  (utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail)
  (valider ou annuler le contenu non suivi ou modifié dans les sous-modules)

	modifié :         a_sub_module (contenu non suivi)

aucune modification n'a été ajoutée à la validation (utilisez "git add" ou "git commit -a")
[mik@sp-77 test_gc]$ 

I tried to display the sub module in git-cola but i got the same problem. I have no mean to work on "a_sub_module" from git-cola.

Thx,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment