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.

  • Git: Run through a filter before commiting/pushing?
  • Checking in of “commented out” code
  • Why maintain traditional detailed ChangeLog in modern world (with SVN, Mercurial, Git)?
  • Are there any free cmd-line scripts which can re-format PHP source-code?
  • How do I show that I'm getting the smallest number of conflicts with Git by using K&R instead of B&D as the coding standard?
  • How to fix:code indent should never use tabs in Vi
  • So which one do you prefer? and why?

  • Auto deployment with Git and Rails, How does it work?
  • Git keyword-expansion or alternative
  • git push error: HTTP request failed: The requested URL returned 504
  • Eclipse + Maven Plugin + EGit Plugin = Checkout from GitHub a specific Branche and Tag?
  • How do annotate a git repository?
  • Intellij - How to squash local branch only
  • 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.