Which style do you use for your commit messages? Technical or feature-based?

Lets say you are working on a some type of web applications. Here are the 2 different versions of commit messages for the same change set.

  1. Redirect user to user_profile for public controllers -or- Restrict logged in user acces to public controllers
  2. Add require_guest before filter to necessary controllers

The first one explains what is the result of this change and the second one basically explains how you achieved this or what you have changed.

  • Should commit messages be written in present or past tense?
  • How to accommodate multiple coding styles? (git vs. IDE)
  • Checking in of “commented out” code
  • Why is indentation in empty lines bad?
  • Git: Run through a filter before commiting/pushing?
  • Why maintain traditional detailed ChangeLog in modern world (with SVN, Mercurial, Git)?
  • So which one do you prefer? and why?

  • keep git files in another folder
  • How to fix stale git branch -r (delete phantom git branches)?
  • Strange behavior with git fetch
  • GITHUB setup - no address associated with name
  • svn doesn't commit .o files, but why?
  • How to make pull request to Visual Studio Online
  • 3 Solutions collect form web for “Which style do you use for your commit messages? Technical or feature-based?”

    DRY applies for commit messages, so don’t repeat anything that you can see from the code/diff.

    Create context instead: Mention the ticket number which caused the change, explain why you did it, give a 10’000 feet view of the change.

    Example: “Make sure only verified users can access private pages” instead of “Added calls to AccessController”. I can see the latter from the diff but the diff doesn’t explain why you did the change.

    I’d rather have a commit message that mentions both ends of the connection:

    New require_guest before filter redirects users to
    user_profile for public controllers

    you should probably mention both, and also a ticket number, in case you use something like Trac or RedMine

    Git Baby is a git and github fan, let's start git clone.