From: Zac Dover Date: Tue, 28 Mar 2023 09:29:40 +0000 (+1000) Subject: doc/start: documenting-ceph - add squash procedure X-Git-Tag: v19.0.0~1499^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=71ee225d7b8bf54bd190a8b1f2422c6837601f16;p=ceph.git doc/start: documenting-ceph - add squash procedure Add a procedure to doc/start/documenting-ceph.rst that explains how to perform an interactive rebase to squash commits. Signed-off-by: Zac Dover --- diff --git a/doc/start/documenting-ceph.rst b/doc/start/documenting-ceph.rst index ac4fa63651d18..de5356ce3ef60 100644 --- a/doc/start/documenting-ceph.rst +++ b/doc/start/documenting-ceph.rst @@ -531,6 +531,264 @@ As noted earlier, you can make documentation contributions using the `Fork and Pull`_ approach. +Squash Extraneous Commits +------------------------- +Each pull request ought to be associated with only a single commit. If you have +made more than one commit to the feature branch that you are working in, you +will need to "squash" the multiple commits. "Squashing" is the colloquial term +for a particular kind of "interactive rebase". Squashing can be done in a great +number of ways, but the example here will deal with a situation in which there +are three commits and the changes in all three of the commits are kept. The three +commits will be squashed into a single commit. + +#. Make the first commit. + + :: + + doc/glossary: improve "CephX" entry + + Improve the glossary entry for "CephX". + + Signed-off-by: Zac Dover + + # Please enter the commit message for your changes. Lines starting + # with '#' will be ignored, and an empty message aborts the commit. + # + # On branch wip-doc-2023-03-28-glossary-cephx + # Changes to be committed: + # modified: glossary.rst + # + +#. Make the second commit. + + :: + + doc/glossary: add link to architecture doc + + Add a link to a section in the architecture document, which link + will be used in the process of improving the "CephX" glossary entry. + + Signed-off-by: Zac Dover + + # Please enter the commit message for your changes. Lines starting + # with '#' will be ignored, and an empty message aborts the commit. + # + # On branch wip-doc-2023-03-28-glossary-cephx + # Your branch is up to date with 'origin/wip-doc-2023-03-28-glossary-cephx'. + # + # Changes to be committed: + # modified: architecture.rst + +#. Make the third commit. + + :: + + doc/glossary: link to Arch doc in "CephX" glossary + + Link to the Architecture document from the "CephX" entry in the + Glossary. + + Signed-off-by: Zac Dover + + # Please enter the commit message for your changes. Lines starting + # with '#' will be ignored, and an empty message aborts the commit. + # + # On branch wip-doc-2023-03-28-glossary-cephx + # Your branch is up to date with 'origin/wip-doc-2023-03-28-glossary-cephx'. + # + # Changes to be committed: + # modified: glossary.rst + +#. There are now three commits in the feature branch. We will now begin the + process of squashing them into a single commit. + + #. Run the command ``git rebase -i main``, which rebases the current branch + (the feature branch) against the ``main`` branch: + + .. prompt:: bash + + git rebase -i main + + #. A list of the commits that have been made to the feature branch now + appear, and looks like this: + + :: + + pick d395e500883 doc/glossary: improve "CephX" entry + pick b34986e2922 doc/glossary: add link to architecture doc + pick 74d0719735c doc/glossary: link to Arch doc in "CephX" glossary + + # Rebase 0793495b9d1..74d0719735c onto 0793495b9d1 (3 commands) + # + # Commands: + # p, pick = use commit + # r, reword = use commit, but edit the commit message + # e, edit = use commit, but stop for amending + # s, squash = use commit, but meld into previous commit + # f, fixup [-C | -c] = like "squash" but keep only the previous + # commit's log message, unless -C is used, in which case + # keep only this commit's message; -c is same as -C but + # opens the editor + # x, exec = run command (the rest of the line) using shell + # b, break = stop here (continue rebase later with 'git rebase --continue') + # d, drop = remove commit + # l, label