Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.6.9" /> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 7 | <title>gitweb(1)</title> |
| 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
| 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
| 37 | |
| 38 | em { |
| 39 | font-style: italic; |
| 40 | color: navy; |
| 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
| 45 | color: #083194; |
| 46 | } |
| 47 | |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
| 55 | h1, h2, h3 { |
| 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
| 59 | padding-top: 0.5em; |
| 60 | } |
| 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
| 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 89 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 97 | pre { |
| 98 | white-space: pre-wrap; |
| 99 | } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 100 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 101 | #author { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 102 | color: #527bbd; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 103 | font-weight: bold; |
| 104 | font-size: 1.1em; |
| 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #email { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 107 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 108 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 109 | } |
| 110 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 111 | #footer { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 112 | font-size: small; |
| 113 | border-top: 2px solid silver; |
| 114 | padding-top: 0.5em; |
| 115 | margin-top: 4.0em; |
| 116 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 117 | #footer-text { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 118 | float: left; |
| 119 | padding-bottom: 0.5em; |
| 120 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 121 | #footer-badges { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 122 | float: right; |
| 123 | padding-bottom: 0.5em; |
| 124 | } |
| 125 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 126 | #preamble { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 127 | margin-top: 1.5em; |
| 128 | margin-bottom: 1.5em; |
| 129 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 130 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 131 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 132 | div.admonitionblock { |
| 133 | margin-top: 1.0em; |
| 134 | margin-bottom: 1.5em; |
| 135 | } |
| 136 | div.admonitionblock { |
| 137 | margin-top: 2.0em; |
| 138 | margin-bottom: 2.0em; |
| 139 | margin-right: 10%; |
| 140 | color: #606060; |
| 141 | } |
| 142 | |
| 143 | div.content { /* Block element content. */ |
| 144 | padding: 0; |
| 145 | } |
| 146 | |
| 147 | /* Block element titles. */ |
| 148 | div.title, caption.title { |
| 149 | color: #527bbd; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 150 | font-weight: bold; |
| 151 | text-align: left; |
| 152 | margin-top: 1.0em; |
| 153 | margin-bottom: 0.5em; |
| 154 | } |
| 155 | div.title + * { |
| 156 | margin-top: 0; |
| 157 | } |
| 158 | |
| 159 | td div.title:first-child { |
| 160 | margin-top: 0.0em; |
| 161 | } |
| 162 | div.content div.title:first-child { |
| 163 | margin-top: 0.0em; |
| 164 | } |
| 165 | div.content + div.title { |
| 166 | margin-top: 0.0em; |
| 167 | } |
| 168 | |
| 169 | div.sidebarblock > div.content { |
| 170 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 171 | border: 1px solid #dddddd; |
| 172 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 173 | padding: 0.5em; |
| 174 | } |
| 175 | |
| 176 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 177 | border: 1px solid #dddddd; |
| 178 | border-left: 5px solid #f0f0f0; |
| 179 | background: #f8f8f8; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 180 | padding: 0.5em; |
| 181 | } |
| 182 | |
| 183 | div.quoteblock, div.verseblock { |
| 184 | padding-left: 1.0em; |
| 185 | margin-left: 1.0em; |
| 186 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 187 | border-left: 5px solid #f0f0f0; |
| 188 | color: #888; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | div.quoteblock > div.attribution { |
| 192 | padding-top: 0.5em; |
| 193 | text-align: right; |
| 194 | } |
| 195 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 196 | div.verseblock > pre.content { |
| 197 | font-family: inherit; |
| 198 | font-size: inherit; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 199 | } |
| 200 | div.verseblock > div.attribution { |
| 201 | padding-top: 0.75em; |
| 202 | text-align: left; |
| 203 | } |
| 204 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| 205 | div.verseblock + div.attribution { |
| 206 | text-align: left; |
| 207 | } |
| 208 | |
| 209 | div.admonitionblock .icon { |
| 210 | vertical-align: top; |
| 211 | font-size: 1.1em; |
| 212 | font-weight: bold; |
| 213 | text-decoration: underline; |
| 214 | color: #527bbd; |
| 215 | padding-right: 0.5em; |
| 216 | } |
| 217 | div.admonitionblock td.content { |
| 218 | padding-left: 0.5em; |
| 219 | border-left: 3px solid #dddddd; |
| 220 | } |
| 221 | |
| 222 | div.exampleblock > div.content { |
| 223 | border-left: 3px solid #dddddd; |
| 224 | padding-left: 0.5em; |
| 225 | } |
| 226 | |
| 227 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 228 | span.image img { border-style: none; vertical-align: text-bottom; } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 229 | a.image:visited { color: white; } |
| 230 | |
| 231 | dl { |
| 232 | margin-top: 0.8em; |
| 233 | margin-bottom: 0.8em; |
| 234 | } |
| 235 | dt { |
| 236 | margin-top: 0.5em; |
| 237 | margin-bottom: 0; |
| 238 | font-style: normal; |
| 239 | color: navy; |
| 240 | } |
| 241 | dd > *:first-child { |
| 242 | margin-top: 0.1em; |
| 243 | } |
| 244 | |
| 245 | ul, ol { |
| 246 | list-style-position: outside; |
| 247 | } |
| 248 | ol.arabic { |
| 249 | list-style-type: decimal; |
| 250 | } |
| 251 | ol.loweralpha { |
| 252 | list-style-type: lower-alpha; |
| 253 | } |
| 254 | ol.upperalpha { |
| 255 | list-style-type: upper-alpha; |
| 256 | } |
| 257 | ol.lowerroman { |
| 258 | list-style-type: lower-roman; |
| 259 | } |
| 260 | ol.upperroman { |
| 261 | list-style-type: upper-roman; |
| 262 | } |
| 263 | |
| 264 | div.compact ul, div.compact ol, |
| 265 | div.compact p, div.compact p, |
| 266 | div.compact div, div.compact div { |
| 267 | margin-top: 0.1em; |
| 268 | margin-bottom: 0.1em; |
| 269 | } |
| 270 | |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 271 | tfoot { |
| 272 | font-weight: bold; |
| 273 | } |
| 274 | td > div.verse { |
| 275 | white-space: pre; |
| 276 | } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 277 | |
| 278 | div.hdlist { |
| 279 | margin-top: 0.8em; |
| 280 | margin-bottom: 0.8em; |
| 281 | } |
| 282 | div.hdlist tr { |
| 283 | padding-bottom: 15px; |
| 284 | } |
| 285 | dt.hdlist1.strong, td.hdlist1.strong { |
| 286 | font-weight: bold; |
| 287 | } |
| 288 | td.hdlist1 { |
| 289 | vertical-align: top; |
| 290 | font-style: normal; |
| 291 | padding-right: 0.8em; |
| 292 | color: navy; |
| 293 | } |
| 294 | td.hdlist2 { |
| 295 | vertical-align: top; |
| 296 | } |
| 297 | div.hdlist.compact tr { |
| 298 | margin: 0; |
| 299 | padding-bottom: 0; |
| 300 | } |
| 301 | |
| 302 | .comment { |
| 303 | background: yellow; |
| 304 | } |
| 305 | |
| 306 | .footnote, .footnoteref { |
| 307 | font-size: 0.8em; |
| 308 | } |
| 309 | |
| 310 | span.footnote, span.footnoteref { |
| 311 | vertical-align: super; |
| 312 | } |
| 313 | |
| 314 | #footnotes { |
| 315 | margin: 20px 0 20px 0; |
| 316 | padding: 7px 0 0 0; |
| 317 | } |
| 318 | |
| 319 | #footnotes div.footnote { |
| 320 | margin: 0 0 5px 0; |
| 321 | } |
| 322 | |
| 323 | #footnotes hr { |
| 324 | border: none; |
| 325 | border-top: 1px solid silver; |
| 326 | height: 1px; |
| 327 | text-align: left; |
| 328 | margin-left: 0; |
| 329 | width: 20%; |
| 330 | min-width: 100px; |
| 331 | } |
| 332 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 333 | div.colist td { |
| 334 | padding-right: 0.5em; |
| 335 | padding-bottom: 0.3em; |
| 336 | vertical-align: top; |
| 337 | } |
| 338 | div.colist td img { |
| 339 | margin-top: 0.3em; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 340 | } |
| 341 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 342 | @media print { |
| 343 | #footer-badges { display: none; } |
| 344 | } |
| 345 | |
| 346 | #toc { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 347 | margin-bottom: 2.5em; |
| 348 | } |
| 349 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 350 | #toctitle { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 351 | color: #527bbd; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 352 | font-size: 1.1em; |
| 353 | font-weight: bold; |
| 354 | margin-top: 1.0em; |
| 355 | margin-bottom: 0.1em; |
| 356 | } |
| 357 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 358 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 359 | margin-top: 0; |
| 360 | margin-bottom: 0; |
| 361 | } |
| 362 | div.toclevel2 { |
| 363 | margin-left: 2em; |
| 364 | font-size: 0.9em; |
| 365 | } |
| 366 | div.toclevel3 { |
| 367 | margin-left: 4em; |
| 368 | font-size: 0.9em; |
| 369 | } |
| 370 | div.toclevel4 { |
| 371 | margin-left: 6em; |
| 372 | font-size: 0.9em; |
| 373 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 374 | |
| 375 | span.aqua { color: aqua; } |
| 376 | span.black { color: black; } |
| 377 | span.blue { color: blue; } |
| 378 | span.fuchsia { color: fuchsia; } |
| 379 | span.gray { color: gray; } |
| 380 | span.green { color: green; } |
| 381 | span.lime { color: lime; } |
| 382 | span.maroon { color: maroon; } |
| 383 | span.navy { color: navy; } |
| 384 | span.olive { color: olive; } |
| 385 | span.purple { color: purple; } |
| 386 | span.red { color: red; } |
| 387 | span.silver { color: silver; } |
| 388 | span.teal { color: teal; } |
| 389 | span.white { color: white; } |
| 390 | span.yellow { color: yellow; } |
| 391 | |
| 392 | span.aqua-background { background: aqua; } |
| 393 | span.black-background { background: black; } |
| 394 | span.blue-background { background: blue; } |
| 395 | span.fuchsia-background { background: fuchsia; } |
| 396 | span.gray-background { background: gray; } |
| 397 | span.green-background { background: green; } |
| 398 | span.lime-background { background: lime; } |
| 399 | span.maroon-background { background: maroon; } |
| 400 | span.navy-background { background: navy; } |
| 401 | span.olive-background { background: olive; } |
| 402 | span.purple-background { background: purple; } |
| 403 | span.red-background { background: red; } |
| 404 | span.silver-background { background: silver; } |
| 405 | span.teal-background { background: teal; } |
| 406 | span.white-background { background: white; } |
| 407 | span.yellow-background { background: yellow; } |
| 408 | |
| 409 | span.big { font-size: 2em; } |
| 410 | span.small { font-size: 0.6em; } |
| 411 | |
| 412 | span.underline { text-decoration: underline; } |
| 413 | span.overline { text-decoration: overline; } |
| 414 | span.line-through { text-decoration: line-through; } |
| 415 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 416 | div.unbreakable { page-break-inside: avoid; } |
| 417 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 418 | |
| 419 | /* |
| 420 | * xhtml11 specific |
| 421 | * |
| 422 | * */ |
| 423 | |
| 424 | div.tableblock { |
| 425 | margin-top: 1.0em; |
| 426 | margin-bottom: 1.5em; |
| 427 | } |
| 428 | div.tableblock > table { |
| 429 | border: 3px solid #527bbd; |
| 430 | } |
| 431 | thead, p.table.header { |
| 432 | font-weight: bold; |
| 433 | color: #527bbd; |
| 434 | } |
| 435 | p.table { |
| 436 | margin-top: 0; |
| 437 | } |
| 438 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 439 | div.tableblock > table[frame="void"] { |
| 440 | border-style: none; |
| 441 | } |
| 442 | div.tableblock > table[frame="hsides"] { |
| 443 | border-left-style: none; |
| 444 | border-right-style: none; |
| 445 | } |
| 446 | div.tableblock > table[frame="vsides"] { |
| 447 | border-top-style: none; |
| 448 | border-bottom-style: none; |
| 449 | } |
| 450 | |
| 451 | |
| 452 | /* |
| 453 | * html5 specific |
| 454 | * |
| 455 | * */ |
| 456 | |
| 457 | table.tableblock { |
| 458 | margin-top: 1.0em; |
| 459 | margin-bottom: 1.5em; |
| 460 | } |
| 461 | thead, p.tableblock.header { |
| 462 | font-weight: bold; |
| 463 | color: #527bbd; |
| 464 | } |
| 465 | p.tableblock { |
| 466 | margin-top: 0; |
| 467 | } |
| 468 | table.tableblock { |
| 469 | border-width: 3px; |
| 470 | border-spacing: 0px; |
| 471 | border-style: solid; |
| 472 | border-color: #527bbd; |
| 473 | border-collapse: collapse; |
| 474 | } |
| 475 | th.tableblock, td.tableblock { |
| 476 | border-width: 1px; |
| 477 | padding: 4px; |
| 478 | border-style: solid; |
| 479 | border-color: #527bbd; |
| 480 | } |
| 481 | |
| 482 | table.tableblock.frame-topbot { |
| 483 | border-left-style: hidden; |
| 484 | border-right-style: hidden; |
| 485 | } |
| 486 | table.tableblock.frame-sides { |
| 487 | border-top-style: hidden; |
| 488 | border-bottom-style: hidden; |
| 489 | } |
| 490 | table.tableblock.frame-none { |
| 491 | border-style: hidden; |
| 492 | } |
| 493 | |
| 494 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 495 | text-align: left; |
| 496 | } |
| 497 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 498 | text-align: center; |
| 499 | } |
| 500 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 501 | text-align: right; |
| 502 | } |
| 503 | |
| 504 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 505 | vertical-align: top; |
| 506 | } |
| 507 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 508 | vertical-align: middle; |
| 509 | } |
| 510 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 511 | vertical-align: bottom; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | /* |
| 516 | * manpage specific |
| 517 | * |
| 518 | * */ |
| 519 | |
| 520 | body.manpage h1 { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 521 | padding-top: 0.5em; |
| 522 | padding-bottom: 0.5em; |
| 523 | border-top: 2px solid silver; |
| 524 | border-bottom: 2px solid silver; |
| 525 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 526 | body.manpage h2 { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 527 | border-style: none; |
| 528 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 529 | body.manpage div.sectionbody { |
| 530 | margin-left: 3em; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 531 | } |
| 532 | |
| 533 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 534 | body.manpage div#toc { display: none; } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 535 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 536 | |
| 537 | |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 538 | </style> |
| 539 | <script type="text/javascript"> |
| 540 | /*<![CDATA[*/ |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 541 | var asciidoc = { // Namespace. |
| 542 | |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | // Table Of Contents generator |
| 545 | ///////////////////////////////////////////////////////////////////// |
| 546 | |
| 547 | /* Author: Mihai Bazon, September 2002 |
| 548 | * http://students.infoiasi.ro/~mishoo |
| 549 | * |
| 550 | * Table Of Content generator |
| 551 | * Version: 0.4 |
| 552 | * |
| 553 | * Feel free to use this script under the terms of the GNU General Public |
| 554 | * License, as long as you do not remove or alter this notice. |
| 555 | */ |
| 556 | |
| 557 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 558 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 559 | |
| 560 | // toclevels = 1..4. |
| 561 | toc: function (toclevels) { |
| 562 | |
| 563 | function getText(el) { |
| 564 | var text = ""; |
| 565 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 566 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 567 | text += i.data; |
| 568 | else if (i.firstChild != null) |
| 569 | text += getText(i); |
| 570 | } |
| 571 | return text; |
| 572 | } |
| 573 | |
| 574 | function TocEntry(el, text, toclevel) { |
| 575 | this.element = el; |
| 576 | this.text = text; |
| 577 | this.toclevel = toclevel; |
| 578 | } |
| 579 | |
| 580 | function tocEntries(el, toclevels) { |
| 581 | var result = new Array; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 582 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 583 | // Function that scans the DOM tree for header elements (the DOM2 |
| 584 | // nodeIterator API would be a better technique but not supported by all |
| 585 | // browsers). |
| 586 | var iterate = function (el) { |
| 587 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 588 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 589 | var mo = re.exec(i.tagName); |
| 590 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 591 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 592 | } |
| 593 | iterate(i); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | iterate(el); |
| 598 | return result; |
| 599 | } |
| 600 | |
| 601 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 602 | if (!toc) { |
| 603 | return; |
| 604 | } |
| 605 | |
| 606 | // Delete existing TOC entries in case we're reloading the TOC. |
| 607 | var tocEntriesToRemove = []; |
| 608 | var i; |
| 609 | for (i = 0; i < toc.childNodes.length; i++) { |
| 610 | var entry = toc.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 611 | if (entry.nodeName.toLowerCase() == 'div' |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 612 | && entry.getAttribute("class") |
| 613 | && entry.getAttribute("class").match(/^toclevel/)) |
| 614 | tocEntriesToRemove.push(entry); |
| 615 | } |
| 616 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 617 | toc.removeChild(tocEntriesToRemove[i]); |
| 618 | } |
| 619 | |
| 620 | // Rebuild TOC entries. |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 621 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 622 | for (var i = 0; i < entries.length; ++i) { |
| 623 | var entry = entries[i]; |
| 624 | if (entry.element.id == "") |
| 625 | entry.element.id = "_toc_" + i; |
| 626 | var a = document.createElement("a"); |
| 627 | a.href = "#" + entry.element.id; |
| 628 | a.appendChild(document.createTextNode(entry.text)); |
| 629 | var div = document.createElement("div"); |
| 630 | div.appendChild(a); |
| 631 | div.className = "toclevel" + entry.toclevel; |
| 632 | toc.appendChild(div); |
| 633 | } |
| 634 | if (entries.length == 0) |
| 635 | toc.parentNode.removeChild(toc); |
| 636 | }, |
| 637 | |
| 638 | |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | // Footnotes generator |
| 641 | ///////////////////////////////////////////////////////////////////// |
| 642 | |
| 643 | /* Based on footnote generation code from: |
| 644 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 645 | */ |
| 646 | |
| 647 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 648 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 649 | var i; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 650 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 651 | if (!noteholder) { |
| 652 | return; |
| 653 | } |
| 654 | var entriesToRemove = []; |
| 655 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 656 | var entry = noteholder.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 657 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 658 | entriesToRemove.push(entry); |
| 659 | } |
| 660 | for (i = 0; i < entriesToRemove.length; i++) { |
| 661 | noteholder.removeChild(entriesToRemove[i]); |
| 662 | } |
| 663 | |
| 664 | // Rebuild footnote entries. |
| 665 | var cont = document.getElementById("content"); |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 666 | var spans = cont.getElementsByTagName("span"); |
| 667 | var refs = {}; |
| 668 | var n = 0; |
| 669 | for (i=0; i<spans.length; i++) { |
| 670 | if (spans[i].className == "footnote") { |
| 671 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 672 | var note = spans[i].getAttribute("data-note"); |
| 673 | if (!note) { |
| 674 | // Use [\s\S] in place of . so multi-line matches work. |
| 675 | // Because JavaScript has no s (dotall) regex flag. |
| 676 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 677 | spans[i].innerHTML = |
| 678 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 679 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 680 | spans[i].setAttribute("data-note", note); |
| 681 | } |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 682 | noteholder.innerHTML += |
| 683 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 684 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 685 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 686 | var id =spans[i].getAttribute("id"); |
| 687 | if (id != null) refs["#"+id] = n; |
| 688 | } |
| 689 | } |
| 690 | if (n == 0) |
| 691 | noteholder.parentNode.removeChild(noteholder); |
| 692 | else { |
| 693 | // Process footnoterefs. |
| 694 | for (i=0; i<spans.length; i++) { |
| 695 | if (spans[i].className == "footnoteref") { |
| 696 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 697 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 698 | n = refs[href]; |
| 699 | spans[i].innerHTML = |
| 700 | "[<a href='#_footnote_" + n + |
| 701 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 702 | } |
| 703 | } |
| 704 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 705 | }, |
| 706 | |
| 707 | install: function(toclevels) { |
| 708 | var timerId; |
| 709 | |
| 710 | function reinstall() { |
| 711 | asciidoc.footnotes(); |
| 712 | if (toclevels) { |
| 713 | asciidoc.toc(toclevels); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | function reinstallAndRemoveTimer() { |
| 718 | clearInterval(timerId); |
| 719 | reinstall(); |
| 720 | } |
| 721 | |
| 722 | timerId = setInterval(reinstall, 500); |
| 723 | if (document.addEventListener) |
| 724 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 725 | else |
| 726 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 730 | asciidoc.install(); |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 731 | /*]]>*/ |
| 732 | </script> |
| 733 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 734 | <body class="manpage"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 735 | <div id="header"> |
| 736 | <h1> |
| 737 | gitweb(1) Manual Page |
| 738 | </h1> |
| 739 | <h2>NAME</h2> |
| 740 | <div class="sectionbody"> |
| 741 | <p>gitweb - |
| 742 | Git web interface (web frontend to Git repositories) |
| 743 | </p> |
| 744 | </div> |
| 745 | </div> |
| 746 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 747 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 748 | <h2 id="_synopsis">SYNOPSIS</h2> |
| 749 | <div class="sectionbody"> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 750 | <div class="paragraph"><p>To get started with gitweb, run <a href="git-instaweb.html">git-instaweb(1)</a> from a Git repository. |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 751 | This would configure and start your web server, and run web browser pointing to |
| 752 | gitweb.</p></div> |
| 753 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 754 | </div> |
| 755 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 756 | <h2 id="_description">DESCRIPTION</h2> |
| 757 | <div class="sectionbody"> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 758 | <div class="paragraph"><p>Gitweb provides a web interface to Git repositories. Its features include:</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 759 | <div class="ulist"><ul> |
| 760 | <li> |
| 761 | <p> |
| 762 | Viewing multiple Git repositories with common root. |
| 763 | </p> |
| 764 | </li> |
| 765 | <li> |
| 766 | <p> |
| 767 | Browsing every revision of the repository. |
| 768 | </p> |
| 769 | </li> |
| 770 | <li> |
| 771 | <p> |
| 772 | Viewing the contents of files in the repository at any revision. |
| 773 | </p> |
| 774 | </li> |
| 775 | <li> |
| 776 | <p> |
| 777 | Viewing the revision log of branches, history of files and directories, |
| 778 | see what was changed when, by who. |
| 779 | </p> |
| 780 | </li> |
| 781 | <li> |
| 782 | <p> |
| 783 | Viewing the blame/annotation details of any file (if enabled). |
| 784 | </p> |
| 785 | </li> |
| 786 | <li> |
| 787 | <p> |
| 788 | Generating RSS and Atom feeds of commits, for any branch. |
| 789 | The feeds are auto-discoverable in modern web browsers. |
| 790 | </p> |
| 791 | </li> |
| 792 | <li> |
| 793 | <p> |
| 794 | Viewing everything that was changed in a revision, and step through |
| 795 | revisions one at a time, viewing the history of the repository. |
| 796 | </p> |
| 797 | </li> |
| 798 | <li> |
| 799 | <p> |
| 800 | Finding commits which commit messages matches given search term. |
| 801 | </p> |
| 802 | </li> |
| 803 | </ul></div> |
| 804 | <div class="paragraph"><p>See <a href="http://git.kernel.org/?p=git/git.git;a=tree;f=gitweb">http://git.kernel.org/?p=git/git.git;a=tree;f=gitweb</a> or |
| 805 | <a href="http://repo.or.cz/w/git.git/tree/HEAD:/gitweb/">http://repo.or.cz/w/git.git/tree/HEAD:/gitweb/</a> for gitweb source code, |
| 806 | browsed using gitweb itself.</p></div> |
| 807 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 808 | </div> |
| 809 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 810 | <h2 id="_configuration">CONFIGURATION</h2> |
| 811 | <div class="sectionbody"> |
| 812 | <div class="paragraph"><p>Various aspects of gitweb’s behavior can be controlled through the configuration |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 813 | file <em>gitweb_config.perl</em> or <em>/etc/gitweb.conf</em>. See the <a href="gitweb.conf.html">gitweb.conf(5)</a> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 814 | for details.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 815 | <div class="sect2"> |
| 816 | <h3 id="_repositories">Repositories</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 817 | <div class="paragraph"><p>Gitweb can show information from one or more Git repositories. These |
| 818 | repositories have to be all on local filesystem, and have to share common |
| 819 | repository root, i.e. be all under a single parent repository (but see also |
| 820 | "Advanced web server setup" section, "Webserver configuration with multiple |
| 821 | projects' root" subsection).</p></div> |
| 822 | <div class="listingblock"> |
| 823 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 824 | <pre><code>our $projectroot = '/path/to/parent/directory';</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 825 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 826 | <div class="paragraph"><p>The default value for <code>$projectroot</code> is <em>/pub/git</em>. You can change it during |
| 827 | building gitweb via <code>GITWEB_PROJECTROOT</code> build configuration variable.</p></div> |
| 828 | <div class="paragraph"><p>By default all Git repositories under <code>$projectroot</code> are visible and available |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 829 | to gitweb. The list of projects is generated by default by scanning the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 830 | <code>$projectroot</code> directory for Git repositories (for object databases to be |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 831 | more exact; gitweb is not interested in a working area, and is best suited |
| 832 | to showing "bare" repositories).</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 833 | <div class="paragraph"><p>The name of the repository in gitweb is the path to its <code>$GIT_DIR</code> (its object |
| 834 | database) relative to <code>$projectroot</code>. Therefore the repository $repo can be |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 835 | found at "$projectroot/$repo".</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 836 | </div> |
| 837 | <div class="sect2"> |
| 838 | <h3 id="_projects_list_file_format">Projects list file format</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 839 | <div class="paragraph"><p>Instead of having gitweb find repositories by scanning filesystem |
| 840 | starting from $projectroot, you can provide a pre-generated list of |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 841 | visible projects by setting <code>$projects_list</code> to point to a plain text |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 842 | file with a list of projects (with some additional info).</p></div> |
| 843 | <div class="paragraph"><p>This file uses the following format:</p></div> |
| 844 | <div class="ulist"><ul> |
| 845 | <li> |
| 846 | <p> |
| 847 | One record (for project / repository) per line; does not support line |
| 848 | continuation (newline escaping). |
| 849 | </p> |
| 850 | </li> |
| 851 | <li> |
| 852 | <p> |
| 853 | Leading and trailing whitespace are ignored. |
| 854 | </p> |
| 855 | </li> |
| 856 | <li> |
| 857 | <p> |
| 858 | Whitespace separated fields; any run of whitespace can be used as field |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 859 | separator (rules for Perl’s "<code>split(" ", $line)</code>"). |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 860 | </p> |
| 861 | </li> |
| 862 | <li> |
| 863 | <p> |
| 864 | Fields use modified URI encoding, defined in RFC 3986, section 2.1 |
| 865 | (Percent-Encoding), or rather "Query string encoding" (see |
| 866 | <a href="http://en.wikipedia.org/wiki/Query_string#URL_encoding">http://en.wikipedia.org/wiki/Query_string#URL_encoding</a>), the difference |
| 867 | being that SP (" ") can be encoded as "+" (and therefore "+" has to be |
| 868 | also percent-encoded). |
| 869 | </p> |
| 870 | <div class="paragraph"><p>Reserved characters are: "%" (used for encoding), "+" (can be used to |
| 871 | encode SPACE), all whitespace characters as defined in Perl, including SP, |
| 872 | TAB and LF, (used to separate fields in a record).</p></div> |
| 873 | </li> |
| 874 | <li> |
| 875 | <p> |
| 876 | Currently recognized fields are: |
| 877 | </p> |
| 878 | <div class="dlist"><dl> |
| 879 | <dt class="hdlist1"> |
| 880 | <repository path> |
| 881 | </dt> |
| 882 | <dd> |
| 883 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 884 | path to repository GIT_DIR, relative to <code>$projectroot</code> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 885 | </p> |
| 886 | </dd> |
| 887 | <dt class="hdlist1"> |
| 888 | <repository owner> |
| 889 | </dt> |
| 890 | <dd> |
| 891 | <p> |
| 892 | displayed as repository owner, preferably full name, or email, |
| 893 | or both |
| 894 | </p> |
| 895 | </dd> |
| 896 | </dl></div> |
| 897 | </li> |
| 898 | </ul></div> |
| 899 | <div class="paragraph"><p>You can generate the projects list index file using the project_index action |
| 900 | (the <em>TXT</em> link on projects list page) directly from gitweb; see also |
| 901 | "Generating projects list using gitweb" section below.</p></div> |
| 902 | <div class="paragraph"><p>Example contents:</p></div> |
| 903 | <div class="listingblock"> |
| 904 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 905 | <pre><code>foo.git Joe+R+Hacker+<joe@example.com> |
| 906 | foo/bar.git O+W+Ner+<owner@example.org></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 907 | </div></div> |
| 908 | <div class="paragraph"><p>By default this file controls only which projects are <strong>visible</strong> on projects |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 909 | list page (note that entries that do not point to correctly recognized Git |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 910 | repositories won’t be displayed by gitweb). Even if a project is not |
| 911 | visible on projects list page, you can view it nevertheless by hand-crafting |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 912 | a gitweb URL. By setting <code>$strict_export</code> configuration variable (see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 913 | <a href="gitweb.conf.html">gitweb.conf(5)</a>) to true value you can allow viewing only of |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 914 | repositories also shown on the overview page (i.e. only projects explicitly |
| 915 | listed in projects list file will be accessible).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 916 | </div> |
| 917 | <div class="sect2"> |
| 918 | <h3 id="_generating_projects_list_using_gitweb">Generating projects list using gitweb</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 919 | <div class="paragraph"><p>We assume that GITWEB_CONFIG has its default Makefile value, namely |
| 920 | <em>gitweb_config.perl</em>. Put the following in <em>gitweb_make_index.perl</em> file:</p></div> |
| 921 | <div class="listingblock"> |
| 922 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 923 | <pre><code>read_config_file("gitweb_config.perl"); |
| 924 | $projects_list = $projectroot;</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 925 | </div></div> |
| 926 | <div class="paragraph"><p>Then create the following script to get list of project in the format |
| 927 | suitable for GITWEB_LIST build configuration variable (or |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 928 | <code>$projects_list</code> variable in gitweb config):</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 929 | <div class="listingblock"> |
| 930 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 931 | <pre><code>#!/bin/sh |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 932 | |
| 933 | export GITWEB_CONFIG="gitweb_make_index.perl" |
| 934 | export GATEWAY_INTERFACE="CGI/1.1" |
| 935 | export HTTP_ACCEPT="*/*" |
| 936 | export REQUEST_METHOD="GET" |
| 937 | export QUERY_STRING="a=project_index" |
| 938 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 939 | perl -- /var/www/cgi-bin/gitweb.cgi</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 940 | </div></div> |
| 941 | <div class="paragraph"><p>Run this script and save its output to a file. This file could then be used |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 942 | as projects list file, which means that you can set <code>$projects_list</code> to its |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 943 | filename.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 944 | </div> |
| 945 | <div class="sect2"> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 946 | <h3 id="_controlling_access_to_git_repositories">Controlling access to Git repositories</h3> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 947 | <div class="paragraph"><p>By default all Git repositories under <code>$projectroot</code> are visible and |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 948 | available to gitweb. You can however configure how gitweb controls access |
| 949 | to repositories.</p></div> |
| 950 | <div class="ulist"><ul> |
| 951 | <li> |
| 952 | <p> |
| 953 | As described in "Projects list file format" section, you can control which |
| 954 | projects are <strong>visible</strong> by selectively including repositories in projects |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 955 | list file, and setting <code>$projects_list</code> gitweb configuration variable to |
| 956 | point to it. With <code>$strict_export</code> set, projects list file can be used to |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 957 | control which repositories are <strong>available</strong> as well. |
| 958 | </p> |
| 959 | </li> |
| 960 | <li> |
| 961 | <p> |
| 962 | You can configure gitweb to only list and allow viewing of the explicitly |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 963 | exported repositories, via <code>$export_ok</code> variable in gitweb config file; see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 964 | <a href="gitweb.conf.html">gitweb.conf(5)</a> manpage. If it evaluates to true, gitweb shows |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 965 | repositories only if this file named by <code>$export_ok</code> exists in its object |
| 966 | database (if directory has the magic file named <code>$export_ok</code>). |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 967 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 968 | <div class="paragraph"><p>For example <a href="git-daemon.html">git-daemon(1)</a> by default (unless <code>--export-all</code> option |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 969 | is used) allows pulling only for those repositories that have |
| 970 | <em>git-daemon-export-ok</em> file. Adding</p></div> |
| 971 | <div class="listingblock"> |
| 972 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 973 | <pre><code>our $export_ok = "git-daemon-export-ok";</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 974 | </div></div> |
| 975 | <div class="paragraph"><p>makes gitweb show and allow access only to those repositories that can be |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 976 | fetched from via <code>git://</code> protocol.</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 977 | </li> |
| 978 | <li> |
| 979 | <p> |
| 980 | Finally, it is possible to specify an arbitrary perl subroutine that will |
| 981 | be called for each repository to determine if it can be exported. The |
| 982 | subroutine receives an absolute path to the project (repository) as its only |
| 983 | parameter (i.e. "$projectroot/$project"). |
| 984 | </p> |
| 985 | <div class="paragraph"><p>For example, if you use mod_perl to run the script, and have dumb |
| 986 | HTTP protocol authentication configured for your repositories, you |
| 987 | can use the following hook to allow access only if the user is |
| 988 | authorized to read the files:</p></div> |
| 989 | <div class="listingblock"> |
| 990 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 991 | <pre><code>$export_auth_hook = sub { |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 992 | use Apache2::SubRequest (); |
| 993 | use Apache2::Const -compile => qw(HTTP_OK); |
| 994 | my $path = "$_[0]/HEAD"; |
| 995 | my $r = Apache2::RequestUtil->request; |
| 996 | my $sub = $r->lookup_file($path); |
| 997 | return $sub->filename eq $path |
| 998 | && $sub->status == Apache2::Const::HTTP_OK; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 999 | };</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1000 | </div></div> |
| 1001 | </li> |
| 1002 | </ul></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1003 | </div> |
| 1004 | <div class="sect2"> |
| 1005 | <h3 id="_per_repository_gitweb_configuration">Per-repository gitweb configuration</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1006 | <div class="paragraph"><p>You can configure individual repositories shown in gitweb by creating file |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1007 | in the <em>GIT_DIR</em> of Git repository, or by setting some repo configuration |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1008 | variable (in <em>GIT_DIR/config</em>, see <a href="git-config.html">git-config(1)</a>).</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1009 | <div class="paragraph"><p>You can use the following files in repository:</p></div> |
| 1010 | <div class="dlist"><dl> |
| 1011 | <dt class="hdlist1"> |
| 1012 | README.html |
| 1013 | </dt> |
| 1014 | <dd> |
| 1015 | <p> |
| 1016 | A html file (HTML fragment) which is included on the gitweb project |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1017 | "summary" page inside <code><div></code> block element. You can use it for longer |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1018 | description of a project, to provide links (for example to project’s |
| 1019 | homepage), etc. This is recognized only if XSS prevention is off |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1020 | (<code>$prevent_xss</code> is false, see <a href="gitweb.conf.html">gitweb.conf(5)</a>); a way to include |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1021 | a README safely when XSS prevention is on may be worked out in the |
| 1022 | future. |
| 1023 | </p> |
| 1024 | </dd> |
| 1025 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1026 | description (or <code>gitweb.description</code>) |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1027 | </dt> |
| 1028 | <dd> |
| 1029 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1030 | Short (shortened to <code>$projects_list_description_width</code> in the projects |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1031 | list page, which is 25 characters by default; see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1032 | <a href="gitweb.conf.html">gitweb.conf(5)</a>) single line description of a project (of a |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1033 | repository). Plain text file; HTML will be escaped. By default set to |
| 1034 | </p> |
| 1035 | <div class="listingblock"> |
| 1036 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1037 | <pre><code>Unnamed repository; edit this file to name it for gitweb.</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1038 | </div></div> |
| 1039 | <div class="paragraph"><p>from the template during repository creation, usually installed in |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1040 | <em>/usr/share/git-core/templates/</em>. You can use the <code>gitweb.description</code> repo |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1041 | configuration variable, but the file takes precedence.</p></div> |
| 1042 | </dd> |
| 1043 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1044 | category (or <code>gitweb.category</code>) |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1045 | </dt> |
| 1046 | <dd> |
| 1047 | <p> |
| 1048 | Singe line category of a project, used to group projects if |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1049 | <code>$projects_list_group_categories</code> is enabled. By default (file and |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1050 | configuration variable absent), uncategorized projects are put in the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1051 | <code>$project_list_default_category</code> category. You can use the |
| 1052 | <code>gitweb.category</code> repo configuration variable, but the file takes |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1053 | precedence. |
| 1054 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1055 | <div class="paragraph"><p>The configuration variables <code>$projects_list_group_categories</code> and |
| 1056 | <code>$project_list_default_category</code> are described in <a href="gitweb.conf.html">gitweb.conf(5)</a></p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1057 | </dd> |
| 1058 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1059 | cloneurl (or multiple-valued <code>gitweb.url</code>) |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1060 | </dt> |
| 1061 | <dd> |
| 1062 | <p> |
| 1063 | File with repository URL (used for clone and fetch), one per line. |
| 1064 | Displayed in the project summary page. You can use multiple-valued |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1065 | <code>gitweb.url</code> repository configuration variable for that, but the file |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1066 | takes precedence. |
| 1067 | </p> |
| 1068 | <div class="paragraph"><p>This is per-repository enhancement / version of global prefix-based |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1069 | <code>@git_base_url_list</code> gitweb configuration variable (see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1070 | <a href="gitweb.conf.html">gitweb.conf(5)</a>).</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1071 | </dd> |
| 1072 | <dt class="hdlist1"> |
| 1073 | gitweb.owner |
| 1074 | </dt> |
| 1075 | <dd> |
| 1076 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1077 | You can use the <code>gitweb.owner</code> repository configuration variable to set |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1078 | repository’s owner. It is displayed in the project list and summary |
| 1079 | page. |
| 1080 | </p> |
| 1081 | <div class="paragraph"><p>If it’s not set, filesystem directory’s owner is used (via GECOS field, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1082 | i.e. real name field from <strong>getpwuid</strong>(3)) if <code>$projects_list</code> is unset |
| 1083 | (gitweb scans <code>$projectroot</code> for repositories); if <code>$projects_list</code> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1084 | points to file with list of repositories, then project owner defaults to |
| 1085 | value from this file for given repository.</p></div> |
| 1086 | </dd> |
| 1087 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1088 | various <code>gitweb.*</code> config variables (in config) |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1092 | Read description of <code>%feature</code> hash for detailed list, and descriptions. |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1093 | See also "Configuring gitweb features" section in <a href="gitweb.conf.html">gitweb.conf(5)</a> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1094 | </p> |
| 1095 | </dd> |
| 1096 | </dl></div> |
| 1097 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1098 | </div> |
| 1099 | </div> |
| 1100 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1101 | <h2 id="_actions_and_urls">ACTIONS, AND URLS</h2> |
| 1102 | <div class="sectionbody"> |
| 1103 | <div class="paragraph"><p>Gitweb can use path_info (component) based URLs, or it can pass all necessary |
| 1104 | information via query parameters. The typical gitweb URLs are broken down in to |
| 1105 | five components:</p></div> |
| 1106 | <div class="listingblock"> |
| 1107 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1108 | <pre><code>.../gitweb.cgi/<repo>/<action>/<revision>:/<path>?<arguments></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1109 | </div></div> |
| 1110 | <div class="dlist"><dl> |
| 1111 | <dt class="hdlist1"> |
| 1112 | repo |
| 1113 | </dt> |
| 1114 | <dd> |
| 1115 | <p> |
| 1116 | The repository the action will be performed on. |
| 1117 | </p> |
| 1118 | <div class="paragraph"><p>All actions except for those that list all available projects, |
| 1119 | in whatever form, require this parameter.</p></div> |
| 1120 | </dd> |
| 1121 | <dt class="hdlist1"> |
| 1122 | action |
| 1123 | </dt> |
| 1124 | <dd> |
| 1125 | <p> |
| 1126 | The action that will be run. Defaults to <em>projects_list</em> if repo |
| 1127 | is not set, and to <em>summary</em> otherwise. |
| 1128 | </p> |
| 1129 | </dd> |
| 1130 | <dt class="hdlist1"> |
| 1131 | revision |
| 1132 | </dt> |
| 1133 | <dd> |
| 1134 | <p> |
| 1135 | Revision shown. Defaults to HEAD. |
| 1136 | </p> |
| 1137 | </dd> |
| 1138 | <dt class="hdlist1"> |
| 1139 | path |
| 1140 | </dt> |
| 1141 | <dd> |
| 1142 | <p> |
| 1143 | The path within the <repository> that the action is performed on, |
| 1144 | for those actions that require it. |
| 1145 | </p> |
| 1146 | </dd> |
| 1147 | <dt class="hdlist1"> |
| 1148 | arguments |
| 1149 | </dt> |
| 1150 | <dd> |
| 1151 | <p> |
| 1152 | Any arguments that control the behaviour of the action. |
| 1153 | </p> |
| 1154 | </dd> |
| 1155 | </dl></div> |
| 1156 | <div class="paragraph"><p>Some actions require or allow to specify two revisions, and sometimes even two |
| 1157 | pathnames. In most general form such path_info (component) based gitweb URL |
| 1158 | looks like this:</p></div> |
| 1159 | <div class="listingblock"> |
| 1160 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1161 | <pre><code>.../gitweb.cgi/<repo>/<action>/<revision_from>:/<path_from>..<revision_to>:/<path_to>?<arguments></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1162 | </div></div> |
| 1163 | <div class="paragraph"><p>Each action is implemented as a subroutine, and must be present in %actions |
| 1164 | hash. Some actions are disabled by default, and must be turned on via feature |
| 1165 | mechanism. For example to enable <em>blame</em> view add the following to gitweb |
| 1166 | configuration file:</p></div> |
| 1167 | <div class="listingblock"> |
| 1168 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1169 | <pre><code>$feature{'blame'}{'default'} = [1];</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1170 | </div></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1171 | <div class="sect2"> |
| 1172 | <h3 id="_actions">Actions:</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1173 | <div class="paragraph"><p>The standard actions are:</p></div> |
| 1174 | <div class="dlist"><dl> |
| 1175 | <dt class="hdlist1"> |
| 1176 | project_list |
| 1177 | </dt> |
| 1178 | <dd> |
| 1179 | <p> |
| 1180 | Lists the available Git repositories. This is the default command if no |
| 1181 | repository is specified in the URL. |
| 1182 | </p> |
| 1183 | </dd> |
| 1184 | <dt class="hdlist1"> |
| 1185 | summary |
| 1186 | </dt> |
| 1187 | <dd> |
| 1188 | <p> |
| 1189 | Displays summary about given repository. This is the default command if |
| 1190 | no action is specified in URL, and only repository is specified. |
| 1191 | </p> |
| 1192 | </dd> |
| 1193 | <dt class="hdlist1"> |
| 1194 | heads |
| 1195 | </dt> |
| 1196 | <dt class="hdlist1"> |
| 1197 | remotes |
| 1198 | </dt> |
| 1199 | <dd> |
| 1200 | <p> |
| 1201 | Lists all local or all remote-tracking branches in given repository. |
| 1202 | </p> |
| 1203 | <div class="paragraph"><p>The latter is not available by default, unless configured.</p></div> |
| 1204 | </dd> |
| 1205 | <dt class="hdlist1"> |
| 1206 | tags |
| 1207 | </dt> |
| 1208 | <dd> |
| 1209 | <p> |
| 1210 | List all tags (lightweight and annotated) in given repository. |
| 1211 | </p> |
| 1212 | </dd> |
| 1213 | <dt class="hdlist1"> |
| 1214 | blob |
| 1215 | </dt> |
| 1216 | <dt class="hdlist1"> |
| 1217 | tree |
| 1218 | </dt> |
| 1219 | <dd> |
| 1220 | <p> |
| 1221 | Shows the files and directories in a given repository path, at given |
| 1222 | revision. This is default command if no action is specified in the URL, |
| 1223 | and path is given. |
| 1224 | </p> |
| 1225 | </dd> |
| 1226 | <dt class="hdlist1"> |
| 1227 | blob_plain |
| 1228 | </dt> |
| 1229 | <dd> |
| 1230 | <p> |
| 1231 | Returns the raw data for the file in given repository, at given path and |
| 1232 | revision. Links to this action are marked <em>raw</em>. |
| 1233 | </p> |
| 1234 | </dd> |
| 1235 | <dt class="hdlist1"> |
| 1236 | blobdiff |
| 1237 | </dt> |
| 1238 | <dd> |
| 1239 | <p> |
| 1240 | Shows the difference between two revisions of the same file. |
| 1241 | </p> |
| 1242 | </dd> |
| 1243 | <dt class="hdlist1"> |
| 1244 | blame |
| 1245 | </dt> |
| 1246 | <dt class="hdlist1"> |
| 1247 | blame_incremental |
| 1248 | </dt> |
| 1249 | <dd> |
| 1250 | <p> |
| 1251 | Shows the blame (also called annotation) information for a file. On a |
| 1252 | per line basis it shows the revision in which that line was last changed |
| 1253 | and the user that committed the change. The incremental version (which |
| 1254 | if configured is used automatically when JavaScript is enabled) uses |
| 1255 | Ajax to incrementally add blame info to the contents of given file. |
| 1256 | </p> |
| 1257 | <div class="paragraph"><p>This action is disabled by default for performance reasons.</p></div> |
| 1258 | </dd> |
| 1259 | <dt class="hdlist1"> |
| 1260 | commit |
| 1261 | </dt> |
| 1262 | <dt class="hdlist1"> |
| 1263 | commitdiff |
| 1264 | </dt> |
| 1265 | <dd> |
| 1266 | <p> |
| 1267 | Shows information about a specific commit in a repository. The <em>commit</em> |
| 1268 | view shows information about commit in more detail, the <em>commitdiff</em> |
| 1269 | action shows changeset for given commit. |
| 1270 | </p> |
| 1271 | </dd> |
| 1272 | <dt class="hdlist1"> |
| 1273 | patch |
| 1274 | </dt> |
| 1275 | <dd> |
| 1276 | <p> |
| 1277 | Returns the commit in plain text mail format, suitable for applying with |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1278 | <a href="git-am.html">git-am(1)</a>. |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1279 | </p> |
| 1280 | </dd> |
| 1281 | <dt class="hdlist1"> |
| 1282 | tag |
| 1283 | </dt> |
| 1284 | <dd> |
| 1285 | <p> |
| 1286 | Display specific annotated tag (tag object). |
| 1287 | </p> |
| 1288 | </dd> |
| 1289 | <dt class="hdlist1"> |
| 1290 | log |
| 1291 | </dt> |
| 1292 | <dt class="hdlist1"> |
| 1293 | shortlog |
| 1294 | </dt> |
| 1295 | <dd> |
| 1296 | <p> |
| 1297 | Shows log information (commit message or just commit subject) for a |
| 1298 | given branch (starting from given revision). |
| 1299 | </p> |
| 1300 | <div class="paragraph"><p>The <em>shortlog</em> view is more compact; it shows one commit per line.</p></div> |
| 1301 | </dd> |
| 1302 | <dt class="hdlist1"> |
| 1303 | history |
| 1304 | </dt> |
| 1305 | <dd> |
| 1306 | <p> |
| 1307 | Shows history of the file or directory in a given repository path, |
| 1308 | starting from given revision (defaults to HEAD, i.e. default branch). |
| 1309 | </p> |
| 1310 | <div class="paragraph"><p>This view is similar to <em>shortlog</em> view.</p></div> |
| 1311 | </dd> |
| 1312 | <dt class="hdlist1"> |
| 1313 | rss |
| 1314 | </dt> |
| 1315 | <dt class="hdlist1"> |
| 1316 | atom |
| 1317 | </dt> |
| 1318 | <dd> |
| 1319 | <p> |
| 1320 | Generates an RSS (or Atom) feed of changes to repository. |
| 1321 | </p> |
| 1322 | </dd> |
| 1323 | </dl></div> |
| 1324 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1325 | </div> |
| 1326 | </div> |
| 1327 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1328 | <h2 id="_webserver_configuration">WEBSERVER CONFIGURATION</h2> |
| 1329 | <div class="sectionbody"> |
| 1330 | <div class="paragraph"><p>This section explains how to configure some common webservers to run gitweb. In |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1331 | all cases, <code>/path/to/gitweb</code> in the examples is the directory you ran installed |
| 1332 | gitweb in, and contains <code>gitweb_config.perl</code>.</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1333 | <div class="paragraph"><p>If you’ve configured a web server that isn’t listed here for gitweb, please send |
| 1334 | in the instructions so they can be included in a future release.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1335 | <div class="sect2"> |
| 1336 | <h3 id="_apache_as_cgi">Apache as CGI</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1337 | <div class="paragraph"><p>Apache must be configured to support CGI scripts in the directory in |
| 1338 | which gitweb is installed. Let’s assume that it is <em>/var/www/cgi-bin</em> |
| 1339 | directory.</p></div> |
| 1340 | <div class="listingblock"> |
| 1341 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1342 | <pre><code>ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1343 | |
| 1344 | <Directory "/var/www/cgi-bin"> |
| 1345 | Options Indexes FollowSymlinks ExecCGI |
| 1346 | AllowOverride None |
| 1347 | Order allow,deny |
| 1348 | Allow from all |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1349 | </Directory></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1350 | </div></div> |
| 1351 | <div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div> |
| 1352 | <div class="literalblock"> |
| 1353 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1354 | <pre><code>http://server/cgi-bin/gitweb.cgi</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1355 | </div></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1356 | </div> |
| 1357 | <div class="sect2"> |
| 1358 | <h3 id="_apache_with_mod_perl_via_modperl_registry">Apache with mod_perl, via ModPerl::Registry</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1359 | <div class="paragraph"><p>You can use mod_perl with gitweb. You must install Apache::Registry |
| 1360 | (for mod_perl 1.x) or ModPerl::Registry (for mod_perl 2.x) to enable |
| 1361 | this support.</p></div> |
| 1362 | <div class="paragraph"><p>Assuming that gitweb is installed to <em>/var/www/perl</em>, the following |
| 1363 | Apache configuration (for mod_perl 2.x) is suitable.</p></div> |
| 1364 | <div class="listingblock"> |
| 1365 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1366 | <pre><code>Alias /perl "/var/www/perl" |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1367 | |
| 1368 | <Directory "/var/www/perl"> |
| 1369 | SetHandler perl-script |
| 1370 | PerlResponseHandler ModPerl::Registry |
| 1371 | PerlOptions +ParseHeaders |
| 1372 | Options Indexes FollowSymlinks +ExecCGI |
| 1373 | AllowOverride None |
| 1374 | Order allow,deny |
| 1375 | Allow from all |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1376 | </Directory></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1377 | </div></div> |
| 1378 | <div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div> |
| 1379 | <div class="literalblock"> |
| 1380 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1381 | <pre><code>http://server/perl/gitweb.cgi</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1382 | </div></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1383 | </div> |
| 1384 | <div class="sect2"> |
| 1385 | <h3 id="_apache_with_fastcgi">Apache with FastCGI</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1386 | <div class="paragraph"><p>Gitweb works with Apache and FastCGI. First you need to rename, copy |
| 1387 | or symlink gitweb.cgi to gitweb.fcgi. Let’s assume that gitweb is |
| 1388 | installed in <em>/usr/share/gitweb</em> directory. The following Apache |
| 1389 | configuration is suitable (UNTESTED!)</p></div> |
| 1390 | <div class="listingblock"> |
| 1391 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1392 | <pre><code>FastCgiServer /usr/share/gitweb/gitweb.cgi |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1393 | ScriptAlias /gitweb /usr/share/gitweb/gitweb.cgi |
| 1394 | |
| 1395 | Alias /gitweb/static /usr/share/gitweb/static |
| 1396 | <Directory /usr/share/gitweb/static> |
| 1397 | SetHandler default-handler |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1398 | </Directory></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1399 | </div></div> |
| 1400 | <div class="paragraph"><p>With that configuration the full path to browse repositories would be:</p></div> |
| 1401 | <div class="literalblock"> |
| 1402 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1403 | <pre><code>http://server/gitweb</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1404 | </div></div> |
| 1405 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1406 | </div> |
| 1407 | </div> |
| 1408 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1409 | <h2 id="_advanced_web_server_setup">ADVANCED WEB SERVER SETUP</h2> |
| 1410 | <div class="sectionbody"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1411 | <div class="paragraph"><p>All of those examples use request rewriting, and need <code>mod_rewrite</code> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1412 | (or equivalent; examples below are written for Apache).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1413 | <div class="sect2"> |
| 1414 | <h3 id="_single_url_for_gitweb_and_for_fetching">Single URL for gitweb and for fetching</h3> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1415 | <div class="paragraph"><p>If you want to have one URL for both gitweb and your <code>http://</code> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1416 | repositories, you can configure Apache like this:</p></div> |
| 1417 | <div class="listingblock"> |
| 1418 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1419 | <pre><code><VirtualHost *:80> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1420 | ServerName git.example.org |
| 1421 | DocumentRoot /pub/git |
| 1422 | SetEnv GITWEB_CONFIG /etc/gitweb.conf |
| 1423 | |
| 1424 | # turning on mod rewrite |
| 1425 | RewriteEngine on |
| 1426 | |
| 1427 | # make the front page an internal rewrite to the gitweb script |
| 1428 | RewriteRule ^/$ /cgi-bin/gitweb.cgi |
| 1429 | |
| 1430 | # make access for "dumb clients" work |
| 1431 | RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \ |
| 1432 | /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT] |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1433 | </VirtualHost></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1434 | </div></div> |
| 1435 | <div class="paragraph"><p>The above configuration expects your public repositories to live under |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1436 | <em>/pub/git</em> and will serve them as <code>http://git.domain.org/dir-under-pub-git</code>, |
Junio C Hamano | d7fccbf | 2013-07-25 03:24:57 | [diff] [blame] | 1437 | both as clonable Git URL and as browseable gitweb interface. If you then |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1438 | start your <a href="git-daemon.html">git-daemon(1)</a> with <code>--base-path=/pub/git --export-all</code> |
| 1439 | then you can even use the <code>git://</code> URL with exactly the same path.</p></div> |
| 1440 | <div class="paragraph"><p>Setting the environment variable <code>GITWEB_CONFIG</code> will tell gitweb to use the |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1441 | named file (i.e. in this example <em>/etc/gitweb.conf</em>) as a configuration for |
| 1442 | gitweb. You don’t really need it in above example; it is required only if |
| 1443 | your configuration file is in different place than built-in (during |
| 1444 | compiling gitweb) <em>gitweb_config.perl</em> or <em>/etc/gitweb.conf</em>. See |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1445 | <a href="gitweb.conf.html">gitweb.conf(5)</a> for details, especially information about precedence |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1446 | rules.</p></div> |
| 1447 | <div class="paragraph"><p>If you use the rewrite rules from the example you <strong>might</strong> also need |
| 1448 | something like the following in your gitweb configuration file |
| 1449 | (<em>/etc/gitweb.conf</em> following example):</p></div> |
| 1450 | <div class="listingblock"> |
| 1451 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1452 | <pre><code>@stylesheets = ("/some/absolute/path/gitweb.css"); |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1453 | $my_uri = "/"; |
| 1454 | $home_link = "/"; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1455 | $per_request_config = 1;</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1456 | </div></div> |
| 1457 | <div class="paragraph"><p>Nowadays though gitweb should create HTML base tag when needed (to set base |
| 1458 | URI for relative links), so it should work automatically.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1459 | </div> |
| 1460 | <div class="sect2"> |
| 1461 | <h3 id="_webserver_configuration_with_multiple_projects_root">Webserver configuration with multiple projects' root</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1462 | <div class="paragraph"><p>If you want to use gitweb with several project roots you can edit your |
| 1463 | Apache virtual host and gitweb configuration files in the following way.</p></div> |
| 1464 | <div class="paragraph"><p>The virtual host configuration (in Apache configuration file) should look |
| 1465 | like this:</p></div> |
| 1466 | <div class="listingblock"> |
| 1467 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1468 | <pre><code><VirtualHost *:80> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1469 | ServerName git.example.org |
| 1470 | DocumentRoot /pub/git |
| 1471 | SetEnv GITWEB_CONFIG /etc/gitweb.conf |
| 1472 | |
| 1473 | # turning on mod rewrite |
| 1474 | RewriteEngine on |
| 1475 | |
| 1476 | # make the front page an internal rewrite to the gitweb script |
| 1477 | RewriteRule ^/$ /cgi-bin/gitweb.cgi [QSA,L,PT] |
| 1478 | |
| 1479 | # look for a public_git folder in unix users' home |
| 1480 | # http://git.example.org/~<user>/ |
| 1481 | RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \ |
| 1482 | [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT] |
| 1483 | |
| 1484 | # http://git.example.org/+<user>/ |
| 1485 | #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \ |
| 1486 | [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT] |
| 1487 | |
| 1488 | # http://git.example.org/user/<user>/ |
| 1489 | #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$ /cgi-bin/gitweb.cgi \ |
| 1490 | [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT] |
| 1491 | |
| 1492 | # defined list of project roots |
| 1493 | RewriteRule ^/scm(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \ |
| 1494 | [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT] |
| 1495 | RewriteRule ^/var(/|/gitweb.cgi)?$ /cgi-bin/gitweb.cgi \ |
| 1496 | [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT] |
| 1497 | |
| 1498 | # make access for "dumb clients" work |
| 1499 | RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \ |
| 1500 | /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT] |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1501 | </VirtualHost></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1502 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1503 | <div class="paragraph"><p>Here actual project root is passed to gitweb via <code>GITWEB_PROJECT_ROOT</code> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1504 | environment variable from a web server, so you need to put the following |
| 1505 | line in gitweb configuration file (<em>/etc/gitweb.conf</em> in above example):</p></div> |
| 1506 | <div class="listingblock"> |
| 1507 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1508 | <pre><code>$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1509 | </div></div> |
| 1510 | <div class="paragraph"><p><strong>Note</strong> that this requires to be set for each request, so either |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1511 | <code>$per_request_config</code> must be false, or the above must be put in code |
| 1512 | referenced by <code>$per_request_config</code>;</p></div> |
| 1513 | <div class="paragraph"><p>These configurations enable two things. First, each unix user (<code><user></code>) of |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1514 | the server will be able to browse through gitweb Git repositories found in |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1515 | <em>~/public_git/</em> with the following url:</p></div> |
| 1516 | <div class="literalblock"> |
| 1517 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1518 | <pre><code>http://git.example.org/~<user>/</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1519 | </div></div> |
| 1520 | <div class="paragraph"><p>If you do not want this feature on your server just remove the second |
| 1521 | rewrite rule.</p></div> |
| 1522 | <div class="paragraph"><p>If you already use ‘mod_userdir` in your virtual host or you don’t want to |
| 1523 | use the '~’ as first character, just comment or remove the second rewrite |
| 1524 | rule, and uncomment one of the following according to what you want.</p></div> |
| 1525 | <div class="paragraph"><p>Second, repositories found in <em>/pub/scm/</em> and <em>/var/git/</em> will be accessible |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1526 | through <code>http://git.example.org/scm/</code> and <code>http://git.example.org/var/</code>. |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1527 | You can add as many project roots as you want by adding rewrite rules like |
| 1528 | the third and the fourth.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1529 | </div> |
| 1530 | <div class="sect2"> |
| 1531 | <h3 id="_path_info_usage">PATH_INFO usage</h3> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1532 | <div class="paragraph"><p>If you enable PATH_INFO usage in gitweb by putting</p></div> |
| 1533 | <div class="listingblock"> |
| 1534 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1535 | <pre><code>$feature{'pathinfo'}{'default'} = [1];</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1536 | </div></div> |
| 1537 | <div class="paragraph"><p>in your gitweb configuration file, it is possible to set up your server so |
| 1538 | that it consumes and produces URLs in the form</p></div> |
| 1539 | <div class="literalblock"> |
| 1540 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1541 | <pre><code>http://git.example.com/project.git/shortlog/sometag</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1542 | </div></div> |
| 1543 | <div class="paragraph"><p>i.e. without <em>gitweb.cgi</em> part, by using a configuration such as the |
| 1544 | following. This configuration assumes that <em>/var/www/gitweb</em> is the |
| 1545 | DocumentRoot of your webserver, contains the gitweb.cgi script and |
| 1546 | complementary static files (stylesheet, favicon, JavaScript):</p></div> |
| 1547 | <div class="listingblock"> |
| 1548 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1549 | <pre><code><VirtualHost *:80> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1550 | ServerAlias git.example.com |
| 1551 | |
| 1552 | DocumentRoot /var/www/gitweb |
| 1553 | |
| 1554 | <Directory /var/www/gitweb> |
| 1555 | Options ExecCGI |
| 1556 | AddHandler cgi-script cgi |
| 1557 | |
| 1558 | DirectoryIndex gitweb.cgi |
| 1559 | |
| 1560 | RewriteEngine On |
| 1561 | RewriteCond %{REQUEST_FILENAME} !-f |
| 1562 | RewriteCond %{REQUEST_FILENAME} !-d |
| 1563 | RewriteRule ^.* /gitweb.cgi/$0 [L,PT] |
| 1564 | </Directory> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1565 | </VirtualHost></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1566 | </div></div> |
| 1567 | <div class="paragraph"><p>The rewrite rule guarantees that existing static files will be properly |
| 1568 | served, whereas any other URL will be passed to gitweb as PATH_INFO |
| 1569 | parameter.</p></div> |
| 1570 | <div class="paragraph"><p><strong>Notice</strong> that in this case you don’t need special settings for |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1571 | <code>@stylesheets</code>, <code>$my_uri</code> and <code>$home_link</code>, but you lose "dumb client" |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1572 | access to your project .git dirs (described in "Single URL for gitweb and |
| 1573 | for fetching" section). A possible workaround for the latter is the |
| 1574 | following: in your project root dir (e.g. <em>/pub/git</em>) have the projects |
| 1575 | named <strong>without</strong> a .git extension (e.g. <em>/pub/git/project</em> instead of |
| 1576 | <em>/pub/git/project.git</em>) and configure Apache as follows:</p></div> |
| 1577 | <div class="listingblock"> |
| 1578 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1579 | <pre><code><VirtualHost *:80> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1580 | ServerAlias git.example.com |
| 1581 | |
| 1582 | DocumentRoot /var/www/gitweb |
| 1583 | |
| 1584 | AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$1$3 |
| 1585 | <Directory /var/www/gitweb> |
| 1586 | Options ExecCGI |
| 1587 | AddHandler cgi-script cgi |
| 1588 | |
| 1589 | DirectoryIndex gitweb.cgi |
| 1590 | |
| 1591 | RewriteEngine On |
| 1592 | RewriteCond %{REQUEST_FILENAME} !-f |
| 1593 | RewriteCond %{REQUEST_FILENAME} !-d |
| 1594 | RewriteRule ^.* /gitweb.cgi/$0 [L,PT] |
| 1595 | </Directory> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1596 | </VirtualHost></code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1597 | </div></div> |
| 1598 | <div class="paragraph"><p>The additional AliasMatch makes it so that</p></div> |
| 1599 | <div class="literalblock"> |
| 1600 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1601 | <pre><code>http://git.example.com/project.git</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1602 | </div></div> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1603 | <div class="paragraph"><p>will give raw access to the project’s Git dir (so that the project can be |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1604 | cloned), while</p></div> |
| 1605 | <div class="literalblock"> |
| 1606 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1607 | <pre><code>http://git.example.com/project</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1608 | </div></div> |
| 1609 | <div class="paragraph"><p>will provide human-friendly gitweb access.</p></div> |
| 1610 | <div class="paragraph"><p>This solution is not 100% bulletproof, in the sense that if some project has |
| 1611 | a named ref (branch, tag) starting with <em>git/</em>, then paths such as</p></div> |
| 1612 | <div class="literalblock"> |
| 1613 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1614 | <pre><code>http://git.example.com/project/command/abranch..git/abranch</code></pre> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1615 | </div></div> |
| 1616 | <div class="paragraph"><p>will fail with a 404 error.</p></div> |
| 1617 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1618 | </div> |
| 1619 | </div> |
| 1620 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1621 | <h2 id="_bugs">BUGS</h2> |
| 1622 | <div class="sectionbody"> |
| 1623 | <div class="paragraph"><p>Please report any bugs or feature requests to <a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>, |
| 1624 | putting "gitweb" in the subject of email.</p></div> |
| 1625 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1626 | </div> |
| 1627 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1628 | <h2 id="_see_also">SEE ALSO</h2> |
| 1629 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1630 | <div class="paragraph"><p><a href="gitweb.conf.html">gitweb.conf(5)</a>, <a href="git-instaweb.html">git-instaweb(1)</a></p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1631 | <div class="paragraph"><p><em>gitweb/README</em>, <em>gitweb/INSTALL</em></p></div> |
| 1632 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1633 | </div> |
| 1634 | <div class="sect1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1635 | <h2 id="_git">GIT</h2> |
| 1636 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1637 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1638 | </div> |
| 1639 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1640 | </div> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1641 | <div id="footnotes"><hr /></div> |
| 1642 | <div id="footer"> |
| 1643 | <div id="footer-text"> |
Junio C Hamano | be24480 | 2014-04-25 18:21:38 | [diff] [blame] | 1644 | Last updated 2014-03-14 14:59:49 PDT |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1645 | </div> |
| 1646 | </div> |
| 1647 | </body> |
| 1648 | </html> |