Skip to content
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

Wiki #3

Open
devolonter opened this issue Mar 4, 2013 · 15 comments
Open

Wiki #3

devolonter opened this issue Mar 4, 2013 · 15 comments
Labels

Comments

@devolonter
Copy link
Member

I've added some information to wiki. I hope this will clarify some issues. Also feel free to tell me your opinion, perhaps something can be done better

Also, please inform if you need any help-material about git and about working with submodules?

@frameland
Copy link
Member

So I should name my repo pub.files.css then?
I think an example repo will clarify how the structure should be exactly.

@devolonter
Copy link
Member Author

Yes, that's right. You can hold this module at yourselves or make pub as the owner.

@frameland
Copy link
Member

Maybe a stupid question but when I clone the pub repo there is a json folder in it but no files?
I switched to develop branch and guess you are doing some kind of repo linking (sorry I am not that familiar with scm).

I am a bit confused how I should exactly push my modules into pub.

Oh, and there should be an example folder :)

@devolonter
Copy link
Member Author

Yes, I think submodules may confuse many :). OK, a little help (I will describe this in detail in wiki soon)

When you clone repo for the first time, you need to initialize the submodules to get the source code files. To do this, just type in console git submodule update --init

In subsequent times you will need to call only git submodule update

To add module to the repository as a submodule (link) just type in console the following. Example for JSON:
git submodule add [email protected]:pub-monkey/pub.files.json.git files/json

I didn’t think of examples. Yes, I think I should add this folder :)

@frameland
Copy link
Member

Ok, and when a normal user downloads the zip file of the master branch he will have all the files right?

@devolonter
Copy link
Member Author

Unfortunately, no. But I thought that normal users won’t download anything from the branches. Instead, I wanted to create a public page with a simple archive for download.

By the way, I found a simpler way to clone with submodules. Just: git clone --recursive

P.S. I don’t insist on the use of submodules. Sometimes I think that it can bring an extra headache. It might be worth to use only one repository for development? Although in this case we lose some flexibility. I think we still have to think about it...

@frameland
Copy link
Member

I think the user should always be able to get the latest version of the master branch.
I haven't used git that long so I can't really judge it but what flexibilty are we loosing when not using submodules?

Anyway, just so I don't do anything stupid. For me to check in my css module I clone the pub module, make my changes and then push back to the remote?

@devolonter
Copy link
Member Author

Yes, I agree with you that user should be able to download the master branch. The use of submodules kills this feature so we have to choose something one.

The use of submodules gives us the following advantages:

  • Independent changes history of each module. For example, the developer changed two modules at the same time with one commit. The first change is good, the second - bad. To get back, we need to rollback, but also revert the good change. Submodules can help to avoid such situations.
  • Ability to add modules from other git services - for example, Bitbucket. Thus developers can use a familiar environment for themselves.
  • The ability to limit access to certain repositories. For example, for new team members.
  • Separate branches, tags and issue-tracker for each module.

This is what has now come to my mind. At the same time, the use of submodules makes it difficult to develop, as requires good knowledge of git. But this issue can be solved by writing a quick reference.

You can make changes to the submodule in two ways:

  1. By updating your repository separately. To do this:
    • Make changes
    • Commit changes (git commit)
    • Push changes to the server (git push)
    • Go to pub repository folder
    • Go to the folder with your repository (in pub repository) (cd files/css)
    • Get changes (git pull). This will move the pointer to the head of your repository.
    • Go to the root of the pub repository (cd ../../)
    • Commit changes to the pub repository (git commit)
  2. Make changes directly in the pub:
    • Make changes to your module in pub folder (files/css)
    • Commit changes (git commit)
    • Push changes to the server (git push)
    • Go to the root of the pub repository (cd ../../)
    • Commit changes to the pub repository (git commit)

Now I have made some test changes in the pub repository. So do not forget to make git pull and git submodule update. Important! Submodule update can be done only if you have not made ​​any changes to submodules locally. Otherwise, you will lose all changes. More about submodules can be found in the documentation.

It seems that everything is getting too complicated! I incline towards one repository more and more :) It’s night here. Let me know what you think about this and I hope we will solve this issue tomorrow .

@frameland
Copy link
Member

Yeah, it seems to complicated for the sake of sharing some modules.

I tried pushing to the repo but it seems I don't have write access to pub monkey.
(permission denied) using: git push origin develop

@devolonter
Copy link
Member Author

I apologize for an access error. It appears that it’s necessary to set the rights for each repository. Fixed it, now everything should be normal.

I agree with you. I deleted submodule and added JSON simply as source code files. To completely get rid of the traces of submodules you'd better make a clone of a repository pub again.

@frameland
Copy link
Member

Ok, I think did something wrong.
Css is somehow a submodule without a link? I have the module in my own repo. Should I make a completely new one?

I am not that confident with reverting. Sorry for the trouble.

@devolonter
Copy link
Member Author

I thought we decided not to use submodules? The error occurred because in the previous commit I removed .gitmodules file and we have a conflict now. I’ve deleted your submodule.

Now just make a clone again and add your module as a source code files (not a submodule). I think it will be easier. I suppose pub.files.css repository can be deleted.

@devolonter
Copy link
Member Author

@Shinkiro1 I’ve just noticed that you added the CSS module. I am glad that we were able to resolve these issues. Sorry if I misled you with submodules. I think it was a bad idea ...

Yesterday, I also changed the information in the wiki, removed all references about submodules.

@frameland
Copy link
Member

Np. I think it's a lot easier this way now. I edited the wiki development entry so everyone is on the same boat.

@skn3
Copy link
Member

skn3 commented Mar 7, 2013

is there a clean/automated way to maintain a separate repo and just merge changes into pub? I guess I could write a web script to do it, just wonder if anyone knows of a way?

Also added in XML module now to dev branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants