QuickTip: DDE, Source Control & Templates

Monday, November 10, 2014 at 10:22 AM UTC

Uh, what a mess!

Today my co-worker (the developer from the customer) and I got into real trouble with our project: we messed up our local repositories after he upgraded his dev version with a template I created just before. If you followed my posts then you know we use a Gitlab server with Sourcetree to manage the local and remote repositories and it worked fine until this day. I always was responsible for mergin his branch into mine (master). After that I delivered a NTF template that he could upgrade his test database with. This time I told him to upgrade his dev database to be up-to-date.

In general there is no problem with it as long as you obey a simple rule:

Always create the on-disk-project in a subfolder under the repository's root folder

e.g.

MyProject/ODP

where MyProject is the root folder where the .gitignore file should reside and the hidden subfolder called ".git". Latter was the problem. I didn't create that ODP subfolder for the Notes design so the .git folder resided beside the other folders of the ODP ("Xpages" etc.).

If the .git folder and the other reside beside then the .git folder will become part of your NSF/NTF! As this folder contains all commits and informations of your repository you will get into trouble in many ways:

  • a template you create will overwrite local repository settings when synched with the NSF on another machine (this was the case my customer and I had today)
  • if you produce a template that will be shipped to your customer he is able to see all commits (and messages) if he sets up source control for the application that was updated with it - and that's maybe not that what you want
  • even worse: one is not able to use source control on an application that is updated/build with this as the .git folder is already there

Here is a screenshot of what you might see if you don't follow the rule above:

This folder must not be there! So if you ship a template then open it in DDE, switch to the Navigator view and remove the folder before!

So please keep your ODPs clean by separating them into their own folder like this:

 






Latest comments to this post

Paul Withers wrote on 10.11.2014, 23:04

Two other reasons to keep the ODP at a lower level of the repository are 1) so you can keep documentation in the repository but outisde the NSF and 2) so you can add additional ODPs to the repository in the future, if necessary.

 Link to this comment
Martin Jinoch wrote on 10.11.2014, 18:37

If you have EGit installed in your DDE, you can have .git folder and all data in the top level folder, because then DDE knows it should ignore .git folder and not to put it in the NSF

 Link to this comment
Frank van der Linden wrote on 10.11.2014, 18:06

It is a best practice to store your ODP in subfolder of the GIT repostory, in my case is that nsf. Benefit is that you can store in the root, ginnier folder and in my case the bower files.

 

 Link to this comment

Leave a comment right here

Latest comments