Multiple OTs with Git
Managing dozens of OT
configurations using git
11/18/2015 Contrext, LLC 1
Eliot Kimber
Contrext, LLC
DITA OT Day 2015 Munich, Germany
Problem: Many OT Configurations
• Different OT versions
• Per-client OT configurations
• Experiments
• Projects
• Etc.
11/18/2015 Contrext, LLC 2
Solution: Make OT Directory a Git
repo
$ cd ~/DITA-OT
$ git init
$ git add –A
$ git commit –m "Initial setup"
11/18/2015 Contrext, LLC 3
One value is single location for OT—don't have to
modify oXygenXML or other tools that need to know
where OT is.
One Branch Per Configuration
$ git checkout –b 1.8.5
$ git checkout master
$ git checkout –b 2.x
$ rm –Rf *
$ copy –r ../DITA-OT-2.2.1/*
$ git add –A .
$ git commit –m "2.2.1 version"
$ git checkout –b example.org
$ git branch
1.8.5
2.x
* example.org
master
11/18/2015 Contrext, LLC 4
Be Sure to Include .jar Files
$ cat .gitignore
!*.jar
11/18/2015 Contrext, LLC 5
Exclude Generated Files
$ cat .gitignore
!*.jar
build.xml
catalog-dita.xml
lib/org.dita.dost.platform/plugin.properties
plugins/org.dita.eclipsehelp/xsl/map2plugin.xsl
resource/messages.xml
xsl/preprocess/maplink.xsl
xsl/preprocess/mappull.xsl
xsl/preprocess/mapref.xsl
11/18/2015 Contrext, LLC 6
Create an "empty" branch
$ git checkout –b empty
$ rm –Rf *
$ git add -A
$ git commit –m "Empty branch"
$ git checkout 1.8.5
$ ant –f integrator.xml
$ git checkout –f empty
$ rm –Rf *
$ git checkout 2.x
11/18/2015 Contrext, LLC 7
Gotchas
• Not committing Jar files
– On checkout of branch, PDF generation fails
– Check or override your default ignore settings
• Committing generated files
– Produces non-useful changes you have to ignore or
manually remove
– List ignored files in .gitignore
• Switching between branches after deploying new
plugins
– Use the empty branch
11/18/2015 Contrext, LLC 8
Questions?
11/18/2015 Contrext, LLC 9

Managing Multiple Open Toolkit Configurations Using git Lightning Talk

  • 1.
    Multiple OTs withGit Managing dozens of OT configurations using git 11/18/2015 Contrext, LLC 1 Eliot Kimber Contrext, LLC DITA OT Day 2015 Munich, Germany
  • 2.
    Problem: Many OTConfigurations • Different OT versions • Per-client OT configurations • Experiments • Projects • Etc. 11/18/2015 Contrext, LLC 2
  • 3.
    Solution: Make OTDirectory a Git repo $ cd ~/DITA-OT $ git init $ git add –A $ git commit –m "Initial setup" 11/18/2015 Contrext, LLC 3 One value is single location for OT—don't have to modify oXygenXML or other tools that need to know where OT is.
  • 4.
    One Branch PerConfiguration $ git checkout –b 1.8.5 $ git checkout master $ git checkout –b 2.x $ rm –Rf * $ copy –r ../DITA-OT-2.2.1/* $ git add –A . $ git commit –m "2.2.1 version" $ git checkout –b example.org $ git branch 1.8.5 2.x * example.org master 11/18/2015 Contrext, LLC 4
  • 5.
    Be Sure toInclude .jar Files $ cat .gitignore !*.jar 11/18/2015 Contrext, LLC 5
  • 6.
    Exclude Generated Files $cat .gitignore !*.jar build.xml catalog-dita.xml lib/org.dita.dost.platform/plugin.properties plugins/org.dita.eclipsehelp/xsl/map2plugin.xsl resource/messages.xml xsl/preprocess/maplink.xsl xsl/preprocess/mappull.xsl xsl/preprocess/mapref.xsl 11/18/2015 Contrext, LLC 6
  • 7.
    Create an "empty"branch $ git checkout –b empty $ rm –Rf * $ git add -A $ git commit –m "Empty branch" $ git checkout 1.8.5 $ ant –f integrator.xml $ git checkout –f empty $ rm –Rf * $ git checkout 2.x 11/18/2015 Contrext, LLC 7
  • 8.
    Gotchas • Not committingJar files – On checkout of branch, PDF generation fails – Check or override your default ignore settings • Committing generated files – Produces non-useful changes you have to ignore or manually remove – List ignored files in .gitignore • Switching between branches after deploying new plugins – Use the empty branch 11/18/2015 Contrext, LLC 8
  • 9.