From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
We prefer that each checkin be of a complete, single logical change, which may affect multiple files. The log message for that -checkin should be the complete ChangeLog entry for the change. This +checkin should be a summary line (often the subject line of the email) +followed by a blank line, then any discussion of the patch, and then +the complete ChangeLog entry for the change. This makes it easier to correlate changes across files, and minimizes the time the repository is inconsistent. If you have several unrelated changes, you should check them in separately.
@@ -283,20 +285,58 @@ again.To create a branch for development, you can use git
-push
as follows:
Git makes it very easy and cheap to create local branches for working on +separate changes. To switch to a new local branch starting from your current +HEAD, do
+ +If the branch is based on GCC master, you can set it up to rebase automatically +with + +-git push origin master:devel/$BRANCH +git checkout -b $BRANCH +
+ ++git branch -u origin/master +git config branch.$BRANCH.rebase true +
To share a long-lived development branch publicly for collaboration with
+other developers, you can use git push
as follows:
+git push origin $BRANCH:devel/$BRANCH
Also, please document such branches at the list of development branches.
-When merging changes from mainline (or another branch) to a branch, -do not copy the entire set of ChangeLog entries. Just use something -like "Merge from mainline" or similar.
+Shared development branches should not rebase; instead, merge master in by
+hand occasionally as needed with a normal git merge master
. But
+DO NOT then simply merge the branch back onto master; see below.
Every commit in the history of GCC master must follow the testing guidelines
+above; when a development branch is ready to move into master, do not do a
+simple git merge and push that onto master. Instead, invoke merge
+with --squash
:
+ ++git merge --squash $BRANCH +
This readies a single normal commit with the effect of the merge. If the
+merge can logically be divided into a series of commits that each pass testing,
+you can use git tools like git reset -p
to break up the changes
+accordingly. It may be easier to cherry-pick some smaller changes onto master
+ before doing the merge --squash
.
For personal development branches that are already rebased on master you
+don't need to merge --squash
squash, but still need to make sure
+the commits on the branch satisfy the above rules for commits.
If you are behind a firewall that does not allow the git protocol
through, you can replace git://
with https://
.
-
When doing multiple clones to several local repositories you can avoid +
If there is another local repository accessible you can avoid
re-downloading everything by using --reference
, e.g.
git clone --reference original-gcc ssh://gcc.gnu.org/git.gcc.git new-gcc
+git clone --reference original-gcc --dissociate ssh://gcc.gnu.org/git.gcc.git new-gcc
-This will also save disk space. Git will do this automatically when cloning
-from a local repository on the same file system. It is also possible to do a
-shallow checkout with --depth
to limit history, but that might
-limit your ability to work with existing branches.
-
-(Only use the https protocol if the git protocol does not work; https has
-a higher server overhead and will be slower.)
But if you own this other copy, you probably want to use +separate worktrees instead of multiple clones.