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?
  • Git: Run through a filter before commiting/pushing?
  • Reject commit in Git if Java code style isn't correct
  • Are there any free cmd-line scripts which can re-format PHP source-code?
  • Where to hook a coding convention script?
  • Why is indentation in empty lines bad?
  • So which one do you prefer? and why?

  • “fatal: tag 'someTag' already exists”, when trying to add a tag to old commits
  • After filtering master, how do I retrieve stashed changes on the old master?
  • Git Extensions doesn't show up in VS 2010 after installing
  • Renaming a branch in github
  • How to switch android version in local repo?
  • Git rename detection when class and filename changed in one commit
  • 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.