[MacPorts] CommitMessages modified

MacPorts Wiki noreply at macports.org
Wed May 1 19:42:43 UTC 2019


Page "CommitMessages" was changed by cjones051073
Diff URL: <https://trac.macports.org/wiki/CommitMessages?action=diff&version=25>
Revision 25
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: CommitMessages
=========================================================================
--- CommitMessages (version: 24)
+++ CommitMessages (version: 25)
@@ -58,7 +58,8 @@
 Unlike Subversion, which stores changeset logs as mutable [http://svnbook.red-bean.com/en/1.7/svn.advanced.props.html properties], Git commit messages are integral parts of [https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#Commit-Objects commit objects], which are immutable. Correcting a commit's message replaces the commit and all its descendants with new commits (because every commit contains the [[span(SHA-1, style=white-space: nowrap)]] hashes of its parents). This may or may not be a problem.
 
 - You can correct any commit you have not pushed to GitHub by [https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-the-Last-Commit amending it] or doing an [https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages interactive rebase]. It's good practice to review local commits before pushing them.
-- You cannot correct commits that you have already pushed. Comment on the commit's GitHub page instead. (Modifying your local history causes it to diverge from the public history. Publishing this alternate history would require force-pushing, which we [https://help.github.com/articles/about-protected-branches disallow] because it's [https://git-scm.com/book/en/v2/Git-Branching-Rebasing#The-Perils-of-Rebasing bad practice].)
+- You cannot correct commits that you have already pushed to the master branch. Comment on the commit's GitHub page instead. (Modifying your local history causes it to diverge from the public history. Publishing this alternate history would require force-pushing, which we [https://help.github.com/articles/about-protected-branches disallow] because it's [https://git-scm.com/book/en/v2/Git-Branching-Rebasing#The-Perils-of-Rebasing bad practice].)
+- On the other hand, its acceptable to modify commits made to a feature branch, for instance as part of the review of the GitHub PR where changes are requested and thus the commits need to be squashed to maintain a single clean commit for the PR changes. In this case you will need to force push the changes back to the feature branch on GitHub, at which point the PR will automatically pick up those changes.
 
 If you have a relatively recent Git, you can easily check whether a commit `deadb33f` is already in the history of a remote branch:
 {{{
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/CommitMessages>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'CommitMessages' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list