)]}'
{
  "commit": "e5fc90eb67bc5cb431ce466ca7fa690cd46fc9e5",
  "tree": "2662e6b83e1f11490e2f4c715b73c74f3d6dceda",
  "parents": [
    "8e0f6d06fe63db593dd18fdb4e7c5bab934c59cf"
  ],
  "author": {
    "name": "Sasa Zivkov",
    "email": "sasa.zivkov@sap.com",
    "time": "Fri May 10 15:12:13 2013 +0200"
  },
  "committer": {
    "name": "Shawn Pearce",
    "email": "sop@google.com",
    "time": "Wed Sep 18 12:52:17 2013 -0700"
  },
  "message": "Optionally, initialize site from WebAppInitializer.\n\nThis supports automatic site initialization on Gerrit server startup\nwhen Gerrit runs in a servlet container. Both creation of a new site\nand upgrade of an existing site are supported.\n\nThis feature may be useful for such setups where Gerrit admins don\u0027t\nhave direct access to the database and the file system of the server\nwhere Gerrit should be deployed and, therefore, cannot perform the\ninit from their local machine prior to deploying Gerrit on such a\nserver. It may also make deployment and testing in a local servlet\ncontainer faster to setup as the init step could be skipped.\n\nThe site initialization will be performed only if the \u0027gerrit.init\u0027\nsystem property exists (the value of the property is not, used only the\nexistence of the property matters).\n\nIf the \u0027gerrit.site_path\u0027 system property is defined then the init is\nrun for that site. The database connectivity, in that case, is defined\nin the etc/gerrit.config.\n\nIf \u0027gerrit.site_path\u0027 is not defined then Gerrit will try to find an\nexisting site by looking into the system_config table in the database\ndefined via the \u0027jdbc/ReviewDb\u0027 JNDI property. If system_config table\nexists then the site_path from that table is used for initialization.\nDatabase connectivity is defined by the jdbc/ReviewDb JNDI property.\n\nFinally, if neither \u0027gerrit.site_path\u0027 property nor the system_config\ntable exists, the \u0027gerrit.init_path\u0027 system property, if defined, will\nbe used to determine the site path. Database connectivity, also for this\ncase,is defined by the jdbc/ReviewDb JNDI property.\n\nExample 1:\n  Prepare Tomcat so that a site is initialized at a given path using\n  the H2 database (if the site doesn\u0027t exist yet) or using whatever\n  database is defined in the etc/gerrit.config of that site:\n\n  $ export CATALINA_OPTS\u003d\u0027-Dgerrit.init -Dgerrit.site_path\u003d/path/to/site\u0027\n  $ catalina.sh start\n\nExample 2:\n  Prepare Tomcat so that an existing site with the path defined in the\n  system_config table is initialized (upgraded) on Gerrit startup. The\n  assumption is that the jdbc/ReviewDb JNDI property is defined in\n  Tomcat:\n\n  $ export CATALINA_OPTS\u003d\u0027-Dgerrit.init\u0027\n  $ catalina.sh start\n\nExample 3:\n  Assuming the database schema doesn\u0027t exist in the database defined\n  via the jdbc/ReviewDb JNDI property, initialize a new site using that\n  database and a given path:\n\n  $ export CATALINA_OPTS\u003d\u0027-Dgerrit.init -Dgerrit.init_path\u003d/path/to/site\u0027\n  $ catalina.sh start\n\nChange-Id: Ic3e8c993087d2fbb38e14479a539dc62495ad908\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4c204fd1783d5e0ccff16a73390e0313a68ba9ce",
      "new_mode": 33188,
      "new_path": "Documentation/config-auto-site-initialization.txt"
    },
    {
      "type": "modify",
      "old_id": "28e0184b58aa3a23b312c830f98360c628fa279c",
      "old_mode": 33188,
      "old_path": "Documentation/index.txt",
      "new_id": "ee768555ec04c8deeadca56eb9cab01c7359463d",
      "new_mode": 33188,
      "new_path": "Documentation/index.txt"
    },
    {
      "type": "modify",
      "old_id": "f6853c81b918ee90c59a9c22b0bff39118f138bd",
      "old_mode": 33188,
      "old_path": "Documentation/install-j2ee.txt",
      "new_id": "5ba8cb147f4be03cf4248fc77505f80e5ffc336c",
      "new_mode": 33188,
      "new_path": "Documentation/install-j2ee.txt"
    },
    {
      "type": "modify",
      "old_id": "8137f53773071f16da6104534440d05dc6c80df6",
      "old_mode": 33188,
      "old_path": "Documentation/install.txt",
      "new_id": "d80b197adde364bbf378b22eece51a63adadf5b0",
      "new_mode": 33188,
      "new_path": "Documentation/install.txt"
    },
    {
      "type": "modify",
      "old_id": "2a88694f556924a11736f7b4c89aa64f411a588a",
      "old_mode": 33188,
      "old_path": "gerrit-pgm/BUCK",
      "new_id": "38480bc276d7873a5744361d0b58fe76bda84aac",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/BUCK"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b830959154b1631edb7c8b3ebaaa840c9cee60e0",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/BaseInit.java"
    },
    {
      "type": "modify",
      "old_id": "ae1ab71b40d62cd16031290a0251eeff115a8430",
      "old_mode": 33188,
      "old_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java",
      "new_id": "1cab5152d2eb158fefb5a0265ff8af89388c917a",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java"
    },
    {
      "type": "modify",
      "old_id": "8b3d87ea8c61479ba3a2aad97fe0732b8ea417f5",
      "old_mode": 33188,
      "old_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitModule.java",
      "new_id": "94185eb98a931d74411a71920d840e1b431fa200",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitModule.java"
    },
    {
      "type": "modify",
      "old_id": "1c2d0245585b96dbd1fd501a4566b68bda932abb",
      "old_mode": 33188,
      "old_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java",
      "new_id": "71a4d86ce6db5555495658fe7495a0b46c36ca45",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java"
    },
    {
      "type": "modify",
      "old_id": "f4f0bd276c714d845520b8e4671b5830fd751650",
      "old_mode": 33188,
      "old_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java",
      "new_id": "11968db405b44019cbe593063d5d70a8ae369bb2",
      "new_mode": 33188,
      "new_path": "gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/SiteProgram.java"
    },
    {
      "type": "modify",
      "old_id": "03461b8a27b115a8eb8679890b9aaf83af1dfe3f",
      "old_mode": 33188,
      "old_path": "gerrit-war/BUCK",
      "new_id": "fa9a88f7e5fdd44264f8280cd782fab423ec31b7",
      "new_mode": 33188,
      "new_path": "gerrit-war/BUCK"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0948c46a086d884a657134be4e165847b292ba69",
      "new_mode": 33188,
      "new_path": "gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java"
    },
    {
      "type": "modify",
      "old_id": "3c70cf61e317455ab0c31119240b38411e5436a2",
      "old_mode": 33188,
      "old_path": "gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java",
      "new_id": "bccd0decb5a1b928341e425b444c0ad3d0cfe7df",
      "new_mode": 33188,
      "new_path": "gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java"
    }
  ]
}
