diff --git a/documentation/content/en/books/porters-handbook/upgrading/_index.adoc b/documentation/content/en/books/porters-handbook/upgrading/_index.adoc --- a/documentation/content/en/books/porters-handbook/upgrading/_index.adoc +++ b/documentation/content/en/books/porters-handbook/upgrading/_index.adoc @@ -113,11 +113,13 @@ [[git-diff]] == Using Git to Make Patches -When possible, please submit a man:git[1] diff. +When possible, please submit a man:git[1] patch or diff. They are easier to handle than diffs between "new and old" directories. It is easier to see what has changed, and to update the diff if something was modified in the Ports Collection since the work on it began, or if the committer asks for something to be fixed. -Also, a patch generated with `git diff` can be easily applied with `git apply` and will save some time to the committer. +Also, a patch generated with man:git-format-patch[1] or man:git-diff[1] can be easily applied with man:git-am[1] or man:git-apply[1] and will save some time for the committer. +Finally, the git patch generated by man:git-format-patch[1] includes your author information and commit messages. +These will be recorded in the log of the repository and this is the recommended way to submit your changes. [source,shell] .... @@ -159,12 +161,37 @@ % git diff --staged .... -The last step is to make a unified man:diff[1] of the changes: +The last step is to make an unified diff or patch of the changes: +To generate an unified diff with man:git-diff[1]: [source,shell] .... % git diff --staged > ../`make -VPKGNAME`.diff .... +This will generate a diff named like `foo-1.2.3.diff`. +Where `foo` is replaced with the first line of the commit message, i.e., the subject of the commit message. + +To generate a patch with man:git-format-patch[1]: +[source,shell] +.... +% git checkout -b my_branch +% git commit +% git format-patch main +.... + +This will generate a patch named like `0001-foo.patch`. + +After patch has been created, you can switch to the main branch for starting other developments. +[source,shell] +.... +% git checkout main +.... + +Once the patch is accepted and merged, you can delete the local development branch if you want: +[source,shell] +.... +% git branch -D my_branch +.... [NOTE] ====