Changes between Version 6 and Version 7 of CommitMessages
- Timestamp:
- Nov 1, 2016, 9:00:15 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CommitMessages
v6 v7 8 8 9 9 10 === Using sensible commit messages === 10 === Using sensible commit messages === #messages 11 11 12 When committing your changes to MacPorts' central port tree using subversionit is good practice to use properly formatted commit messages.12 When publishing your changes in MacPorts' ports tree, it is good practice to use properly formatted commit messages. 13 13 14 Think about others reading the [/timeline timeline] . Here you want to see on first glance which port got modified, therefore the recommended format for commit messages is this:14 Think about others reading the [/timeline timeline] or viewing `git log --oneline`. Here you want to see on first glance which port got modified, therefore the recommended format for commit messages is this: 15 15 {{{ 16 PORTNAME: COMMENT 16 portname: summary, max 50 characters 17 18 A longer, optional comment may follow after a blank line, explaining 19 all of your changes. Git will not wrap paragraphs automatically, so it 20 is generally recommended to wrap long lines at 72 characters, which is 21 a limit inherited from email. 17 22 }}} 18 23 Here a reader of MacPorts' timeline can quickly get the most important information, i.e. ''which'' port got changed and ''why''. … … 20 25 A real-life example is: 21 26 {{{ 22 zmq: Fix build on darwin <= 10, closes #40663 27 zmq: fix build on macOS 10.12 28 29 This fixes a build failure on macOS 10.12 Sierra by backporting a patch 30 from upstream. 31 32 Closes https://trac.macports.org/ticket/40663 23 33 }}} 24 Note that references to [wiki:Tickets Trac tickets] can be inserted using the '#' as well as references to certain commits of the MacPorts repository by using 'r' (e.g. r111866).34 References to [wiki:Tickets Trac tickets] can only be inserted with the full URL. The '#' syntax is reserved for pull requests on GitHub. 25 35 26 36 If a change affects multiple ports, list all affected ports. If a change affects a large number of ports, listing their names is not necessary. 27 37 28 === Correcting mistakes === 38 Further reading explaining these rules: 39 * http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 40 * http://chris.beams.io/posts/git-commit/ 29 41 30 If you make a mistake in the commit message, our svn repository is configured so that you can edit it after the fact via 42 === Correcting mistakes === #amend 43 44 If you have '''already pushed''' the commit to GitHub, the commit message can no longer be changed. You may add a comment on GitHub to the commit to clarify your mistake. 45 46 If you have '''not yet pushed''' the commit, and only when you have not yet pushed it, the last commit you made can still be edited with: 31 47 {{{ 32 svn propedit --revprop svn:log -r XXX 48 git commit --amend 33 49 }}} 34 (replacing XXX with the revision number).50 Please note again: this will change the hash of the commit. This can only be used on local commits that were not yet pushed to GitHub.