Skip to content

Commit 7149788

Browse files
authored
Merge pull request ceph#50723 from zdover23/wip-doc-2023-03-28-documenting-ceph-squashing
doc/start: documenting-ceph - add squash procedure Reviewed-by: Anthony D'Atri <[email protected]>
2 parents ef6b9ae + 71ee225 commit 7149788

File tree

1 file changed

+258
-0
lines changed

1 file changed

+258
-0
lines changed

doc/start/documenting-ceph.rst

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,264 @@ As noted earlier, you can make documentation contributions using the `Fork and
531531
Pull`_ approach.
532532

533533

534+
Squash Extraneous Commits
535+
-------------------------
536+
Each pull request ought to be associated with only a single commit. If you have
537+
made more than one commit to the feature branch that you are working in, you
538+
will need to "squash" the multiple commits. "Squashing" is the colloquial term
539+
for a particular kind of "interactive rebase". Squashing can be done in a great
540+
number of ways, but the example here will deal with a situation in which there
541+
are three commits and the changes in all three of the commits are kept. The three
542+
commits will be squashed into a single commit.
543+
544+
#. Make the first commit.
545+
546+
::
547+
548+
doc/glossary: improve "CephX" entry
549+
550+
Improve the glossary entry for "CephX".
551+
552+
Signed-off-by: Zac Dover <[email protected]>
553+
554+
# Please enter the commit message for your changes. Lines starting
555+
# with '#' will be ignored, and an empty message aborts the commit.
556+
#
557+
# On branch wip-doc-2023-03-28-glossary-cephx
558+
# Changes to be committed:
559+
# modified: glossary.rst
560+
#
561+
562+
#. Make the second commit.
563+
564+
::
565+
566+
doc/glossary: add link to architecture doc
567+
568+
Add a link to a section in the architecture document, which link
569+
will be used in the process of improving the "CephX" glossary entry.
570+
571+
Signed-off-by: Zac Dover <[email protected]>
572+
573+
# Please enter the commit message for your changes. Lines starting
574+
# with '#' will be ignored, and an empty message aborts the commit.
575+
#
576+
# On branch wip-doc-2023-03-28-glossary-cephx
577+
# Your branch is up to date with 'origin/wip-doc-2023-03-28-glossary-cephx'.
578+
#
579+
# Changes to be committed:
580+
# modified: architecture.rst
581+
582+
#. Make the third commit.
583+
584+
::
585+
586+
doc/glossary: link to Arch doc in "CephX" glossary
587+
588+
Link to the Architecture document from the "CephX" entry in the
589+
Glossary.
590+
591+
Signed-off-by: Zac Dover <[email protected]>
592+
593+
# Please enter the commit message for your changes. Lines starting
594+
# with '#' will be ignored, and an empty message aborts the commit.
595+
#
596+
# On branch wip-doc-2023-03-28-glossary-cephx
597+
# Your branch is up to date with 'origin/wip-doc-2023-03-28-glossary-cephx'.
598+
#
599+
# Changes to be committed:
600+
# modified: glossary.rst
601+
602+
#. There are now three commits in the feature branch. We will now begin the
603+
process of squashing them into a single commit.
604+
605+
#. Run the command ``git rebase -i main``, which rebases the current branch
606+
(the feature branch) against the ``main`` branch:
607+
608+
.. prompt:: bash
609+
610+
git rebase -i main
611+
612+
#. A list of the commits that have been made to the feature branch now
613+
appear, and looks like this:
614+
615+
::
616+
617+
pick d395e500883 doc/glossary: improve "CephX" entry
618+
pick b34986e2922 doc/glossary: add link to architecture doc
619+
pick 74d0719735c doc/glossary: link to Arch doc in "CephX" glossary
620+
621+
# Rebase 0793495b9d1..74d0719735c onto 0793495b9d1 (3 commands)
622+
#
623+
# Commands:
624+
# p, pick <commit> = use commit
625+
# r, reword <commit> = use commit, but edit the commit message
626+
# e, edit <commit> = use commit, but stop for amending
627+
# s, squash <commit> = use commit, but meld into previous commit
628+
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
629+
# commit's log message, unless -C is used, in which case
630+
# keep only this commit's message; -c is same as -C but
631+
# opens the editor
632+
# x, exec <command> = run command (the rest of the line) using shell
633+
# b, break = stop here (continue rebase later with 'git rebase --continue')
634+
# d, drop <commit> = remove commit
635+
# l, label <label> = label current HEAD with a name
636+
# t, reset <label> = reset HEAD to a label
637+
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
638+
# create a merge commit using the original merge commit's
639+
# message (or the oneline, if no original merge commit was
640+
# specified); use -c <commit> to reword the commit message
641+
# u, update-ref <ref> = track a placeholder for the <ref> to be updated
642+
# to this position in the new commits. The <ref> is
643+
# updated at the end of the rebase
644+
#
645+
# These lines can be re-ordered; they are executed from top to bottom.
646+
#
647+
# If you remove a line here THAT COMMIT WILL BE LOST.
648+
649+
Find the part of the screen that says "pick". This is the part that you will
650+
alter. There are three commits that are currently labeled "pick". We will
651+
choose one of them to remain labeled "pick", and we will label the other two
652+
commits "squash".
653+
654+
#. Label two of the three commits ``squash``:
655+
656+
::
657+
658+
pick d395e500883 doc/glossary: improve "CephX" entry
659+
squash b34986e2922 doc/glossary: add link to architecture doc
660+
squash 74d0719735c doc/glossary: link to Arch doc in "CephX" glossary
661+
662+
# Rebase 0793495b9d1..74d0719735c onto 0793495b9d1 (3 commands)
663+
#
664+
# Commands:
665+
# p, pick <commit> = use commit
666+
# r, reword <commit> = use commit, but edit the commit message
667+
# e, edit <commit> = use commit, but stop for amending
668+
# s, squash <commit> = use commit, but meld into previous commit
669+
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
670+
# commit's log message, unless -C is used, in which case
671+
# keep only this commit's message; -c is same as -C but
672+
# opens the editor
673+
# x, exec <command> = run command (the rest of the line) using shell
674+
# b, break = stop here (continue rebase later with 'git rebase --continue')
675+
# d, drop <commit> = remove commit
676+
# l, label <label> = label current HEAD with a name
677+
# t, reset <label> = reset HEAD to a label
678+
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
679+
# create a merge commit using the original merge commit's
680+
# message (or the oneline, if no original merge commit was
681+
# specified); use -c <commit> to reword the commit message
682+
# u, update-ref <ref> = track a placeholder for the <ref> to be updated
683+
# to this position in the new commits. The <ref> is
684+
# updated at the end of the rebase
685+
#
686+
# These lines can be re-ordered; they are executed from top to bottom.
687+
#
688+
# If you remove a line here THAT COMMIT WILL BE LOST.
689+
690+
#. Now we create a commit message that applies to all the commits that have
691+
been squashed together:
692+
693+
#. When you save and close the list of commits that you have designated for
694+
squashing, a list of all three commit messages appears, and it looks
695+
like this:
696+
697+
::
698+
699+
# This is a combination of 3 commits.
700+
# This is the 1st commit message:
701+
702+
doc/glossary: improve "CephX" entry
703+
704+
Improve the glossary entry for "CephX".
705+
706+
Signed-off-by: Zac Dover <[email protected]>
707+
708+
# This is the commit message #2:
709+
710+
doc/glossary: add link to architecture doc
711+
712+
Add a link to a section in the architecture document, which link
713+
will be used in the process of improving the "CephX" glossary entry.
714+
715+
Signed-off-by: Zac Dover <[email protected]>
716+
717+
# This is the commit message #3:
718+
719+
doc/glossary: link to Arch doc in "CephX" glossary
720+
721+
Link to the Architecture document from the "CephX" entry in the
722+
Glossary.
723+
724+
Signed-off-by: Zac Dover <[email protected]>
725+
726+
# Please enter the commit message for your changes. Lines starting
727+
# with '#' will be ignored, and an empty message aborts the commit.
728+
#
729+
# Date: Tue Mar 28 18:42:11 2023 +1000
730+
#
731+
# interactive rebase in progress; onto 0793495b9d1
732+
# Last commands done (3 commands done):
733+
# squash b34986e2922 doc/glossary: add link to architecture doc
734+
# squash 74d0719735c doc/glossary: link to Arch doc in "CephX" glossary
735+
# No commands remaining.
736+
# You are currently rebasing branch 'wip-doc-2023-03-28-glossary-cephx' on '0793495b9d1'.
737+
#
738+
# Changes to be committed:
739+
# modified: doc/architecture.rst
740+
# modified: doc/glossary.rst
741+
742+
#. The commit messages have been revised into the simpler form presented here:
743+
744+
::
745+
746+
doc/glossary: improve "CephX" entry
747+
748+
Improve the glossary entry for "CephX".
749+
750+
Signed-off-by: Zac Dover <[email protected]>
751+
752+
# Please enter the commit message for your changes. Lines starting
753+
# with '#' will be ignored, and an empty message aborts the commit.
754+
#
755+
# Date: Tue Mar 28 18:42:11 2023 +1000
756+
#
757+
# interactive rebase in progress; onto 0793495b9d1
758+
# Last commands done (3 commands done):
759+
# squash b34986e2922 doc/glossary: add link to architecture doc
760+
# squash 74d0719735c doc/glossary: link to Arch doc in "CephX" glossary
761+
# No commands remaining.
762+
# You are currently rebasing branch 'wip-doc-2023-03-28-glossary-cephx' on '0793495b9d1'.
763+
#
764+
# Changes to be committed:
765+
# modified: doc/architecture.rst
766+
# modified: doc/glossary.rst
767+
768+
#. Force push the squashed commit from your local working copy to the remote
769+
upstream branch. The force push is necessary because the newly squashed commit
770+
does not have an ancestor in the remote. If that confuses you, just run this
771+
command and don't think too much about it:
772+
773+
.. prompt:: bash $
774+
775+
git push -f
776+
777+
::
778+
779+
Enumerating objects: 9, done.
780+
Counting objects: 100% (9/9), done.
781+
Delta compression using up to 8 threads
782+
Compressing objects: 100% (5/5), done.
783+
Writing objects: 100% (5/5), 722 bytes | 722.00 KiB/s, done.
784+
Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
785+
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
786+
To github.com:zdover23/ceph.git
787+
+ b34986e2922...02e3a5cb763 wip-doc-2023-03-28-glossary-cephx -> wip-doc-2023-03-28-glossary-cephx (forced update)
788+
789+
790+
791+
534792

535793
Notify Us
536794
---------

0 commit comments

Comments
 (0)