Changes between Version 6 and Version 7 of CommitMessages


Ignore:
Timestamp:
Nov 1, 2016, 9:00:15 PM (7 years ago)
Author:
raimue (Rainer Müller)
Comment:

Adapt the commit rules for use with Git and GitHub

Legend:

Unmodified
Added
Removed
Modified
  • CommitMessages

    v6 v7  
    88
    99
    10 === Using sensible commit messages ===
     10=== Using sensible commit messages === #messages
    1111
    12 When committing your changes to MacPorts' central port tree using subversion it is good practice to use properly formatted commit messages.
     12When publishing your changes in MacPorts' ports tree, it is good practice to use properly formatted commit messages.
    1313
    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:
     14Think 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:
    1515{{{
    16 PORTNAME: COMMENT
     16portname: summary, max 50 characters
     17
     18A longer, optional comment may follow after a blank line, explaining
     19all of your changes. Git will not wrap paragraphs automatically, so it
     20is generally recommended to wrap long lines at 72 characters, which is
     21a limit inherited from email.
    1722}}}
    1823Here a reader of MacPorts' timeline can quickly get the most important information, i.e. ''which'' port got changed and ''why''.
     
    2025A real-life example is:
    2126{{{
    22 zmq: Fix build on darwin <= 10, closes #40663
     27zmq: fix build on macOS 10.12
     28
     29This fixes a build failure on macOS 10.12 Sierra by backporting a patch
     30from upstream.
     31
     32Closes https://trac.macports.org/ticket/40663
    2333}}}
    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).
     34References to [wiki:Tickets Trac tickets] can only be inserted with the full URL. The '#' syntax is reserved for pull requests on GitHub.
    2535
    2636If a change affects multiple ports, list all affected ports. If a change affects a large number of ports, listing their names is not necessary.
    2737
    28 === Correcting mistakes ===
     38Further 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/
    2941
    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
     44If 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
     46If 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:
    3147{{{
    32 svn propedit --revprop svn:log -r XXX
     48git commit --amend
    3349}}}
    34 (replacing XXX with the revision number).
     50Please 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.