richelbilderbeek / travis_cpp_tutorial

Tutorial how to use Travis CI with C++
GNU General Public License v3.0
169 stars 23 forks source link

Include Submodule Files in Documentation #33

Closed flywire closed 4 years ago

flywire commented 4 years ago

The tutorial requires files from repositories used as Submodules. The MkDocs Snippets extension requires files to be local, as would displaying documentation off-line.

Suggest downloading Submodules to consume but not update.

Cloning a Project with Submodules

Here we’ll clone a project with a submodule in it. When you clone such a project, by default you get the directories that contain submodules, but none of the files within them yet:

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.

Pulling in Upstream Changes from the Submodule Remote

The simplest model of using submodules in a project would be if you were simply consuming a subproject and wanted to get updates from it from time to time but were not actually modifying anything in your checkout. ...

Recommendation? Best adding to wiki.

richelbilderbeek commented 4 years ago

Yup, will do Saturday :+1:

On 8 June 2020 at 15:33:04 +02:00, flywire notifications@github.com wrote:

Assigned #33 https://github.com/richelbilderbeek/travis_cpp_tutorial/issues/33 to @richelbilderbeek https://github.com/richelbilderbeek.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/richelbilderbeek/travis_cpp_tutorial/issues/33#event-3420077054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQAINQRYM4D4F4SABIQ7PLRVTSBBANCNFSM4NYNHPTQ.

richelbilderbeek commented 4 years ago

Will do Saturday

On 8 June 2020 at 15:32:48 +02:00, flywire notifications@github.com wrote:

The tutorial requires files from repositories used as Submodules https://git-scm.com/book/en/v2/Git-Tools-Submodules. The MkDocs https://www.mkdocs.org/ Snippets https://facelessuser.github.io/pymdown-extensions/extensions/snippets/ extension requires files to be local, as would displaying documentation off-line.

Suggest downloading Submodules to consume but not update.

Cloning a Project with Submodules

Here we’ll clone a project with a submodule in it. When you clone such a project, by default you get the directories that contain submodules, but none of the files within them yet:

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.

Pulling in Upstream Changes from the Submodule Remote

The simplest model of using submodules in a project would be if you were simply consuming a subproject and wanted to get updates from it from time to time but were not actually modifying anything in your checkout. ... Recommendation? Best adding to wiki https://github.com/flywire/travis_cpp_tutorial/wiki.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richelbilderbeek/travis_cpp_tutorial/issues/33, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQAINTO2KR2WNZV4W55UO3RVTSABANCNFSM4NYNHPTQ.

richelbilderbeek commented 4 years ago

The MkDocs Snippets extension requires files to be local, as would displaying documentation off-line.

Sure, the LyX tutorial assumes that as well!

Suggest downloading Submodules to consume but not update.

I am unsure what you mean by that. Running download_other_githubs.sh downloads all GitHub repos to local. Isn't that what you were looking for?

flywire commented 4 years ago

That's a bash script. I'm running Win10.

I'd have expected the following repositories to be included as submodules:

travis_qmake_gcc_cpp11_debug_gcov
travis_qmake_gcc_cpp98_debug_and_release
travis_qmake_gcc_cpp98_debug_gcov
travis_qmake_gcc_cpp98_oclint
travis_qmake_gcc_cpp98_qt_qtest
travis_qmake_gcc_cpp98_qt4
travis_qmake_gcc_cpp98_qt5
travis_qmake_gcc_cpp98_sloccount

Then:

richelbilderbeek commented 4 years ago

That's a bash script. I'm running Win10.

You can run more and more bash scripts on Windows nowadays, especially when using Powershell. Have you tried?

If there is a Windows-specific error, I may be able to make the script more cross-platform compatible.

I'd have expected the following repositories to be included as submodules

Easy peasy. I don't mind to help, but I don't see why do you need me for that? I assume you know you can install git on Windows (or 'Git Bash' for a better prompt, until Powershell gets more mainstream(

Execute the following command from the directory to have the branch tree installed in: git clone -b Development --recurse-submodules https://github.com/flywire/travis_cpp_tutorial

Uh, why would I want to clone the flywire Develop branch? Also here, I am happy to help, but I cannot understand you want my help if you hand in the exact solution :+1:

flywire commented 4 years ago

... I cannot understand you want my help if you hand in the exact solution 👍

flywire commented 4 days ago

Got it to work after post. 👍

I assume you know you can install git on Windows

I'm using https://tortoisegit.org/

Uh, why would I want to clone the flywire Develop branch?

?? That's what I'm working on, isn't it? I push to https://github.com/richelbilderbeek/travis_cpp_tutorial Develop branch when I'm happy with it.

I just added those repos with git submodule add [repo]. Currently investigating empty:

richelbilderbeek commented 4 years ago

I see the problem here: you are not a collaborator of the richlbilderbeek/travis_qmake_gcc_cpp98_qt4 repo.

Two options:

richelbilderbeek commented 4 years ago

?? That's what I'm working on, isn't it? I push to https://github.com/richelbilderbeek/travis_cpp_tutorial Develop branch when I'm happy with it.

Since you are a collaborator, now would be a good moment to move to working on the develop branch of this repo. Creating a topic branch (e.g. flywire) would make it easy for me to check your work.

flywire commented 4 years ago

In theory, I only need read access to the other repos. Could be I want write access later. Can you add me as a collaborator to those two too?

I'm happy to keep working on flywire develop and push it when I'm happy with it. I see other collaborating developers do something similar.

richelbilderbeek commented 4 years ago

In theory, I only need read access to the other repos. Could be I want write access later. Can you add me as a collaborator to those two too?

Done :+1:

I see other collaborating developers do something similar.

Most people work on projects of this size work on either Forks or branches. Both at the same time may be considered overkill. But sure, I can work with any scenario :+1:

richelbilderbeek commented 4 years ago

From now on, the submodules are within the travis_cpp_tutorial folder. It took a while to transform the LyX code to that, but it's done.