aizatto.com
  • aizatto.com
  • Table of Contents
  • Portfolio, Projects, Tools, Toys
  • Interview Guide
    • Choosing A Company
    • Job Boards
    • Practice
    • Technical Interview Cheatsheet
    • Interview Process
      • Questions to Ask
      • Coding
      • Soft Skills
      • Rejection
      • Negotiation / Deciding
      • Accepting, Joining
    • FAQ
  • Engineering Code
    • Communication
    • Different Types of Coding
    • Commit Messages
    • Reviewing Code
      • Requesting Changes
    • Writing Code
      • Consistency
      • Writing for a code base of 1,000,000+ Lines
      • Write Code Knowing It Will Be Refactored
      • Naming
        • Versioning
        • Create Searchable Names
      • Commenting
        • Don't commit commented code
      • Make It Easy To Reproduce
      • Scripts
      • 80 character limit
      • Exit Early
      • Be careful of enum in switch statements
      • Be careful about chaining conditions
      • Be careful of chaining ternary operators
      • Write Code Knowing You Will be Blamed
      • Hacks
      • Bad Practices
      • Logs
      • Time
      • Other rules
    • Engineering Code
    • Engineering Data
    • Pipelines
    • Configuration Files
    • Site Reliability Engineering (SRE)
    • Best Engineers
  • Engineering Management
    • Hiring
    • New Reports
    • 1:1s
      • Calibration
      • Expectations
      • Mentorship / Learning / Growing
      • Task Management
      • Teams
    • Interviewing Candidates
    • Messenger Groups
    • Resources
  • Why GitBook?
  • Getting into Tech
    • Terminology
  • Personal Goals
  • Daily Drivers
  • Contacting Me
  • Notes
    • JavaScript
      • Array
      • Async & Await / Promises
      • Booleans
      • Collections
      • Cons/Dislikes
      • fetch
      • Map
      • Modules
      • Object
      • Regex
      • Set
      • Style Guides
      • Versions
    • Node.js
      • Best Practices
      • DraftJS
      • eslint
      • GraphQL
      • Relay
      • Hapi
      • Knex
      • Koa
      • TypeScript
      • Webservers
    • Technical Due Diligence
    • Archive
      • Amazon Echo Dot (3rd Gen) with clock
      • Apple
        • AirPods Pro
        • Apple Notes
        • Apple Watch Series 4
        • iPad Pro 11" 2018
        • MacBook Pro 15" 2017
        • macOS
      • Audible
      • Balance
        • Growth vs Contentment
        • Leading vs Following
        • Mindful vs Mindless
        • New vs Old
      • Bags
      • Bandwidth Requirements
      • B2B/B2C
      • Blockchain
      • Board Games
        • Bang
      • Broadway
      • Cheap, Good, Fast
      • CLI
        • git
        • ufw
        • xargs
      • Cloud Providers
        • GCP
      • Communication
        • Asking Questions / Making Requests
        • Making Edits
        • Synchronous vs Asynchronous
        • Change Management
        • Problem Definition
      • Company
        • All Hands
        • The Problematic CTO
        • Organizational Structure
      • Content Creation
      • COVID 19/Corona Virus
      • Coworking Spaces
      • Daily Routine
      • Dating
      • Displays / Monitors
      • DNS
      • Domain Registrars
      • Driving
      • eCommerce
      • Empire Building
      • Facebook for Developers
      • Fever
      • Fiverr
      • Flights
      • Gaming Tablet
      • GitHub
      • GTD
      • Go Lang
      • Headsets
      • Hiking
        • Chamang Waterfalls
        • Kanching Waterfalls
        • Kota Damansara Community Forest Reserve
        • Sungai Chilling
      • Home Device Calling
      • iCalendar
      • Keyboards
        • Ergodox Ez
      • Malaysia Insurance
      • Mental Health Malaysia
      • Multiroom Wireless Speaker System
      • Musicals
      • Mouse
      • Movies
      • Password Managers
      • Phabricator
      • Physical Health
        • Cardio
      • Podcasts
      • Programming Bootcamps
      • Property
      • Productivity
        • Note Taking
      • Redang
      • Relationships
      • Referral Codes
      • Remote Calls
      • Remote Work
        • Comparison
      • Road Trips
      • Ruby / Ruby on Rails
      • Scraping
      • Slack
      • Stripe
      • Singapore
      • UX
      • Venture Builder
      • Video Games
      • Virtual Personal Assistant
      • VPN
      • WebDAV / CalDAV
      • WebSocket
      • Withings
      • Xiaomi Roborock Mijia
      • Old Hardware
        • Netgear R7000P
      • Web Development
        • React
        • SSO Providers
      • Software Engineering
        • Software Architectures
          • Monolithic
          • Non-Monolithic
            • Microservice
            • FaaS (Functions as a Service) or Serverless
        • Repository Management
  • More on Notion
Powered by GitBook
On this page
  • Sample
  • Commit Messages
  • Pros
  • Commit Message
  • Structure
  • Example
  • Setting Default Commit Messages
  • Git
  • Resources
  • Angular

Was this helpful?

  1. Engineering Code

Commit Messages

Depending on your version control workflow, this can be either commit messages or pull requests.

Sample

fix: prevent more than 12 eggs in a carton

Summary:
Egg cartons only hold a maximum of 12 eggs. The app fataled when there are more than 12 eggs.

We shouldn't store more than 12 eggs in a carton.

We also were able to improve the algorithms to better insert eggs.

Before: 10.7ms
After: 7.3ms


Test Plan:

Run unittest

  phpunit  __tests__

http://example.com/broken-page/

Task: #1
http://example.com/tasks/1

Examples:

Commit Messages

Write for clarity.

Write knowing that it will be read later.

Convey intention.

Convey purpose.

The purposes of the commit message is to convey to the reviewer, or someone who has to debug or understand your code in the future, why did we have to write this diff?

Pros

  • Speeds up code review process.

  • Becomes most recent up to date documentation.

  • Reduces context switching to other systems.

  • Helps future maintainers of the repository.

  • Extremely helpful for people who have to read alot of code.

  • Aids in debugging.

Commit Message

Commit messages consist of at least three things:

  • One Line Summary

  • Summary

  • Test Plan

Optional (depending on project):

  • Task

  • Additional URLs

  • Reviewers

  • Reviewed By

  • Deployment Process

Empty Sample

One Line Summary

Summary:

Test Plan:

Task:

Structure

One Line Summary

Contains succinct description of the change.

  • Keep this short and sweet. Less than 50 characters.

  • Don't make it too generic. For example: "New Unit Test" is bad because it doesn't describe what the unit test does.

  • Quick way to reference the diff.

  • Use the imperative, present tense: "change" not "changed" nor "changes"

  • No dot (.) at the end

Semantic Release

Types:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)

  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)

  • config: Changes to any configurations.

  • docs: Documentation only changes

  • feature: A new feature

  • fix: A bug fix

  • perf: A code change that improves performance

  • refactor: A code change that neither fixes a bug nor adds a feature

  • revert: The summary of the commit that was reverted

  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

  • test: Adding missing tests or correcting existing tests

  • typos: Fixing typos in flavor text

  • ux: Improvements to User Experiences (ie: changes to color)

    • Not to be confused with ui.

    • Using ux to emphasis the impact of the ui

Summary

Describe in detail:

  • why this diff necessary

  • what are the trade offs of your decisions

if its a new feature:

  • why do we want to add this feature

  • expected result of releasing the feature

if refactoring code

  • why are you refactoring the code

  • what bash commands you used to find/change the code

if its a bug fix:

  • what is expected to happen

  • what actually happened

  • how the bug was discovered

  • how long the bug was live for

  • what commit/diff caused the bug

  • how the bug was fixed

  • severity of the bug

    • people/services effected

    • amount of downtime

    • link to charts displaying severity

    • screenshots of severity

if there is a performance improvement

  • give comparison of before/after. For example:

    • how many milliseconds did it take before/after

    • how much memory does it take before/after

Test Plan

Test plans are used:

  • Reviewers know that you have tested throughly.

  • When having to understand old code, you know how to test it thoroughly.

Always try to make the test plan as easy to reproduce as possible. If a test plan is too long, this could potentially be a sign that what you are implementing is too complex.

Include:

  • screenshots (if its a ui change)

  • URIs of the pages effected

  • any shell commands that were executed

  • any configuration changes that are needed

Additional URLs

Paste any additional relevant URLs, for example URLs to:

  • Asana

  • GitHub Wikis/Issues

  • Google Docs

  • Internal Tools

  • JIRA

  • Kabanize

  • Travis

  • Wiki Pages

This makes it easy to reference them. Try to use the canonical url when possible.

Deployment Process

  • How do we deploy this version of the code?

  • How can we monitor the deployments?

  • What alerts can be received?

  • Where can someone receive alerts?

Example

fix: prevent more than 12 eggs in a carton

Summary:
Egg cartons only hold a maximum of 12 eggs. The app fataled when there are more than 12 eggs.

We shouldn't store more than 12 eggs in a carton.

We also were able to improve the algorithms to better insert eggs.

Before: 10.7ms
After: 7.3ms


Test Plan:

Run unittest

  phpunit  __tests__

http://example.com/broken-page/

Task: #1
http://example.com/tasks/1

Setting Default Commit Messages

Git

Update .git/config, or ~/.gitconfig file to point to your commit template.

git config --add commit.message FILE

Resources

Angular

Types:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)

  • ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)

  • docs: Documentation only changes

  • feat: A new feature

  • fix: A bug fix

  • perf: A code change that improves performance

  • refactor: A code change that neither fixes a bug nor adds a feature

  • revert: The summary of the commit that was reverted

  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

  • test: Adding missing tests or correcting existing tests

  • docs: correct grammar in CONTRIBUTING.md

  • fix(animations): do not delay style() values before a stagger() runs

  • fix(aio): build scripts-js before creating a new docker image for t

  • ci: add npm postinstall back to the lint step so node_modules doesn't

  • docs: fix spelling of case variants in naming.md

  • test(compiler): add a test for components not part of any NgModule

  • build(aio): boilerplate wont be removed by default now

  • fix(aio): Typo in Setup Anatomy documentation page

  • docs(aio): fix typo

  • docs(aio): animations typos fixed

  • refactor: remove unused imports of the deprecated Renderer

PreviousDifferent Types of CodingNextReviewing Code

Last updated 5 years ago

Was this helpful?

Adapted from :

:

https://fatbusinessman.com/2019/my-favourite-git-commit
Angular
Angular Commit Message Guidelines
Erlang: Writing good commit messages
Gerrit Commit message guidelines
Semantic Release
GitHub: Awesome GitHub Issues & PRs Templates
GitHub: Issue and Pull Request templates
GitHub: Creating a pull request template for your repository
GitHub: Search for PULL_REQUEST_TEMPLATE
Open Source Templates
Kernel Newbies: Patch Philosophy
https://github.com/RomuloOliveira/commit-messages-guide
ESLint Commit Messages
Angular Commit Message Guidelines
GitHub: PULL_REQUEST_TEMPLATE.md
Samples