Andr3as / Codiad-CodeGit

Git integration for Codiad
MIT License
26 stars 15 forks source link

Submodules #43

Closed Andr3as closed 7 years ago

Andr3as commented 7 years ago

Implements submodules:

Handling

GIT REPO
|--.git
|--libs
  1. Right click to add submodule beyond libs

    1
  2. Enter path of submodule repository and directory name

    2
GIT REPO
|--.git
|--libs
     |--CodeGit
  1. Commit submodule
  2. To perform git actions on the submodule open CodeGit on the submodule (right click on the submodule)
Andr3as commented 7 years ago

👎 The current solution does not implement an authentication.

viharm commented 7 years ago

@Andr3as , in the absence of authentication, do you imply that submodules from repos which are protected/private cannot be added?

Andr3as commented 7 years ago

Yes, currently. I'll change this next week.

viharm commented 7 years ago

Sounds good, thanks.

How will the functionality to update submodules in existing repos work?

viharm commented 7 years ago

Hi @Andr3as . I would like to volunteer to test different use cases. Here are my proposed test scenarios:

  1. Codiad environments
    1. Project root directory is a git repo.
    2. Project root directory is a regular directory, but a sub-directory is a git repo.
  2. CodeGit test cases (for all environments list above)
    1. Clone a remote git repo with pre-existing submodules (more than one level of recursion). Example https://gitlab.com/viharm/Odux.git
    2. Add submodule to an existing local repo; then push to remote.

I am trying to test 2.ii, but cannot seem to get the Add submodule option in the context menu, as shown in your screenshots above. I have checked out the Submodules branch with HEAD at 39db63b42691b699babae61788039843b8ee3d5d. What am I doing wrong?

If I click on a sub-directory in the project, I get the two regular CodeGit options of Git Init and Git Clone.

Do I need to create a placeholder directory for the submodule to be added? Or will CodeGit do it for me?

Andr3as commented 7 years ago

Hi @viharm, that would be great, thank you.

The current plan is to open CodeGit on the submodule repo, perform your actions (pull, commit, etc.) and to reopen CodeGit on the parent repo to commit your changes on the submodule.

That's odd. Do you still have these problems? No you don't need to create a placeholder directory, CodeGit creates the directory.

viharm commented 7 years ago

Sorry for the delayed response. Doing more things concurrently than I can handle :-P

I will test and provide feedback.

viharm commented 7 years ago

Hi @Andr3as , I have done preliminary testing on the submodule functionality. The following combinations work.

* 1i / 2ii
* 1ii / 2i
* 1ii / 2ii

Unfortunately there is no option to initialise pre-existing submodules when creating a new projectd/workspace from a Git repo.

Hope this feedback helps.

Andr3as commented 7 years ago

Thanks a lot. I already thought about that. 1c9b097 should solve this.

Initialise existing submodules through the context menu on the .submodules file.

1

Todo: create a documentation

viharm commented 7 years ago

Hi @Andr3as,

Sorry for not being able to give feedback any earlier. Was moving house :-(

I have tested 1851cc4dd207ce4d04a7a04e30343664c7cbc189 with the following scenario combinations

Thank you very much for your efforts on this.

Andr3as commented 7 years ago

Thanks for your tests.

CodeGit is not part of the "create project"-dialog, the git clone option there is a direct part of Codiad.

dialog

The best way to achive this would be to create the project and clone the git repo afterwards.

viharm commented 7 years ago

@Andr3as , good point. Agreed :-)