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
|
.TH GIT-DPM 1 "2012-05-15" "git\-dpm" GIT-DPM
\" I don't want hyphen (U+2010), nor minus (U+2212), but hyphen-minus(U+002D)
.char \- \N'45'
.char - \N'45'
\" some for "'"
.char ' \N'39'
.SH NAME
git\-dpm \- Debian packages in git manager
.SH SYNOPSIS
.B git\-dpm \-\-help
.B git\-dpm
[
\fIoptions\fP
]
\fIcommand\fP
[
\fIper\-command\-options and \-arguments\fP
]
.SH DESCRIPTION
Git\-dpm is a tool to handle a Debian source package in a git repository.
Each project contains three branches, a Debian branch (\fBmaster\fP/\fIwhatever\fP),
a patched branch (\fBpatched\fP/\fBpatched\-\fP\fIwhatever\fP) and an upstream
branch (\fBupstream\fP/\fBupstream\-\fP\fIwhatever\fP) and \fBgit\-dpm\fP helps
you store the information in there so you have your changes exportable as quilt
series.
Git\-dpm will guess the other two branches based on the branch it sees.
(Most commands act based on the current HEAD, i.e. what branch you have
currently checked out, though some as e.g. \fBstatus\fP allows an optional
argument instead).
So for example, if you are in branch \fBmaster\fP, git\-dpm assumes the
corresponding upstream branch is called \fBupstream\fP.
If you are in branch \fBupstream\-something\fP, it assumes the Debian branch
is called \fBsomething\fP.
Note that most commands may switch to another branch automatically,
partly because it is easier to implement that way and hopefully so one
does not need to switch branches manually so often.
.SH SHORT EXPLANATION OF THE BRANCHES
.IP "the upstream branch (\fBupstream\fP|\fBupstream\-\fP\fIwhatever\fP)"
This branch contains the upstream sources.
Its contents need to be equal enough to the contents in your upstream tarball.
.IP "the patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP)"
This branch contains your patches to the upstream source.
Every commit will be stored as a single patch in the resulting package.
Most of the time it will not exist as a branch known to \fBgit\fP,
but only as some point in the history of the Debian branch and
possibly as tag for published versions.
\fBGit\-dpm\fP will create it when needed and remove the
branch when no longer needed.
To help git generate a linear patch series, this should ideal be a
linear chain of commits, whose description are helpful for other people.
As this branch is regularly rebased, you should not publish it.
.IP "the Debian branch (\fBmaster\fP|\fP\fIwhatever\fP)"
This is the primary branch.
This branch contains the \fBdebian/\fP directory and has the patched
branch merged in.
Every change not in \fBdebian/\fP, \fB.git\fP\fI*\fP or deleting files
must be done in the patched branch.
.SH EXAMPLES
Let's start with some examples:
.IP "Checking out a project"
First get the master branch:
\fBgit clone\fP \fIURL\fP
Then create upstream branch and see if the .orig.tar is ready:
\fBgit\-dpm prepare\fP
Create the patched branch and check it out:
\fBgit\-dpm checkout\-patched\fP
Do some changes, apply some patches, commit them..
\fI...\fP
\fBgit commit\fP
If your modification fixes a previous change (and that is not the
last commit, otherwise you could have used \-\-amend),
you might want to squash those two commits into one, so use:
\fBgit rebase \-i upstream\fP
Then you want to get those changes into the Debian branch
and the new patch files created (which you can do using
\fBgit\-dpm update\-patches\fP), but you most likely want to
also document what you did in the changelog, so all
in one step:
\fBgit\-dpm dch \-\- \-i\fP
Perhaps change something in the Debian packaging:
\fI...\fP
\fBgit commit \-a\fP
Then push the whole thing back:
\fBgit push\fP
.IP "Switching to a new upstream version"
Get a new .orig.tar file.
Either upgrade your upstream branch to the contents of that file
and call \fBgit\-dpm record\-new\-upstream ../\fP\fInew\-stuff\fP\fB.orig.tar.gz\fP
or tell git\-dpm to import and record it:
\fBgit\-dpm import\-new\-upstream \-\-rebase ../\fP\fInew\-stuff\fP\fB.orig.tar.gz\fP
This will rebase the patched branch to the new upstream branch,
perhaps you will need to resolve some conflicts:
\fIvim ...\fP
\fBgit add\fP \fIresolved files\fP
\fBgit rebase \-\-continue\fP
After rebase is run (with some luck even in the first try):
\fBgit\-dpm dch \-\- \-v \fP\fInewupstream\fP\fB\-1 "new upstream version"\fP
You could have also done the last step in three by:
\fBgit\-dpm update\-patches\fP
\fBdch \-\- \-v \fP\fInewupstream\fP\fB\-1 "new upstream version"\fP
\fBgit commit \-\-amend \-a\fP
Do other debian/ changes:
\fI...\fP
\fBgit commit \-a\fP
Then push the whole thing back:
\fBgit push\fP
.IP "Creating a new project"
Create an \fBupstream\fP (or \fBupstream\-\fP\fIwhatever\fP) branch containing
the contents of your orig.tar file:
\fBtar \-xvf \fP\fIexample\fP\fB\(ul\fP\fI0\fP\fB.orig.tar.gz\fP
\fBcd \fP\fIexample\fP\fB\-\fP\fI0\fP
\fBgit init\fP
\fBgit add .\fP
\fBgit commit \-m "import \fP\fIexample\fP\fB_\fP\fI0\fP\fB.orig.tar.gz"\fP
\fBgit checkout \-b upstream\-unstable\fP
You might want to use pristine tar to store your tar:
\fBpristine\-tar commit ../\fP\fIexample\fP\fB_\fP\fI0\fP\fB.orig.tar.gz upstream\-unstable\fP
Then let git\-dpm know what tarball your upstream branch belongs to:
\fBgit\-dpm init ../\fP\fIexample\fP\fB_\fP\fI0\fP\fB.orig.tar.gz\fP
Note that since you were in \fBupstream\-unstable\fP in this example,
in the last example \fBgit\-dpm\fP assumed you want your Debian branch
called \fBunstable\fP and not \fBmaster\fP, so after the command returned
you are in the newly created \fBunstable\fP branch.
Do the rest of the packaging:
\fIvim\fP \fBdebian/control debian/rules\fP
\fBdch \-\-create \-\-package \fP\fIexample\fP\fB \-v \fP\fI0\fP\fB\-1\fP
\fBgit add debian/control debian/rules debian/changelog\fP
\fBgit commit \-m "initial packaging"\fP
Then add some patches:
\fBgit\-dpm checkout\-patched\fP
\fIvim ...\fP
\fBgit commit \-a\fP
\fBgit\-dpm dch "\fP\fIfix ... (Closes: num)\fP\fB"\fP
The \fBgit\-dpm checkout\-patched\fP created a temporary branch \fBpatched\-unstable\fP
(as you were in a branch called \fPunstable\fP. If you had called it with
HEAD being a branch \fBmaster\fP, it would have been \fBpatched\fP)
to which you added commits.
Then the \fBgit\-dpm update\-patches\fP implied by \fBgit\-dpm dch\fP
merged those changes into \fBunstable\fP,
deleted the temporary branch and created new \fBdebian/patches/\fP files.
Then build your package:
\fBgit\-dpm status &&\fP
\fB dpkg\-buildpackage \-rfakeroot \-us \-uc \-I".git*"\fP
Now take a look what happened, perhaps you want to add some
files to \fB.gitignore\fP (in the \fBunstable\fP branch),
or remove some files from the \fBunstable\fP branch because your clean
rule removes them.
Continue the last few steps until the package is finished.
Then push your package:
\fBgit\-dpm tag\fP
\fBgit push \-\-tags \fP\fItarget\fP\fB unstable:unstable pristine\-tar:pristine\-tar\fP
.IP "Removing existing patches"
First get the master branch:
\fBgit clone\fP \fIURL\fP
Create the patched branch and check it out:
\fBgit\-dpm checkout\-patched\fP
Get a list of commits since the last upstream release:
\fBgit rebase \-i upstream\-unstable\fP
This will open your default editor with a list of commits. Edit the list to
remove undesired commits.
\fI...\fP
\fBgit commit\fP
Then you want to get those changes into the Debian branch
and the old patch files deleted (which you can do using
\fBgit\-dpm update\-patches\fP), but you most likely want to
also document what you did in the changelog, so all
in one step:
\fBgit\-dpm dch \-\- \-i\fP
Perhaps change something in the Debian packaging:
\fI...\fP
\fBgit commit \-a\fP
Then push the whole thing back:
\fBgit push\fP
.SH GLOBAL OPTIONS
.TP
.B \-\-debug
Give verbose output what git\-dpm is doing.
Mostly only useful for debugging or when preparing an bug report.
.TP
.B \-\-debug\-git\-calls
Output git invocations to stderr.
(For more complicated debugging cases).
.TP
.B \-\-allow\-changes\-in\-debian\-branch
Ignore upstream changes in your Debian branch.
This will either discard them if merge\-patched is called by
come command or them being ignored elsewhere.
.SH COMMANDS
.TP
.B init \fR[\fP\fIoptions\fP\fR]\fP \fItarfile\fP \fR[\fP\fIupstream-commit\fP \fR[\fP\fIpreapplied-commit\fP \fR[\fP\fIpatched-commit\fP\fR]]]\fP
Create a new project.
The first argument is an upstream tarball.
You also need to have the contents of that file
and the files given with \-\-component unpackaged
as some branch or commit in your git repository
(or similar enough so \fBdpkg\-source\fP will not know the difference).
This will be stored in the upstream branch
(called \fBupstream\fP or \fBupstream\-\fP\fIwhatever\fP).
If the second argument is non-existing or empty, that branch must
already exist, otherwise that branch will be initialized with
what that second argument. (It's your responsibility that the
contents match. git\-dpm does not know what your clean rule does,
so cannot check (and does not even try to warn yet)).
You can already have an Debian branch
(called \fBmaster\fP or \fBwhatever\fP).
If it does not exist, it will exist afterwards.
Otherwise it can contain a \fBdebian/patches/series\fP file,
which git\-dpm will import.
The third argument can be a descendant of your upstream branch,
that contains the changes of your Debian branch before any patches
are applied (Most people prefer to have none and lintian warns, but
if you have some, commit/cherry pick them in a new branch/detached head
on top of your upstream branch and name them here).
Without \-\-patches\-applied, your Debian branch may not have any
upstream changes compared to this commit (or if it is not given,
the upstream branch).
If there is no fourth argument, git\-dpm will apply possible patches
in your Debian branch on top of the third argument or upstream.
You can also do so yourself and give that as fourth argument.
The contents of this commit/branch given in the fourth commit or
created by applying patches on top of the third/your upstream branch
is then merged into your Debian branch and remembered as patched branch.
Options:
.RS
.TP
.B \-\-component \fIfilename\fP
Record a \fB.orig\-\fP\fIcomponent\fP\fB.tar\fP file to be unpacked
in your upstream branch.
.TP
.B \-\-patches\-applied
Denote the Debian branch already has the patches applied.
Without this git\-dpm will check there are no changes in the
Debian branch outside patch management before applying the
patches; with this, it will instead check there are no differences after
applying the patches.
.TP
.B \-\-create\-no\-patches
Do not create/override \fBdebian/patches\fP directory.
You will have to call \fBupdate\-patches\fP yourself.
Useful if you are importing historical data and keep the
original patches in the Debian branch.
.TP
.B \-\-record\-patch\-category
Add a \fBPatch-Category:\fP field to each imported patch that is
in a subdirectory of \fBdebian/patches\fP.
This causes \fBupdate\-patches\fP to store it in the same subdirectory.
.TP
.B \-\-record\-patch\-name
Add a \fBPatch-Name:\fP field to each imported patch with its name.
This causes \fBupdate\-patches\fP to store it under its original name.
.RE
.TP
.B prepare
Make sure upstream branch and upstream orig.tar ball are there
and up to date.
(Best called after a clone or a pull).
.TP
.B status \fR[\fP\fIbranch\fP\fR]\fP
Check the status of the current project (or of the project
belonging to the argument \fIbranch\fP if that is given).
Returns with non-zero exit code if something to do is detected.
.TP
.B checkout\-patched
Checkout the patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP)
after making sure it exists and is one recorded in the \fBdebian/.git\-dpm\fP
file.
If the patched branch references an old state (i.e. one that is already
ancestor of the current Debian branch), it is changed to the recorded current one.
Otherwise you can reset it to the last recorded state with the \fB\-\-force\fP
option.
.TP
.B update\-patches \fR[\fP\fIoptions\fP\fR] [\fP\fIbranch-name\fP\fR]\fP
After calling \fBmerge\-patched\-into\-debian\fP if necessary,
update the contents of \fBdebian/patches\fP to the current state of the
\fBpatched\fP branch.
Also record in debian/.git\-dpm which state of the patched branch
the patches directory belongs to.
If a \fIbranch-name\fP is given, that branch is processed.
Otherwise the name is derived from the currently checked out branch
as usual.
Options:
.RS
.TP
.B \-\-redo
Do something,
even if it seems like there is nothing to do.
.TP
.BR \-\-allow\-revert ", " \-\-ignore\-deletions ", " \-\-dot\-git\-files=\fI*\fP
passed on to merge\-patched\-into\-debian
.TP
.B \-\-amend
Do not create a new commit,
but amend the last one in the Debian branch.
(I.e. call merge\-patched\-into\-debian with \-\-amend and
amend the updates patches into the last commit even if that was
not created by merge\-patched\-into\-debian).
.TP
.B \-m \fImessage\fP
Use \fImessage\fP as commit message.
(If used together with \-\-amend, do not reuse old commit message,
author or author date but replace the old commit with a new commit
with that message).
.TP
.B \-\-keep\-branch
do not remove an existing patched branch
(usually that is removed and can be recreated with \fBcheckout\-patched\fP
to avoid stale copies lurking around.
.TP
.B \-\-allow\-nonlinear
passed to merge\-patched.
.RE
.TP
.B dch \fR[\fP\fIoptions\fP\fR]\fP \-\- \fIdch-options\fP
After calling update\-patches if necessary,
run devscripts' dch with the specified options and
then do a \fBgit commit\fP with a commit message containing changes to
the \fBdebian/changelog\fP file.
Options:
.RS
.TP
.B \-\-amend
Replace the commit currently the head of the Debian branch
(\fBmaster\fP|\fIsomething\fP) instead of creating a new one on top.
The commit message will also include changes done to
\fBdebian/changelog\fP in the previous commit (unless reverted
by the new edit).
.TP
.B \-\-ignore\-patches
Do not call update\-patches but simply ignore the current state of
the patched branch (\fBpatched\fP|\fBpatched\-\fP\fIsomething\fP).
.TP
.BR \-\-keep\-branch ", " \-\-allow\-revert ", " \-\-allow\-nonlinear ", " \-\-ignore\-deletions ", " \-\-dot\-git\-files=\fI*\fP
Passed to update\-patches, if called.
.TP
.BR \-\-latest\-only | \-\-latest | \-l
Only include changes between the current working directory before calling
dch and after calling it (and not since the last commit or the last commit
not replaced).
.TP
.BR \-e " | " \-v " | " \-a " | " \-\-all " | " \-s " | " \-n " | " \-\-no\-verify " | " \-u " | " \-\-untracked\-files " | " \-q " | " \-\-quiet " | " \-\-cleanup=\fI...\fP " | " \-\-author=\fI...\fP
passed to git commit.
.RE
.TP
.B merge\-patched\-into\-debian \fR[\fP\fIoptions\fP\fR] [\fR\fIbranch-name\fP\fR]\fP
Usually \fBupdate\-patches\fP runs this for you if deemed necessary.
This command is the core of \fBgit\-dpm\fP, but you usually do not call
it directly.
It is called by \fBupdate\-patches\fP and things calling \fBupdate\-patches\fP
like \fBdch\fP when necessary.
It replaces all files (with only the exceptions described below) in the
current Debian branch (\fBmaster\fP|\fIwhatever\fP)
with those found in the patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP).
Only the \fBdebian\fP directory and files in the root directory starting
with ".git" are kept from the Debian branch
(so \fB.gitignore\fP, \fB.gitattributes\fP, ... will stay).
And all files that were found in the last recorded patched branch and deleted
in the current Debian branch will also be deleted in the new one.
Additionally the \fBdebian/.git\-dpm\fP file will be updated so the
current patched branch is recorded
and is marked as belonging to the last recorded upstream branch.
If there is no \fIbranch-name\fP given on the command line the base name of
the branches to operate on is computed from the currently checked out branch
as usual. Otherwise this argument is used.
Options:
.RS
.TP
.B \-\-allow\-revert
Usually reverting to an old state of the patched
branch is not allowed, to avoid mistakes (like having only pulled the
Debian branch and forgot to run \fBcheckout\-patched\fP).
This option changes that
so you can for example drop the last patch in your stack.
.TP
.BR \-\-no\-ignore\-deletions " (default)"
Files deleted currently in the Debian branch relative to the
recorded patched branch will still be deleted in the new Debian
branch and not taken from the new patched branch.
This is the default unless a different default was set with
\fBgit config dpm.\fP\fIBRANCHNAME\fP\fB.dpmIgnoreDeletions true\fP.
.TP
.B \-\-ignore\-deletions
Disable the behavior described in \fB\-\-no\-ignore\-deletions\fP.
.TP
.BI \-\-dot\-git\-files= method
Specify how files starting with \fB.git\fP outside \fBdebian/\fP are handled.
Those are handles specially as \fB.gitattributes\fP and \fB.gitignore\fP
might be different in the Debian branch without being part of any patch.
(The whole \fBdebian/\fP directory is always taken from the Debian branch,
so files there are not affected).
Possible methods are:
.RS
.TP
.BR automatic " (default)"
Any \fB.git\fP\fI*\fP files that are added, modified or removed in
the current Debian branch compared to the old upstream branch are set
to this state,
everything else is taken as found in the new patched branch.
.TP
.B debian
All \fB.git\fP\fI*\fP files are taken from the Debian branch.
Files with a name like that from the patched branch are ignored.
.TP
.B upstream
Files starting with \fB.git\fP are not given special handling.
They are taken from the patched branch,
unless they are deleted in the Debian branch and the
default \fB\-\-no\-ignore\-deletions\fP is active.
(i.e. just like any other file outside \fBdebian/\fP).
.RE
.TP
.B \-\-keep\-branch
do not remove an existing patched branch
(usually that is removed and can be recreated with \fBcheckout\-patched\fP
to avoid stale copies lurking around).
.TP
.B \-\-amend
Replace the last commit on your Debian branch (as git commit \-\-amend would do).
With the exception that every parent that is an ancestor of or equal to
the new patched branch or the recorded patched branch is omitted.
(That is, you lose not only the commit on the Debian branch, but also a previous
state of the patched branch if your last commit also merged the patched branch).
.TP
.BI \-m " message"
Commit message to use for the new commit created.
(If used together with \-\-amend, this disables reusing the old author and date).
.TP
.B \-\-allow\-nonlinear
do not abort with an error if the patched branch is no linear series of commits on top of the upstream branch.
Using this option is not recommended as it easily hides problems with patched or upstream branch and may introduce broken debian/patches/ series, as format-patch does no serialisation.
.RE
.TP
.B import\-new\-upstream \fR[\fIoptions\fR]\fP \fI.orig.tar\fP
Import the contents of the given tarfile (as with \fBimport\-tar\fP)
and record this branch (as with \fBrecord\-new\-upstream\fP).
This is roughly equivalent to:
\fBgit\-dpm import\-tar \-p \fP\fIupstream\fP \fIfilename\fP
\fBgit checkout \-b \fP\fIupstream\fP
\fBgit\-dpm record\-new\-upstream \fP\fIfilename\fP
.RS
.TP
.B \-\-detached
Don't make the new upstream branch an ancestor of the old upstream
branch (unless you re-add that with \fB\-p\fP).
.TP
.B \-p \fIcommit-id\fP\fR|\fP\-\-parent \fIcommit-id\fP
Give \fBimport\-tar\fP additional parents of the new commit to create.
For example if you track upstream's git repository in some branch,
you can name that here to make it part of the history of your Debian branch.
.TP
.B \-\-allow\-no\-parent
If dpm.importWithoutParent is set to false via git config,
git\-dpm will not allow import\-new\-upstream to be run without
this option or at least on \-p option.
.TP
.B \-\-rebase\-patched
After recording the new upstream branch,
rebase the patched branch to the new upstream branch.
.TP
.B \-\-no\-rebase\-patched
Do not call rebase\-patched after recording the new upstream branch.
(This is currently the default, but that may change in the future).
.TP
.B \-m \fImessage\fP
Commit message to use for the new commit to the Debian branch recording
the new file and upstream branch.
.TP
.B \-\-component \fIpackage\fP_\fIversion\fP.orig\-\fIcomponent\fP.tar\fI.gz\fP
Unpack the specified filename into the \fIcomponent\fP directory
and record it so that \fBprepare\fP and \fBstatus\fP know to check for it.
.TP
.B \-\-init
None of the branches yet exists, create them.
As the branches to operate on are derived from \fBHEAD\fP
if no \fB\-\-branch\fP option is given,
you either need \fBHEAD\fP point to an not yet existing branch
(like directly after \fBgit init\fP) or you need you give a name
with \fB\-\-branch\fP. Otherwise one of the branches already exists
and you only get an error message.
.TP
.B \-\-branch \fIdebianbranch\fP
Don't derive the Debian branch name from current \fBHEAD\fP but use
\fIdebianbranch\fP instead.
(And upstream branch name and patched branch name derived from that
as usual).
.TP
.B \-\-pristine\-tar\-commit \fR|\fP \-\-ptc
Call \fBpristine\-tar commit\fP for all imported tarballs not yet found
in the pristine\-tar branch.
.TP
.B \-\-no\-pristine\-tar\-commit
Do not call \fBpristine\-tar commit\fP for all imported tarballs even
if configured to do so by
\fBgit config dpm.pristineTarCommit true\fP
or by
\fBgit config branch.\fPdebianbranch\fB.dpmPristineTarCommit true\fP.
.TP
.BR \-\-ignore\-deletions ", " \-\-dot\-git\-files=
Passed to merge\-patched, if called
(only done if there were no patches previously).
.TP
.B \-\-upstream\-author \fIauthor\fP
Used as the \fB\-\-author\fP argument to \fBgit\-dpm import\-tar\fP.
.TP
.B \-\-upstream\-date \fIdate\fP
Used as the \fB\-\-date\fP argument to \fBgit\-dpm import\-tar\fP
(especially \fBauto\fP is supported to extract a date from the tar file).
.TP
.B \-\-exclude \fIpattern\fP
The given pattern is passed to tar as exclude pattern when unpacking.
Can be given multiple times.
.RE
.TP
.B import\-tar \fR[\fIoptions\fR]\fP \fI.tar-file\fP
Create a new commit containing the contents of the given file.
The commit will not have any parents, unless you give \fB\-p\fP options.
.RS
.TP
.B \-p \fIcommit-id\fP\fR|\fP\-\-parent \fIcommit-id\fP
Add the given commit as parent.
(Can be specified multiple times).
.TP
.B \-\-branch \fIbranchname\fP\fR
Create new branch \fIbranchname\fP if it does not already exist
or replace \fIbranchname\fP with a commit created from the tarball
with the current \fIbranchname\fP head as parent.
.TP
.B \-m \fImessage\fP
Do not start an editor for the commit message,
but use the argument instead.
.TP
.B \-\-date \fIdate\fP
Date of the commit to create.
If the value is \fBauto\fP then the newest date of any file or directory
in the tarball is used.
.TP
.B \-\-author \fIauthor\fP
Author of the commit to create. It has to be in the usual git format
\fIauthor\fP \fB<\fP\fIemail\fP\fB>\fP.
.TP
.B \-\-exclude \fIpattern\fP
The given pattern is passed to tar as exclude pattern when unpacking.
Can be given multiple times.
.RE
.TP
.B record\-new\-upstream \fR[\fP\fIoptions\fP\fR]\fP \fI.orig.tar\fP \fR[\fP\fIcommit\fP\fR]\fP
If you changed the
upstream branch (\fBupstream\fP|\fBupstream\-\fP\fIwhatever\fP),
git\-dpm needs to know which tarball this branch now corresponds
to and you have to rebase your
patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP)
to the new upstream branch.
If there is a second argument, this command first replaces
your upstream branch with the specified commit.
Then the new upstream branch is recorded in your Debian branch's \fBdebian/.git\-dpm\fP
file.
If you specified \fB\-\-rebase\-patched\fP (or short \fB\-\-rebase\fP),
\fBgit\-dpm rebase\-patched\fP will be called to rebase your patched branch
on top of the new upstream branch.
After this (and if the branch then looks like what you want),
you still need to call \fBgit\-dpm merge\-patched\-into\-debian\fP
(or directly \fBgit\-dpm update\-patches\fP).
\fBWARNING\fP to avoid any misunderstandings:
You have to change the upstream branch before using this command.
It's your responsibility to ensure the contents of the tarball match
those of the upstream branch.
.RS
.TP
.B \-\-rebase\-patched
Automatically call \fBgit\-dpm rebase\-patched\fP.
.TP
.B \-\-new\-tarball\-only
Don't refuse operation if the tarball changes but the upstream branch did not.
(This is only sensible if the tarball changed without changing its contents,
see the warning above).
.TP
.B \-m \fImessage\fP
Commit message to use for the new commit to the Debian branch recording
the new file and upstream branch.
.TP
.B \-\-amend
Replace the last commit instead of creating a new one on top.
.TP
.B \-\-component \fIfilename\fP
Record \fIfilename\fP as needed component source file
(i.e. a \fIsourcename\fP\fB_\fP\fIupstreamversion\fP\fB.orig\-\fP\fIcomponent\fP\fB.tar.\fP\fIcompression\fP file).
It's your responsible to have that file's contents already as part of your
upstream branch (in a \fIcomponent\fP subdirectory).
(Recorded files will be looked for by \fBstatus\fP and \fBprepare\fP.
The list of recorded component source files is removed when a new
upstream branch or upstream \fB.orig\fP source file is recorded).
.TP
.BR \-\-ignore\-deletions ", " \-\-\dot\-git\-files=
Passed to merge\-patched, if called
(which is only done if there were no patches previously,
so the new upstream branch is merged in directly).
.RE
.TP
.B rebase\-patched
Try to rebase your
current patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP)
to your current
current upstream branch (\fBupstream\fP|\fBupstream\-\fP\fIwhatever\fP).
If those branches do not yet exist as git branches, they are (re)created
from the information recorded in \fBdebian/.git\-dpm\fP first.
This is only a convenience wrapper around git rebase that first tries
to determine what exactly is to rebase.
If there are any conflicts, git rebase will ask you to resolve them
and tell rebase to continue.
After this is finished (and if the branch then looks like what you want),
you still need \fBmerge\-patched\-into\-debian\fP
(or directly \fBupdate\-patches\fP).
.TP
.B tag \fR[\fP \fIoptions\fP \fR]\fP \fR[\fP \fIversion\fP \fR]\fP
Add tags to the upstream, patched and Debian branches.
If no version is given, it is taken from debian/changelog.
Options:
.RS
.TP
.B \-\-refresh
Overwrite the tags if they are already there and differ (except upstream).
.TP
.B \-\-refresh\-upstream
Overwrite the upstream if that is there and differs.
.TP
.B \-\-allow\-stale\-patches
Don't error out if patches are not up to date.
This is only useful if you are importing historical data
and want to tag it.
.TP
.B \-\-named
Use the package name as part of the names of the generated tags.
(use \fBgit config dpm.tagsNamed true\fP to make this the default)
.TP
.B \-\-with\-name \fIname\fP
Like \fB\-\-named\fP but give the name to use.
.TP
.B \-\-debian\-tag \fItag-name\fP
.TP
.B \-\-patched\-tag \fItag-name\fP
.TP
.B \-\-upstream\-tag \fItag-name\fP
Specify the names of the tags to generate.
.RS
.HP
\fB%p\fP is replaced with the package name,
.HP
\fB%v\fP with the version (without epoch) with colons (:) and tilde (~) replaced by underscore (_),
.HP
\fB%u\fP with the upstream version (without epoch or Debian revision) with colons (:) and tilde (~) replaced by underscore (_),
.HP
\fB%e\fP with the epoch,
.HP
\fB%f\fP with the epoch followed by an underscore (_) if there is an epoch, and with the empty string if there is no epoch,
.HP
\fB%V\fP with the version (without epoch) with colons (:) and tilde (~) replaced by dots (.),
.HP
\fB%U\fP with the upstream version (without epoch or Debian revision) with colons (:) and tilde (~) replaced with dots (.),
.HP
\fB%E\fP with the epoch followed by a dot if there is an epoch, and with the empty string if there is no epoch,
.HP
\fB%%\fP with a single \fB%\fP.
.RE
If one of those is not set via the command line option,
\fBgit config\fP is asked about value of \fBdpm.debianTag\fP, \fBdpm.patchedTag\fP or \fBdpm.upstreamTag\fP.
If that is also not set or the special value \fBAUTO\fP,
then debian/.git-dpm is scanned for a line of the form
\fBdebianTag="\fP\fIvalue\fP\fB"\fP,
\fBpatchedTag="\fP\fIvalue\fP\fB"\fP or
\fBupstreamTag="\fP\fIvalue\fP\fB"\fP.
(Note: always add those to the end of the file, the first eight lines have fixed line numbers)
If this still does not result in an pattern to use,
the defaults are '\fB%p\-debian%e\-%v\fP', '\fB%p\-patched%e\-%v\fP' and '\fB%p\-upstream%e\-%u\fP' with \fB\-\-named\fP
and '\fBdebian%e\-%v\fP', '\fBpatched%e\-%v\fP' and '\fBupstream%e\-%u\fP' without.
If a tag name has the special value \fBNONE\fP, no tag is generated.
.RE
.TP
.B ref\-tag \fR[ \fP\fIoptions\fP \fR]\fP \fIcommit\fP \fR[\fP \fIversion\fP \fR]\fP
Like \fBtag\fP, but create tags for \fIcommit\fP, i.e.
\fIcommit\fP will get the Debian tag and the other tags
are placed where the \fBdebian/.git\-dpm\fP file of that
commit points to.
So it is mostly equivalent to:
\fBgit checkout \-b temp \fP\fIcommit\fP
\fBgit\-dpm tag \fR[\fP\fIoptions\fP\fR]\fP \fP\fR[\fP\fIversion\fP\fR]\fP
\fBgit checkout \fP\fIprevious-head\fP
\fBgit branch \-D temp\fP
Options like \fBtag\fP.
.TP
.B apply\-patch \fR[\fP \fIoptions...\fP \fR]\fP \fR[\fP \fIfilename\fP \fR]\fP
Switch to the patched branch (assuming it is up to date,
use checkout\-patched first to make sure or get an warning),
and apply the patch given as argument or from stdin.
.RS
.TP
.B \-\-author "\fIauthor <email>\fP"
Override the author to be recorded.
.TP
.B \-\-defaultauthor "\fIauthor <email>\fP"
If no author could be determined from the commit,
use this.
.TP
.B \-\-date "\fIdate\fP"
Date to record this patch originally be from if non found.
.TP
.B \-\-dpatch
Parse patch as dpatch patch
(Only works for dpatch patches actually being a patch, might silently fail for others).
.TP
.B \-\-cdbs
Parse patch as cdbs simple\-patchsys.mk patch
(Only works for dpatch patches actually being a patch, might silently fail for others).
.TP
.B \-\-edit
Start an editor before doing the commit (In case you are too lazy to amend).
.TP
.B \-\-record\-name
Add a \fBPatch-Name:\fP field to tell \fBupdate\-patches\fP to export it
with the same name again.
.TP
.B \-\-name \fIname\fP
Add a \fBPatch\-Name:\fP field to tell \fBupdate\-patches\fP to use \fIname\fP
as filename to store this patch into (relative to \fBdebian/patches\fP).
.TP
.B \-\-category \fIname\fP
Add a \fBPatch\-Category:\fP field to tell \fBupdate\-patches\fP to always
export this patch into a subdirectory \fIname\fP of \fBdebian/patches\fP.
.RE
.TP
.B cherry\-pick \fR[\fP \fIoptions...\fP \fR]\fP \fIcommit\fP
Recreate the patched branch and cherry\-pick the given commit.
Then merge that back into the Debian branch and update the debian/patches
directory (i.e. mostly equivalent to checkout\-patched, git's cherry\-pick,
and update\-patches).
.RS
.TP
.B \-\-merge\-only
Only merge the patched branch back into the Debian branch but do not
update the patches directory (You'll need to run update\-patches later
to get this done).
.TP
.B \-e \fR|\fP \-\-edit
Passed to git's cherry\-pick: edit the commit message picked.
.TP
.B \-s \fR|\fP \-\-signoff
Passed to git's cherry\-pick: add a Signed\-off\-by header
.TP
.B \-x
Passed to git's cherry\-pick: add a line describing what was picked
.TP
.B \-m \fInum\fP \fR|\fP \-\-mainline \fInum\fP
Passed to git's cherry\-pick:
allow picking a merge by specifying the parent to look at.
.TP
.B \-\-repick
Don't abort if the specified commit is already contained.
.TP
.BR \-\-allow\-nonlinear ", " \-\-ignore\-deletions ", " \-\-dot\-git\-files=
Passed to update\-patches, if called.
passed to merge\-patched\-into\-debian and update\-patches.
.TP
.B \-\-keep\-branch
do not remove the patched branch when it is no longer needed.
.TP
.B \-\-amend
passed to merge\-patched\-into\-debian:
amend the last commit in the Debian branch.
.RE
.TP
.B import\-dsc
Import a Debian source package from a .dsc file.
This can be used to create a new project or to import a source package
into an existing project.
While a possible old state of a project is recorded as parent commit,
the state of the old Debian branch is not taken into account.
Especially all file deletions and .gitignore files and the like need
to be reapplied/re-added afterwards.
(Assumption is that new source package versions from outside might change
stuff significantly, so old information might more likely be outdated.
And reapplying it is easier then reverting such changes.)
First step is importing the \fB.orig.tar\fP file
and possible \fB.orig\-\fP\fIcomponent\fP\fB.tar\fP files.
You can either specify a branch to use.
Otherwise \fBimport\-dsc\fP will look if the previous state of this project
already has the needed file so the old upstream branch can be reused.
If there is non, the file will be imported as a new commit,
by default with a possible previous upstream branch as parent.
Then \fBimport\-dsc\fP will try to import the source package in the state
as \fBdpkg\-source \-x\fP would create it.
(That is applying the .diff and making \fBdebian/rules\fP executable for
1.0 format packages and replacing the \fBdebian\fP directory with the
contents of a .debian.tar and applying possible \fBdebian/patches/series\fP
for 3.0 format packages).
This is later referred to as verbatim import.
If it is a 1.0 source format package, \fBimport\-dsc\fP then looks for
a set of supported patch systems and tries to apply those patches.
Those are then merged with the verbatim state into the new Debian branch.
Then a \fBdebian/.git\-dpm\fP file is created and a possible old state of
the project added as parent.
Note that \fBdpkg\-source\fP is not used to extract packages,
but they are extracted manually.
Especially \fBgit\-apply\fP is used instead of \fBpatch\fP.
While this generally works (and \fBgit\-dpm\fP has some magic to
work around some of \fBgit\-apply\fP's shortcomings),
unclean patches might sometimes need a \fB\-C0\fP option and then
in same cases be applied at different positions than where \fBpatch\fP
would apply them.
General options:
.RS
.TP
.B \-b \fR|\fP \-\-branch \fIbranch-name\fP
Don't look at the current HEAD, but import the package into the git\-dpm
project \fIbranchname\fP or create a new project (if that branch does not
yet exist).
.TP
.B \-\-verbatim \fIbranch-name\fP
After \fBimport\-dsc\fP has completed successfully, \fIbranch-name\fP will
contain the verbatim import of the .dsc file.
If a branch of that name already exists, the new verbatim commit will also
have the old as parent.
(This also causes the verbatim commit not being amended with other changes,
which can result in more commits).
.TP
.B \-\-use\-changelog
Parse debian/changelog of the imported package.
Use the description as commit messages and the author and time
as default for patches and import commits without that information.
(Warning: may still contain some rough edges).
.RE
.RS
Options about creating the upstream branch:
.TP
.B \-\-upstream\-to\-use \fIcommit\fP
Do not import the .orig.tar nor try to reuse an old import,
but always use the \fIcommit\fP specified.
It is your responsibility that this branch is
similar enough to the .orig.tar file plus possible .orig\-component.tar
in their respective directories.
(As usual, similar enough means:
Does not miss any files that your patches touch or your build process requires
(or recreates unless \fBdebian/rules clean\fP removes them again).
Every file different than in .orig.tar or not existing there you must delete
in the resulting Debian branch. No patch may touch those files.)
Use with care.
Nothing will warn you even if you use the contents of a totally
wrong upstream version.
.TP
.B \-\-detached\-upstream
If importing a .orig.tar as new commit,
do not make an possible commit for an old upstream version parent.
.TP
.B \-\-upstream\-parent \fIcommit\fP
Add \fIcommit\fP as (additional) parent if importing a new upstream version.
(This can for example be used to make upstream's git history part of your
package's history and thus help git when cherry-picking stuff).
.TP
.B \-\-allow\-no\-parent
If dpm.importWithoutParent is set to false via git config,
git\-dpm will not allow import\-dsc to be run without
this option or at least on \-\-upstream\-parent option.
.TP
.B \-\-pristine\-tar\-commit \fR|\fP\-\-ptc
Call \fBpristine\-tar commit\fP for all tarballs imported after the
rest of the import\-dsc command was successful.
.TP
.B \-\-no\-pristine\-tar\-commit
Do not call \fBpristine\-tar commit\fP for all imported tarballs even
if configured to do so by
\fBgit config dpm.pristineTarCommit true\fP
or by
\fBgit config branch.\fPdebianbranch\fB.dpmPristineTarCommit true\fP.
.TP
.B \-\-upstream\-author \fIauthor\fP
Used as the \fB\-\-author\fP argument to \fBgit\-dpm import\-tar\fP.
.TP
.B \-\-upstream\-date \fIdate\fP
Used as the \fB\-\-date\fP argument to \fBgit\-dpm import\-tar\fP
(especially \fBauto\fP is supported to extract a date from the tar file).
.TP
.B \-\-tar-exclude \fIpattern\fP
The given pattern is passed to tar as exclude pattern when unpacking tarfiles.
Can be given multiple times.
.RE
.RE
.RS
Options about applying patches:
.TP
.B \-f \fR|\fP \-\-force\-commit\-reuse
Only look at parent and tree and no longer at the description
when trying to reuse commits importing patches from
previous package versions.
.TP
.B \-C\fInum\fP \fR|\fP \-\-patch\-context \fInum\fP
Passed as \fB\-C\fP\fInum\fP to \fBgit\-apply\fP.
Specifies the number of context lines that must match.
.TP
.B \-\-dpatch\-allow\-empty
Do not error out if a dpatch file does not change anything
when treated as patch.
As dpatch files can be arbitrary scripts, \fBgit\-dpm\fP has
some problems detecting if they are really patches.
(It can only cope with patches).
If a script that is not a patch is treated as patch
that usually results in patch not modify anything,
thus those are forbidden without this option.
.TP
.B \-\-patch\-system \fImode\fP
Specify what patch system is used for source format 1.0 packages.
.RS
.TP
.B auto \fR(this is the default)\fP
Try to determine what patch system is used by looking at \fBdebian/rules\fP
(and \fBdebian/control\fP).
.TP
.B none
Those are not the patches you are looking for.
.TP
.B history
Don't try to find any patches in the .diff (like \fBnone\fP).
If if the project already exists and the upstream tarball is the same,
create the patched state of the new one by using the patches of the old
one and adding a patch of top bringing it to the new state.
If you import multiple revisions of some package, where each new
revision added at most a single change to upstream, this option allows you
to almost automatically create a proper set of patches (ideally only missing
descriptions).
If there are same changes and reverts those will be visible in the patches
created, so this mode is not very useful in that case.
.TP
.B quilt
Extract and apply a \fBdebian/patches/series\fP quilt like series on top
of possible upstream changes found in the .diff file.
.TP
.B quilt\-first
As the \fBquilt\fP mode, but apply the patches to an unmodified upstream
first and then cherry\-pick the changes found in the .diff file.
As this is not the order in which patches are applied in a normal
unpack/build cycle, this will fail if those changes are not distinct enough
(for example when patches depend on changes done in the .diff).
But if the .diff only contains unrelated changes which varies with each
version, this gives a much nicer history, as the commits for the patches
can more easily be reused.
.TP
.B quilt\-applied
As the \fBquilt\-first\fP mode, but assume the patches are already applied
in the .diff, so apply them on top of an unmodified upstream and then add
a commit bringing it to the state in the .diff.
(Or not if that patch would be empty).
.TP
.B dpatch \fR|\fP dpatch\-first \fR|\fP dpatch\-applied
Like the \fBquilt\fP resp. \fBquilt\-first\fP resp. \fBquilt\-applied\fP modes,
but instead look for dpatch-style patches in \fBdebian/patches/00list\fP.
Note that only patches are supported and not dpatch running other commands.
.TP
.B simple \fR|\fP simple\-first \fR|\fP simple\-applied
Like the \fBquilt\fP resp. \fBquilt\-first\fP resp. \fBquilt\-applied\fP modes,
but instead assume \fBdebian/patches/\fP contains patches suitable for
cdbs's \fBsimple\-patchsys.mk\fP.
.RE
.TP
.B \-\-patch\-author \fR"\fP\fIname \fP\fR<\fP\fIemail\fP\fR>\fP\fR"\fP
Set the author for all git commits importing patches.
.TP
.B \-\-patch\-default\-author \fR"\fP\fIname \fP\fR<\fP\fIemail\fP\fR>\fP\fR"\fP
Set an author for all patches not containing author information
(or where \fBgit\-dpm\fP cannot determine it).
.TP
.B \-\-edit\-patches
For every patch imported, start an editor for the commit message.
.TP
.B \-\-record\-patch\-category
Add a \fBPatch\-Category:\fP field to each imported patch that is
in a subdirectory of \fBdebian/patches\fP.
This causes \fBupdate\-patches\fP to store it in the same subdirectory.
.TP
.B \-\-record\-patch\-name
Add a \fBPatch\-Name:\fP field to each imported patch with its name.
This causes \fBupdate\-patches\fP to store it under its original name.
.RE
.TP
.B record\-dsc \fR[\fP\fIoptions\fP\fR]\fP \fIcommit\fP \fI.dsc-file\fP
Store a pristine .dsc file in a \fBdscs\fP branch after storing the
files it contains using pristine\-tar.
The first argument is an tag or commit storing the \fBgit\-dpm\fP
project in the state belonging to the \fB.dsc\fP file and the
second argument is the \fB.dsc\fP file itself.
The files it references are expected in the same directory as the
file itself (if they are needed).
Some checks are done to make sure the file and its contents are named
properly and match the commit in question, but only cursory to avoid
obvious mistakes (for example only the version is checked, but .debian.tar
is not unpacked to check the files are really the same, for example).
Options:
.RS
.TP
.B \-\-create\-branch
Create a new \fBdscs\fP branch.
.TP
.B \-\-allow\-unsigned
Allow recording a unsigned \fB.dsc\fP file.
This usually defeats the point of storing them at all.
.RE
.SH the debian/.git\-dpm file
You should not need to know about the contents if this file except for
debugging git\-dpm.
The file contains 8 lines, but future version may contain more.
The first line is hint what this file is about and ignored.
Then there are 4 git commit ids for the recorded states:
.RS
First the state of the patched branch when the patches in \fBdebian/patches\fP
were last updated.
Then the state of the patched branch when it was last merged into the
Debian branch.
Then the state upstream branch when the patched branch was last merged.
Finally the upstream branch.
.RE
The following 3 lines are the filename, the sha1 checksum and the size
of the origtarball belonging to the recorded upstream branch.
.SH SHORTCUTS
Most commands also have shorter aliases, to avoid typing:
update\-patches: up, u\-p, ci
prepare: prep
checkout\-patched: co, c\-p
rebase\-patched: r\-p
apply\-patch: a\-p
import\-tar: i\-t
import\-new\-upstream: i\-n\-u, inu
record\-new\-upstream: r\-n\-u, rnu
merge\-patched\-in\-debian: merge\-patched
record\-new\-upstream is also available under the old name new\-upstream,
though likely will be removed in future versions (to avoid confusion).
.SH BRANCHES
.IP "the upstream branch (\fBupstream\fP|\fBupstream\-\fP\fIwhatever\fP)"
This branch contains the upstream sources.
It contents need to be equal enough to the contents in your upstream tarball.
Equal enough means that dpkg\-source should see no difference between your
patched tree and and original tarball unpackaged, the patched applied and
\fBdebian/rules clean\fP run.
Usually it is easiest to just store the verbatim
contents of your orig tarball here.
Then you can also use it for pristine tar.
This branch may contain a debian/ subdirectory, which will usually be just ignored.
You can either publish that branch or make it only implicitly visible via the
\fBdebian/.git\-dpm\fP file in the Debian branch.
While it usually makes sense that newer upstream branches contain older ones,
this is not needed.
You should be able to switch from one created yourself
or by some foreign-vcs importing tool generated one to an native upstream
branch or vice versa without problems.
Note that since the Debian branch has the patched branch as ancestor
and the patched branch the upstream branch, your upstream branches are part
of the history of your Debian branch.
Which has the advantage that you
can recreate the exact state of your branches from your history directly
(like \fBgit checkout \-b oldstate \fP\fImyoldtagorshaofdebianbranchcommit\fP\fB ; git\-dpm prepare ; git checkout unstable\-oldstate\fP)
but the disadvantage that to remove those histories from your repository you
have to do some manual work.
.IP "the patched branch (\fBpatched\fP|\fBpatched\-\fP\fIwhatever\fP)"
This branch contains your patches to the upstream source.
(which of course means it is based on your upstream branch).
Every commit will be stored as a single patch in the resulting package.
To help git generate a linear patch series, this should ideal be a
linear chain of commits, whose description are helpful for other people.
As this branch is regularly rebase d, you should not publish it.
Instead you can recreate this branch using \fBgit\-dpm checkout\-patched\fP
using the information stored in \fBdebian/.git\-dpm\fP.
You are not allowed to change the contents of the \fBdebian/\fP subdirectory
in this branch.
Renaming files or deleting files usually causes unnecessary large
patches.
.IP "the Debian branch (\fBmaster\fP|\fIwhatever\fP)"
This is the primary branch.
This branch contains the \fBdebian/\fP directory and has the patched
branch merged in.
Every change not in \fBdebian/\fP, \fB.git\fP\fI*\fP or deleting files
must be done in the patched branch.
.IP "alternative branch names"
You can specify alternate branch names for upstream and patched branches
of a specific Debian branch, or force a branch to be a Debian branch that
would normally be considered e.g. upstream branch of another branch by
adding \fBdpmUpstreamBranch\fP and \fBdpmPatchedBranch\fP configure items
for the Debian branch in question (you need both, only one is treated as
error).
The following example is a no-op for all practical purposes:
\fBgit config branch.master.dpmUpstreamBranch upstream\fP
\fBgit config branch.master.dpmPatchedBranch patched\fP
.SH COPYRIGHT
Copyright \(co 2009,2010 Bernhard R. Link
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|