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 `git apply` and will save some time to the committer. +Finally, the git patch includes your author information and commit messages. +These will be recorded in the log of the repository and is the recommended method to submit your changes. [source,shell] .... @@ -159,12 +161,32 @@ % 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`. + +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 that, you can switch to the main branch and delete the local develop branch if you want: + +[source,shell] +.... +% git checkout main +% git branch -D my_branch +.... [NOTE] ====