summaryrefslogtreecommitdiffstats
path: root/git-p4.html
blob: ed16cfbd74029f8193bd4436e3f6787a8b79e179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 10.2.0" />
<title>git-p4(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */

/* Default font. */
body {
  font-family: Georgia,serif;
}

/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
  font-family: Arial,Helvetica,sans-serif;
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}
h5 {
  font-size: 1.0em;
}

div.sectionbody {
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}
pre {
  white-space: pre-wrap;
}

#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}

#footer {
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid #dddddd;
  border-left: 4px solid #f0f0f0;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid #dddddd;
  border-left: 5px solid #f0f0f0;
  background: #f8f8f8;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #f0f0f0;
  color: #888;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > pre.content {
  font-family: inherit;
  font-size: inherit;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}

div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}

div.colist td {
  padding-right: 0.5em;
  padding-bottom: 0.3em;
  vertical-align: top;
}
div.colist td img {
  margin-top: 0.3em;
}

@media print {
  #footer-badges { display: none; }
}

#toc {
  margin-bottom: 2.5em;
}

#toctitle {
  color: #527bbd;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}

span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }

span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }

span.big { font-size: 2em; }
span.small { font-size: 0.6em; }

span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }

div.unbreakable { page-break-inside: avoid; }


/*
 * xhtml11 specific
 *
 * */

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-weight: bold;
  color: #527bbd;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overridden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


/*
 * html5 specific
 *
 * */

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
}
p.tableblock {
  margin-top: 0;
}
table.tableblock {
  border-width: 3px;
  border-spacing: 0px;
  border-style: solid;
  border-color: #527bbd;
  border-collapse: collapse;
}
th.tableblock, td.tableblock {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #527bbd;
}

table.tableblock.frame-topbot {
  border-left-style: hidden;
  border-right-style: hidden;
}
table.tableblock.frame-sides {
  border-top-style: hidden;
  border-bottom-style: hidden;
}
table.tableblock.frame-none {
  border-style: hidden;
}

th.tableblock.halign-left, td.tableblock.halign-left {
  text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
  text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
  text-align: right;
}

th.tableblock.valign-top, td.tableblock.valign-top {
  vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
  vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  vertical-align: bottom;
}


/*
 * manpage specific
 *
 * */

body.manpage h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
body.manpage h2 {
  border-style: none;
}
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


</style>
<script type="text/javascript">
/*<![CDATA[*/
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  if (!toc) {
    return;
  }

  // Delete existing TOC entries in case we're reloading the TOC.
  var tocEntriesToRemove = [];
  var i;
  for (i = 0; i < toc.childNodes.length; i++) {
    var entry = toc.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div'
     && entry.getAttribute("class")
     && entry.getAttribute("class").match(/^toclevel/))
      tocEntriesToRemove.push(entry);
  }
  for (i = 0; i < tocEntriesToRemove.length; i++) {
    toc.removeChild(tocEntriesToRemove[i]);
  }

  // Rebuild TOC entries.
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  // Delete existing footnote entries in case we're reloading the footnodes.
  var i;
  var noteholder = document.getElementById("footnotes");
  if (!noteholder) {
    return;
  }
  var entriesToRemove = [];
  for (i = 0; i < noteholder.childNodes.length; i++) {
    var entry = noteholder.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
      entriesToRemove.push(entry);
  }
  for (i = 0; i < entriesToRemove.length; i++) {
    noteholder.removeChild(entriesToRemove[i]);
  }

  // Rebuild footnote entries.
  var cont = document.getElementById("content");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      var note = spans[i].getAttribute("data-note");
      if (!note) {
        // Use [\s\S] in place of . so multi-line matches work.
        // Because JavaScript has no s (dotall) regex flag.
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
        spans[i].innerHTML =
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
        spans[i].setAttribute("data-note", note);
      }
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
},

install: function(toclevels) {
  var timerId;

  function reinstall() {
    asciidoc.footnotes();
    if (toclevels) {
      asciidoc.toc(toclevels);
    }
  }

  function reinstallAndRemoveTimer() {
    clearInterval(timerId);
    reinstall();
  }

  timerId = setInterval(reinstall, 500);
  if (document.addEventListener)
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  else
    window.onload = reinstallAndRemoveTimer;
}

}
asciidoc.install();
/*]]>*/
</script>
</head>
<body class="manpage">
<div id="header">
<h1>
git-p4(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>git-p4 -
   Import from and submit to Perforce repositories
</p>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
<pre class="content"><em>git p4 clone</em> [&lt;sync-options&gt;] [&lt;clone-options&gt;] &lt;p4-depot-path&gt;&#8230;
<em>git p4 sync</em> [&lt;sync-options&gt;] [&lt;p4-depot-path&gt;&#8230;]
<em>git p4 rebase</em>
<em>git p4 submit</em> [&lt;submit-options&gt;] [&lt;master-branch-name&gt;]</pre>
<div class="attribution">
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph"><p>This command provides a way to interact with p4 repositories
using Git.</p></div>
<div class="paragraph"><p>Create a new Git repository from an existing p4 repository using
<em>git p4 clone</em>, giving it one or more p4 depot paths.  Incorporate
new commits from p4 changes with <em>git p4 sync</em>.  The <em>sync</em> command
is also used to include new branches from other p4 depot paths.
Submit Git changes back to p4 using <em>git p4 submit</em>.  The command
<em>git p4 rebase</em> does a sync plus rebases the current branch onto
the updated p4 remote branch.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_examples">EXAMPLES</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Clone a repository:
</p>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 clone //depot/path/project</code></pre>
</div></div>
</li>
<li>
<p>
Do some work in the newly created Git repository:
</p>
<div class="listingblock">
<div class="content">
<pre><code>$ cd project
$ vi foo.h
$ git commit -a -m "edited foo.h"</code></pre>
</div></div>
</li>
<li>
<p>
Update the Git repository with recent changes from p4, rebasing your
  work on top:
</p>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 rebase</code></pre>
</div></div>
</li>
<li>
<p>
Submit your commits back to p4:
</p>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 submit</code></pre>
</div></div>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_commands">COMMANDS</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_clone">Clone</h3>
<div class="paragraph"><p>Generally, <em>git p4 clone</em> is used to create a new Git directory
from an existing p4 repository:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 clone //depot/path/project</code></pre>
</div></div>
<div class="paragraph"><p>This:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Creates an empty Git repository in a subdirectory called <em>project</em>.
</p>
</li>
<li>
<p>
Imports the full contents of the head revision from the given p4
   depot path into a single commit in the Git branch <em>refs/remotes/p4/master</em>.
</p>
</li>
<li>
<p>
Creates a local branch, <em>master</em> from this remote and checks it out.
</p>
</li>
</ol></div>
<div class="paragraph"><p>To reproduce the entire p4 history in Git, use the <em>@all</em> modifier on
the depot path:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 clone //depot/path/project@all</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_sync">Sync</h3>
<div class="paragraph"><p>As development continues in the p4 repository, those changes can
be included in the Git repository using:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 sync</code></pre>
</div></div>
<div class="paragraph"><p>This command finds new changes in p4 and imports them as Git commits.</p></div>
<div class="paragraph"><p>P4 repositories can be added to an existing Git repository using
<em>git p4 sync</em> too:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ mkdir repo-git
$ cd repo-git
$ git init
$ git p4 sync //path/in/your/perforce/depot</code></pre>
</div></div>
<div class="paragraph"><p>This imports the specified depot into
<em>refs/remotes/p4/master</em> in an existing Git repository.  The
<code>--branch</code> option can be used to specify a different branch to
be used for the p4 content.</p></div>
<div class="paragraph"><p>If a Git repository includes branches <em>refs/remotes/origin/p4</em>, these
will be fetched and consulted first during a <em>git p4 sync</em>.  Since
importing directly from p4 is considerably slower than pulling changes
from a Git remote, this can be useful in a multi-developer environment.</p></div>
<div class="paragraph"><p>If there are multiple branches, doing <em>git p4 sync</em> will automatically
use the "BRANCH DETECTION" algorithm to try to partition new changes
into the right branch.  This can be overridden with the <code>--branch</code>
option to specify just a single branch to update.</p></div>
</div>
<div class="sect2">
<h3 id="_rebase">Rebase</h3>
<div class="paragraph"><p>A common working pattern is to fetch the latest changes from the p4 depot
and merge them with local uncommitted changes.  Often, the p4 repository
is the ultimate location for all code, thus a rebase workflow makes
sense.  This command does <em>git p4 sync</em> followed by <em>git rebase</em> to move
local commits on top of updated p4 changes.</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 rebase</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_submit">Submit</h3>
<div class="paragraph"><p>Submitting changes from a Git repository back to the p4 repository
requires a separate p4 client workspace.  This should be specified
using the <code>P4CLIENT</code> environment variable or the Git configuration
variable <em>git-p4.client</em>.  The p4 client must exist, but the client root
will be created and populated if it does not already exist.</p></div>
<div class="paragraph"><p>To submit all changes that are in the current Git branch but not in
the <em>p4/master</em> branch, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 submit</code></pre>
</div></div>
<div class="paragraph"><p>To specify a branch other than the current one, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 submit topicbranch</code></pre>
</div></div>
<div class="paragraph"><p>To specify a single commit or a range of commits, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 submit --commit &lt;sha1&gt;
$ git p4 submit --commit &lt;sha1..sha1&gt;</code></pre>
</div></div>
<div class="paragraph"><p>The upstream reference is generally <em>refs/remotes/p4/master</em>, but can
be overridden using the <code>--origin=</code> command-line option.</p></div>
<div class="paragraph"><p>The p4 changes will be created as the user invoking <em>git p4 submit</em>. The
<code>--preserve-user</code> option will cause ownership to be modified
according to the author of the Git commit.  This option requires admin
privileges in p4, which can be granted using <em>p4 protect</em>.</p></div>
<div class="paragraph"><p>To shelve changes instead of submitting, use <code>--shelve</code> and <code>--update-shelve</code>:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 submit --shelve
$ git p4 submit --update-shelve 1234 --update-shelve 2345</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_unshelve">Unshelve</h3>
<div class="paragraph"><p>Unshelving will take a shelved P4 changelist, and produce the equivalent git commit
in the branch refs/remotes/p4-unshelved/&lt;changelist&gt;.</p></div>
<div class="paragraph"><p>The git commit is created relative to the current origin revision (HEAD by default).
A parent commit is created based on the origin, and then the unshelve commit is
created based on that.</p></div>
<div class="paragraph"><p>The origin revision can be changed with the "--origin" option.</p></div>
<div class="paragraph"><p>If the target branch in refs/remotes/p4-unshelved already exists, the old one will
be renamed.</p></div>
<div class="listingblock">
<div class="content">
<pre><code>$ git p4 sync
$ git p4 unshelve 12345
$ git show p4-unshelved/12345
&lt;submit more changes via p4 to the same files&gt;
$ git p4 unshelve 12345
&lt;refuses to unshelve until git is in sync with p4 again&gt;</code></pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_general_options">General options</h3>
<div class="paragraph"><p>All commands except clone accept these options.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--git-dir &lt;dir&gt;
</dt>
<dd>
<p>
        Set the <code>GIT_DIR</code> environment variable.  See <a href="git.html">git(1)</a>.
</p>
</dd>
<dt class="hdlist1">
-v
</dt>
<dt class="hdlist1">
--verbose
</dt>
<dd>
<p>
        Provide more progress information.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_sync_options">Sync options</h3>
<div class="paragraph"><p>These options can be used in the initial <em>clone</em> as well as in
subsequent <em>sync</em> operations.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--branch &lt;ref&gt;
</dt>
<dd>
<p>
        Import changes into &lt;ref&gt; instead of refs/remotes/p4/master.
        If &lt;ref&gt; starts with refs/, it is used as is.  Otherwise, if
        it does not start with p4/, that prefix is added.
</p>
<div class="paragraph"><p>By default a &lt;ref&gt; not starting with refs/ is treated as the
name of a remote-tracking branch (under refs/remotes/).  This
behavior can be modified using the --import-local option.</p></div>
<div class="paragraph"><p>The default &lt;ref&gt; is "master".</p></div>
<div class="paragraph"><p>This example imports a new remote "p4/proj2" into an existing
Git repository:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>    $ git init
    $ git p4 sync --branch=refs/remotes/p4/proj2 //depot/proj2</code></pre>
</div></div>
</dd>
<dt class="hdlist1">
--detect-branches
</dt>
<dd>
<p>
        Use the branch detection algorithm to find new paths in p4.  It is
        documented below in "BRANCH DETECTION".
</p>
</dd>
<dt class="hdlist1">
--changesfile &lt;file&gt;
</dt>
<dd>
<p>
        Import exactly the p4 change numbers listed in <em>file</em>, one per
        line.  Normally, <em>git p4</em> inspects the current p4 repository
        state and detects the changes it should import.
</p>
</dd>
<dt class="hdlist1">
--silent
</dt>
<dd>
<p>
        Do not print any progress information.
</p>
</dd>
<dt class="hdlist1">
--detect-labels
</dt>
<dd>
<p>
        Query p4 for labels associated with the depot paths, and add
        them as tags in Git. Limited usefulness as only imports labels
        associated with new changelists. Deprecated.
</p>
</dd>
<dt class="hdlist1">
--import-labels
</dt>
<dd>
<p>
        Import labels from p4 into Git.
</p>
</dd>
<dt class="hdlist1">
--import-local
</dt>
<dd>
<p>
        By default, p4 branches are stored in <em>refs/remotes/p4/</em>,
        where they will be treated as remote-tracking branches by
        <a href="git-branch.html">git-branch(1)</a> and other commands.  This option instead
        puts p4 branches in <em>refs/heads/p4/</em>.  Note that future
        sync operations must specify <code>--import-local</code> as well so that
        they can find the p4 branches in refs/heads.
</p>
</dd>
<dt class="hdlist1">
--max-changes &lt;n&gt;
</dt>
<dd>
<p>
        Import at most <em>n</em> changes, rather than the entire range of
        changes included in the given revision specifier. A typical
        usage would be use <em>@all</em> as the revision specifier, but then
        to use <em>--max-changes 1000</em> to import only the last 1000
        revisions rather than the entire revision history.
</p>
</dd>
<dt class="hdlist1">
--changes-block-size &lt;n&gt;
</dt>
<dd>
<p>
        The internal block size to use when converting a revision
        specifier such as <em>@all</em> into a list of specific change
        numbers. Instead of using a single call to <em>p4 changes</em> to
        find the full list of changes for the conversion, there are a
        sequence of calls to <em>p4 changes -m</em>, each of which requests
        one block of changes of the given size. The default block size
        is 500, which should usually be suitable.
</p>
</dd>
<dt class="hdlist1">
--keep-path
</dt>
<dd>
<p>
        The mapping of file names from the p4 depot path to Git, by
        default, involves removing the entire depot path.  With this
        option, the full p4 depot path is retained in Git.  For example,
        path <em>//depot/main/foo/bar.c</em>, when imported from
        <em>//depot/main/</em>, becomes <em>foo/bar.c</em>.  With <code>--keep-path</code>, the
        Git path is instead <em>depot/main/foo/bar.c</em>.
</p>
</dd>
<dt class="hdlist1">
--use-client-spec
</dt>
<dd>
<p>
        Use a client spec to find the list of interesting files in p4.
        See the "CLIENT SPEC" section below.
</p>
</dd>
<dt class="hdlist1">
-/ &lt;path&gt;
</dt>
<dd>
<p>
        Exclude selected depot paths when cloning or syncing.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_clone_options">Clone options</h3>
<div class="paragraph"><p>These options can be used in an initial <em>clone</em>, along with the <em>sync</em>
options described above.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--destination &lt;directory&gt;
</dt>
<dd>
<p>
        Where to create the Git repository.  If not provided, the last
        component in the p4 depot path is used to create a new
        directory.
</p>
</dd>
<dt class="hdlist1">
--bare
</dt>
<dd>
<p>
        Perform a bare clone.  See <a href="git-clone.html">git-clone(1)</a>.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_submit_options">Submit options</h3>
<div class="paragraph"><p>These options can be used to modify <em>git p4 submit</em> behavior.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--origin &lt;commit&gt;
</dt>
<dd>
<p>
        Upstream location from which commits are identified to submit to
        p4.  By default, this is the most recent p4 commit reachable
        from <code>HEAD</code>.
</p>
</dd>
<dt class="hdlist1">
-M
</dt>
<dd>
<p>
        Detect renames.  See <a href="git-diff.html">git-diff(1)</a>.  Renames will be
        represented in p4 using explicit <em>move</em> operations.  There
        is no corresponding option to detect copies, but there are
        variables for both moves and copies.
</p>
</dd>
<dt class="hdlist1">
--preserve-user
</dt>
<dd>
<p>
        Re-author p4 changes before submitting to p4.  This option
        requires p4 admin privileges.
</p>
</dd>
<dt class="hdlist1">
--export-labels
</dt>
<dd>
<p>
        Export tags from Git as p4 labels. Tags found in Git are applied
        to the perforce working directory.
</p>
</dd>
<dt class="hdlist1">
-n
</dt>
<dt class="hdlist1">
--dry-run
</dt>
<dd>
<p>
        Show just what commits would be submitted to p4; do not change
        state in Git or p4.
</p>
</dd>
<dt class="hdlist1">
--prepare-p4-only
</dt>
<dd>
<p>
        Apply a commit to the p4 workspace, opening, adding and deleting
        files in p4 as for a normal submit operation.  Do not issue the
        final "p4 submit", but instead print a message about how to
        submit manually or revert.  This option always stops after the
        first (oldest) commit.  Git tags are not exported to p4.
</p>
</dd>
<dt class="hdlist1">
--shelve
</dt>
<dd>
<p>
        Instead of submitting create a series of shelved changelists.
        After creating each shelve, the relevant files are reverted/deleted.
        If you have multiple commits pending multiple shelves will be created.
</p>
</dd>
<dt class="hdlist1">
--update-shelve CHANGELIST
</dt>
<dd>
<p>
        Update an existing shelved changelist with this commit. Implies
        --shelve. Repeat for multiple shelved changelists.
</p>
</dd>
<dt class="hdlist1">
--conflict=(ask|skip|quit)
</dt>
<dd>
<p>
        Conflicts can occur when applying a commit to p4.  When this
        happens, the default behavior ("ask") is to prompt whether to
        skip this commit and continue, or quit.  This option can be used
        to bypass the prompt, causing conflicting commits to be automatically
        skipped, or to quit trying to apply commits, without prompting.
</p>
</dd>
<dt class="hdlist1">
--branch &lt;branch&gt;
</dt>
<dd>
<p>
        After submitting, sync this named branch instead of the default
        p4/master.  See the "Sync options" section above for more
        information.
</p>
</dd>
<dt class="hdlist1">
--commit (&lt;sha1&gt;|&lt;sha1&gt;..&lt;sha1&gt;)
</dt>
<dd>
<p>
    Submit only the specified commit or range of commits, instead of the full
    list of changes that are in the current Git branch.
</p>
</dd>
<dt class="hdlist1">
--disable-rebase
</dt>
<dd>
<p>
    Disable the automatic rebase after all commits have been successfully
    submitted. Can also be set with git-p4.disableRebase.
</p>
</dd>
<dt class="hdlist1">
--disable-p4sync
</dt>
<dd>
<p>
    Disable the automatic sync of p4/master from Perforce after commits have
    been submitted. Implies --disable-rebase. Can also be set with
    git-p4.disableP4Sync. Sync with origin/master still goes ahead if possible.
</p>
</dd>
</dl></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_hooks_for_submit">Hooks for submit</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_p4_pre_submit">p4-pre-submit</h3>
<div class="paragraph"><p>The <code>p4-pre-submit</code> hook is executed if it exists and is executable.
The hook takes no parameters and nothing from standard input. Exiting with
non-zero status from this script prevents <code>git-p4 submit</code> from launching.
It can be bypassed with the <code>--no-verify</code> command line option.</p></div>
<div class="paragraph"><p>One usage scenario is to run unit tests in the hook.</p></div>
</div>
<div class="sect2">
<h3 id="_p4_prepare_changelist">p4-prepare-changelist</h3>
<div class="paragraph"><p>The <code>p4-prepare-changelist</code> hook is executed right after preparing
the default changelist message and before the editor is started.
It takes one parameter, the name of the file that contains the
changelist text. Exiting with a non-zero status from the script
will abort the process.</p></div>
<div class="paragraph"><p>The purpose of the hook is to edit the message file in place,
and it is not suppressed by the <code>--no-verify</code> option. This hook
is called even if <code>--prepare-p4-only</code> is set.</p></div>
</div>
<div class="sect2">
<h3 id="_p4_changelist">p4-changelist</h3>
<div class="paragraph"><p>The <code>p4-changelist</code> hook is executed after the changelist
message has been edited by the user. It can be bypassed with the
<code>--no-verify</code> option. It takes a single parameter, the name
of the file that holds the proposed changelist text. Exiting
with a non-zero status causes the command to abort.</p></div>
<div class="paragraph"><p>The hook is allowed to edit the changelist file and can be used
to normalize the text into some project standard format. It can
also be used to refuse the Submit after inspect the message file.</p></div>
</div>
<div class="sect2">
<h3 id="_p4_post_changelist">p4-post-changelist</h3>
<div class="paragraph"><p>The <code>p4-post-changelist</code> hook is invoked after the submit has
successfully occurred in P4. It takes no parameters and is meant
primarily for notification and cannot affect the outcome of the
git p4 submit action.</p></div>
</div>
<div class="sect2">
<h3 id="_rebase_options">Rebase options</h3>
<div class="paragraph"><p>These options can be used to modify <em>git p4 rebase</em> behavior.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--import-labels
</dt>
<dd>
<p>
        Import p4 labels.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_unshelve_options">Unshelve options</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
--origin
</dt>
<dd>
<p>
    Sets the git refspec against which the shelved P4 changelist is compared.
    Defaults to p4/master.
</p>
</dd>
</dl></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_depot_path_syntax">DEPOT PATH SYNTAX</h2>
<div class="sectionbody">
<div class="paragraph"><p>The p4 depot path argument to <em>git p4 sync</em> and <em>git p4 clone</em> can
be one or more space-separated p4 depot paths, with an optional
p4 revision specifier on the end:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
"//depot/my/project"
</dt>
<dd>
<p>
    Import one commit with all files in the <em>#head</em> change under that tree.
</p>
</dd>
<dt class="hdlist1">
"//depot/my/project@all"
</dt>
<dd>
<p>
    Import one commit for each change in the history of that depot path.
</p>
</dd>
<dt class="hdlist1">
"//depot/my/project@1,6"
</dt>
<dd>
<p>
    Import only changes 1 through 6.
</p>
</dd>
<dt class="hdlist1">
"//depot/proj1@all //depot/proj2@all"
</dt>
<dd>
<p>
    Import all changes from both named depot paths into a single
    repository.  Only files below these directories are included.
    There is not a subdirectory in Git for each "proj1" and "proj2".
    You must use the <code>--destination</code> option when specifying more
    than one depot path.  The revision specifier must be specified
    identically on each depot path.  If there are files in the
    depot paths with the same name, the path with the most recently
    updated version of the file is the one that appears in Git.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>See <em>p4 help revisions</em> for the full syntax of p4 revision specifiers.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_client_spec">CLIENT SPEC</h2>
<div class="sectionbody">
<div class="paragraph"><p>The p4 client specification is maintained with the <em>p4 client</em> command
and contains among other fields, a View that specifies how the depot
is mapped into the client repository.  The <em>clone</em> and <em>sync</em> commands
can consult the client spec when given the <code>--use-client-spec</code> option or
when the useClientSpec variable is true.  After <em>git p4 clone</em>, the
useClientSpec variable is automatically set in the repository
configuration file.  This allows future <em>git p4 submit</em> commands to
work properly; the submit command looks only at the variable and does
not have a command-line option.</p></div>
<div class="paragraph"><p>The full syntax for a p4 view is documented in <em>p4 help views</em>.  <em>git p4</em>
knows only a subset of the view syntax.  It understands multi-line
mappings, overlays with <em>+</em>, exclusions with <em>-</em> and double-quotes
around whitespace.  Of the possible wildcards, <em>git p4</em> only handles
<em>&#8230;</em>, and only when it is at the end of the path.  <em>git p4</em> will complain
if it encounters an unhandled wildcard.</p></div>
<div class="paragraph"><p>Bugs in the implementation of overlap mappings exist.  If multiple depot
paths map through overlays to the same location in the repository,
<em>git p4</em> can choose the wrong one.  This is hard to solve without
dedicating a client spec just for <em>git p4</em>.</p></div>
<div class="paragraph"><p>The name of the client can be given to <em>git p4</em> in multiple ways.  The
variable <em>git-p4.client</em> takes precedence if it exists.  Otherwise,
normal p4 mechanisms of determining the client are used:  environment
variable <code>P4CLIENT</code>, a file referenced by <code>P4CONFIG</code>, or the local host name.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_branch_detection">BRANCH DETECTION</h2>
<div class="sectionbody">
<div class="paragraph"><p>P4 does not have the same concept of a branch as Git.  Instead,
p4 organizes its content as a directory tree, where by convention
different logical branches are in different locations in the tree.
The <em>p4 branch</em> command is used to maintain mappings between
different areas in the tree, and indicate related content.  <em>git p4</em>
can use these mappings to determine branch relationships.</p></div>
<div class="paragraph"><p>If you have a repository where all the branches of interest exist as
subdirectories of a single depot path, you can use <code>--detect-branches</code>
when cloning or syncing to have <em>git p4</em> automatically find
subdirectories in p4, and to generate these as branches in Git.</p></div>
<div class="paragraph"><p>For example, if the P4 repository structure is:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>//depot/main/...
//depot/branch1/...</code></pre>
</div></div>
<div class="paragraph"><p>And "p4 branch -o branch1" shows a View line that looks like:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>//depot/main/... //depot/branch1/...</code></pre>
</div></div>
<div class="paragraph"><p>Then this <em>git p4 clone</em> command:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>git p4 clone --detect-branches //depot@all</code></pre>
</div></div>
<div class="paragraph"><p>produces a separate branch in <em>refs/remotes/p4/</em> for //depot/main,
called <em>master</em>, and one for //depot/branch1 called <em>depot/branch1</em>.</p></div>
<div class="paragraph"><p>However, it is not necessary to create branches in p4 to be able to use
them like branches.  Because it is difficult to infer branch
relationships automatically, a Git configuration setting
<em>git-p4.branchList</em> can be used to explicitly identify branch
relationships.  It is a list of "source:destination" pairs, like a
simple p4 branch specification, where the "source" and "destination" are
the path elements in the p4 repository.  The example above relied on the
presence of the p4 branch.  Without p4 branches, the same result will
occur with:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>git init depot
cd depot
git config git-p4.branchList main:branch1
git p4 clone --detect-branches //depot@all .</code></pre>
</div></div>
</div>
</div>
<div class="sect1">
<h2 id="_performance">PERFORMANCE</h2>
<div class="sectionbody">
<div class="paragraph"><p>The fast-import mechanism used by <em>git p4</em> creates one pack file for
each invocation of <em>git p4 sync</em>.  Normally, Git garbage compression
(<a href="git-gc.html">git-gc(1)</a>) automatically compresses these to fewer pack files,
but explicit invocation of <em>git repack -adf</em> may improve performance.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_configuration_variables">CONFIGURATION VARIABLES</h2>
<div class="sectionbody">
<div class="paragraph"><p>The following config settings can be used to modify <em>git p4</em> behavior.
They all are in the <em>git-p4</em> section.</p></div>
<div class="sect2">
<h3 id="_general_variables">General variables</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
git-p4.user
</dt>
<dd>
<p>
        User specified as an option to all p4 commands, with <em>-u &lt;user&gt;</em>.
        The environment variable <code>P4USER</code> can be used instead.
</p>
</dd>
<dt class="hdlist1">
git-p4.password
</dt>
<dd>
<p>
        Password specified as an option to all p4 commands, with
        <em>-P &lt;password&gt;</em>.
        The environment variable <code>P4PASS</code> can be used instead.
</p>
</dd>
<dt class="hdlist1">
git-p4.port
</dt>
<dd>
<p>
        Port specified as an option to all p4 commands, with
        <em>-p &lt;port&gt;</em>.
        The environment variable <code>P4PORT</code> can be used instead.
</p>
</dd>
<dt class="hdlist1">
git-p4.host
</dt>
<dd>
<p>
        Host specified as an option to all p4 commands, with
        <em>-h &lt;host&gt;</em>.
        The environment variable <code>P4HOST</code> can be used instead.
</p>
</dd>
<dt class="hdlist1">
git-p4.client
</dt>
<dd>
<p>
        Client specified as an option to all p4 commands, with
        <em>-c &lt;client&gt;</em>, including the client spec.
</p>
</dd>
<dt class="hdlist1">
git-p4.retries
</dt>
<dd>
<p>
        Specifies the number of times to retry a p4 command (notably,
        <em>p4 sync</em>) if the network times out. The default value is 3.
        Set the value to 0 to disable retries or if your p4 version
        does not support retries (pre 2012.2).
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_clone_and_sync_variables">Clone and sync variables</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
git-p4.syncFromOrigin
</dt>
<dd>
<p>
        Because importing commits from other Git repositories is much faster
        than importing them from p4, a mechanism exists to find p4 changes
        first in Git remotes.  If branches exist under <em>refs/remote/origin/p4</em>,
        those will be fetched and used when syncing from p4.  This
        variable can be set to <em>false</em> to disable this behavior.
</p>
</dd>
<dt class="hdlist1">
git-p4.branchUser
</dt>
<dd>
<p>
        One phase in branch detection involves looking at p4 branches
        to find new ones to import.  By default, all branches are
        inspected.  This option limits the search to just those owned
        by the single user named in the variable.
</p>
</dd>
<dt class="hdlist1">
git-p4.branchList
</dt>
<dd>
<p>
        List of branches to be imported when branch detection is
        enabled.  Each entry should be a pair of branch names separated
        by a colon (:).  This example declares that both branchA and
        branchB were created from main:
</p>
<div class="listingblock">
<div class="content">
<pre><code>git config       git-p4.branchList main:branchA
git config --add git-p4.branchList main:branchB</code></pre>
</div></div>
</dd>
<dt class="hdlist1">
git-p4.ignoredP4Labels
</dt>
<dd>
<p>
        List of p4 labels to ignore. This is built automatically as
        unimportable labels are discovered.
</p>
</dd>
<dt class="hdlist1">
git-p4.importLabels
</dt>
<dd>
<p>
        Import p4 labels into git, as per --import-labels.
</p>
</dd>
<dt class="hdlist1">
git-p4.labelImportRegexp
</dt>
<dd>
<p>
        Only p4 labels matching this regular expression will be imported. The
        default value is <em>[a-zA-Z0-9_\-.]+$</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.useClientSpec
</dt>
<dd>
<p>
        Specify that the p4 client spec should be used to identify p4
        depot paths of interest.  This is equivalent to specifying the
        option <code>--use-client-spec</code>.  See the "CLIENT SPEC" section above.
        This variable is a boolean, not the name of a p4 client.
</p>
</dd>
<dt class="hdlist1">
git-p4.pathEncoding
</dt>
<dd>
<p>
        Perforce keeps the encoding of a path as given by the originating OS.
        Git expects paths encoded as UTF-8. Use this config to tell git-p4
        what encoding Perforce had used for the paths. This encoding is used
        to transcode the paths to UTF-8. As an example, Perforce on Windows
        often uses "cp1252" to encode path names. If this option is passed
        into a p4 clone request, it is persisted in the resulting new git
        repo.
</p>
</dd>
<dt class="hdlist1">
git-p4.metadataDecodingStrategy
</dt>
<dd>
<p>
        Perforce keeps the encoding of a changelist descriptions and user
        full names as stored by the client on a given OS. The p4v client
        uses the OS-local encoding, and so different users can end up storing
        different changelist descriptions or user full names in different
        encodings, in the same depot.
        Git tolerates inconsistent/incorrect encodings in commit messages
        and author names, but expects them to be specified in utf-8.
        git-p4 can use three different decoding strategies in handling the
        encoding uncertainty in Perforce: <em>passthrough</em> simply passes the
        original bytes through from Perforce to git, creating usable but
        incorrectly-encoded data when the Perforce data is encoded as
        anything other than utf-8. <em>strict</em> expects the Perforce data to be
        encoded as utf-8, and fails to import when this is not true.
        <em>fallback</em> attempts to interpret the data as utf-8, and otherwise
        falls back to using a secondary encoding - by default the common
        windows encoding <em>cp-1252</em> - with upper-range bytes escaped if
        decoding with the fallback encoding also fails.
        Under python2 the default strategy is <em>passthrough</em> for historical
        reasons, and under python3 the default is <em>fallback</em>.
        When <em>strict</em> is selected and decoding fails, the error message will
        propose changing this config parameter as a workaround. If this
        option is passed into a p4 clone request, it is persisted into the
        resulting new git repo.
</p>
</dd>
<dt class="hdlist1">
git-p4.metadataFallbackEncoding
</dt>
<dd>
<p>
        Specify the fallback encoding to use when decoding Perforce author
        names and changelists descriptions using the <em>fallback</em> strategy
        (see git-p4.metadataDecodingStrategy). The fallback encoding will
        only be used when decoding as utf-8 fails. This option defaults to
        cp1252, a common windows encoding. If this option is passed into a
        p4 clone request, it is persisted into the resulting new git repo.
</p>
</dd>
<dt class="hdlist1">
git-p4.largeFileSystem
</dt>
<dd>
<p>
        Specify the system that is used for large (binary) files. Please note
        that large file systems do not support the <em>git p4 submit</em> command.
        Only Git LFS is implemented right now (see <a href="https://git-lfs.github.com/">https://git-lfs.github.com/</a>
        for more information). Download and install the Git LFS command line
        extension to use this option and configure it like this:
</p>
<div class="listingblock">
<div class="content">
<pre><code>git config       git-p4.largeFileSystem GitLFS</code></pre>
</div></div>
</dd>
<dt class="hdlist1">
git-p4.largeFileExtensions
</dt>
<dd>
<p>
        All files matching a file extension in the list will be processed
        by the large file system. Do not prefix the extensions with <em>.</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.largeFileThreshold
</dt>
<dd>
<p>
        All files with an uncompressed size exceeding the threshold will be
        processed by the large file system. By default the threshold is
        defined in bytes. Add the suffix k, m, or g to change the unit.
</p>
</dd>
<dt class="hdlist1">
git-p4.largeFileCompressedThreshold
</dt>
<dd>
<p>
        All files with a compressed size exceeding the threshold will be
        processed by the large file system. This option might slow down
        your clone/sync process. By default the threshold is defined in
        bytes. Add the suffix k, m, or g to change the unit.
</p>
</dd>
<dt class="hdlist1">
git-p4.largeFilePush
</dt>
<dd>
<p>
        Boolean variable which defines if large files are automatically
        pushed to a server.
</p>
</dd>
<dt class="hdlist1">
git-p4.keepEmptyCommits
</dt>
<dd>
<p>
        A changelist that contains only excluded files will be imported
        as an empty commit if this boolean option is set to true.
</p>
</dd>
<dt class="hdlist1">
git-p4.mapUser
</dt>
<dd>
<p>
        Map a P4 user to a name and email address in Git. Use a string
        with the following format to create a mapping:
</p>
<div class="listingblock">
<div class="content">
<pre><code>git config --add git-p4.mapUser "p4user = First Last &lt;mail@address.com&gt;"</code></pre>
</div></div>
<div class="paragraph"><p>A mapping will override any user information from P4. Mappings for
multiple P4 user can be defined.</p></div>
</dd>
</dl></div>
</div>
<div class="sect2">
<h3 id="_submit_variables">Submit variables</h3>
<div class="dlist"><dl>
<dt class="hdlist1">
git-p4.detectRenames
</dt>
<dd>
<p>
        Detect renames.  See <a href="git-diff.html">git-diff(1)</a>.  This can be true,
        false, or a score as expected by <em>git diff -M</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.detectCopies
</dt>
<dd>
<p>
        Detect copies.  See <a href="git-diff.html">git-diff(1)</a>.  This can be true,
        false, or a score as expected by <em>git diff -C</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.detectCopiesHarder
</dt>
<dd>
<p>
        Detect copies harder.  See <a href="git-diff.html">git-diff(1)</a>.  A boolean.
</p>
</dd>
<dt class="hdlist1">
git-p4.preserveUser
</dt>
<dd>
<p>
        On submit, re-author changes to reflect the Git author,
        regardless of who invokes <em>git p4 submit</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.allowMissingP4Users
</dt>
<dd>
<p>
        When <em>preserveUser</em> is true, <em>git p4</em> normally dies if it
        cannot find an author in the p4 user map.  This setting
        submits the change regardless.
</p>
</dd>
<dt class="hdlist1">
git-p4.skipSubmitEdit
</dt>
<dd>
<p>
        The submit process invokes the editor before each p4 change
        is submitted.  If this setting is true, though, the editing
        step is skipped.
</p>
</dd>
<dt class="hdlist1">
git-p4.skipSubmitEditCheck
</dt>
<dd>
<p>
        After editing the p4 change message, <em>git p4</em> makes sure that
        the description really was changed by looking at the file
        modification time.  This option disables that test.
</p>
</dd>
<dt class="hdlist1">
git-p4.allowSubmit
</dt>
<dd>
<p>
        By default, any branch can be used as the source for a <em>git p4
        submit</em> operation.  This configuration variable, if set, permits only
        the named branches to be used as submit sources.  Branch names
        must be the short names (no "refs/heads/"), and should be
        separated by commas (","), with no spaces.
</p>
</dd>
<dt class="hdlist1">
git-p4.skipUserNameCheck
</dt>
<dd>
<p>
        If the user running <em>git p4 submit</em> does not exist in the p4
        user map, <em>git p4</em> exits.  This option can be used to force
        submission regardless.
</p>
</dd>
<dt class="hdlist1">
git-p4.attemptRCSCleanup
</dt>
<dd>
<p>
        If enabled, <em>git p4 submit</em> will attempt to cleanup RCS keywords
        ($Header$, etc). These would otherwise cause merge conflicts and prevent
        the submit going ahead. This option should be considered experimental at
        present.
</p>
</dd>
<dt class="hdlist1">
git-p4.exportLabels
</dt>
<dd>
<p>
        Export Git tags to p4 labels, as per --export-labels.
</p>
</dd>
<dt class="hdlist1">
git-p4.labelExportRegexp
</dt>
<dd>
<p>
        Only p4 labels matching this regular expression will be exported. The
        default value is <em>[a-zA-Z0-9_\-.]+$</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.conflict
</dt>
<dd>
<p>
        Specify submit behavior when a conflict with p4 is found, as per
        --conflict.  The default behavior is <em>ask</em>.
</p>
</dd>
<dt class="hdlist1">
git-p4.disableRebase
</dt>
<dd>
<p>
    Do not rebase the tree against p4/master following a submit.
</p>
</dd>
<dt class="hdlist1">
git-p4.disableP4Sync
</dt>
<dd>
<p>
    Do not sync p4/master with Perforce following a submit. Implies git-p4.disableRebase.
</p>
</dd>
</dl></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_implementation_details">IMPLEMENTATION DETAILS</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Changesets from p4 are imported using Git fast-import.
</p>
</li>
<li>
<p>
Cloning or syncing does not require a p4 client; file contents are
  collected using <em>p4 print</em>.
</p>
</li>
<li>
<p>
Submitting requires a p4 client, which is not in the same location
  as the Git repository.  Patches are applied, one at a time, to
  this p4 client and submitted from there.
</p>
</li>
<li>
<p>
Each commit imported by <em>git p4</em> has a line at the end of the log
  message indicating the p4 depot location and change number.  This
  line is used by later <em>git p4 sync</em> operations to know which p4
  changes are new.
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_git">GIT</h2>
<div class="sectionbody">
<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated
 2022-05-20 17:49:41 PDT
</div>
</div>
</body>
</html>