Changes between Version 19 and Version 20 of GitTips


Ignore:
Timestamp:
11/17/2016 12:07:36 AM (7 years ago)
Author:
Cas
Comment:

update git commit message details

Legend:

Unmodified
Added
Removed
Modified
  • GitTips

    v19 v20  
    166166This should probably have it's own page but putting here for now. 
    167167}}} 
    168 Mainly based on [http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines git commit guidelines]. 
     168Based on [http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines git commit guidelines] and [http://chris.beams.io/posts/git-commit/ How to Write a Git Commit Message]. 
     169 
     170The short answer on the golden rule for git commit subject lines is to you ask yourself: 
     171  '''If applied, this commit will...''' ''<your commit subject line here>''[[br]][[br]] 
     172  e.g. If applied, this commit will {{{Enable editing of torrent names in Add Dialog}}} 
     173 
     174A general guideline on writing a good commit message is to provide information 
     175that is not already provided from the commit diff, which in essence is "''the why, not the how''". 
     176 
     177 * Explain why the change is necessary 
     178   * ''After reading the commit message it should should be apparent why the changes were made.'' 
     179 
     180 * Explain how the issue is addressed in broad terms 
     181  * ''It is not necessary to explain how the changes are made in detail as that can be seen from the commit diff.'' 
    169182 
    170183Example commit message: 
     
    186199}}} 
    187200 
    188 A general guideline on writing a good commit message is to provide information 
    189 that is not already provided from the commit diff, which in essence is "''the why, not the how''". 
    190  
    191  * Explain why the change is necessary 
    192  
    193  After reading the commit message it should should be apparent why the changes were made. 
    194  
    195  * Explain how the issue is adressed in broad terms 
    196  
    197  It is not necessary to explain how the changes are made in detail as that can be seen from the commit diff. 
    198  
    199  
    200201=== Tags / Labels === 
    201 To differentiate commit changes at a glance, the subject of commits for specific components should be prefixed with relevant tags/labels, such as 
    202  
    203 ''Core'', ''WebUI'', ''GTKUI'', ''Tests'', ''win32'', ''Packaging'', ''Console'', ''Blocklist'' etc. 
    204  
    205 {{{[GTKUI] Make Add Dialog torrent name editable}}} 
     202To differentiate commit changes at a glance, the subject of commits for specific components should be prefixed with relevant tags/labels, such as: 
     203 ''Core'', ''WebUI'', ''GTKUI'', ''Tests'', ''Packaging'', ''Console'', ''Blocklist'', ''Lint'' etc. (see git logs for more examples) 
     204 
     205{{{[GTKUI] Enable editing of torrent names in Add Dialog}}} 
    206206 
    207207If the commit fix/closes a ticket, include the number: 
     
    213213{{{[#1002] [GTKUI] Fix the files tab context menu not being displayed}}} 
    214214 
    215 {{{[#2250] [Core] [GTKUI] Added method remove_torrents to core}}} 
    216  
    217  
     215{{{[#2250] [Core] [GTKUI] Add method remove_torrents to core}}} 
     216 
     217