The One GitHub Copilot Feature I Use


A couple of days back, I posted that I prefer to use Chat-driven development using ChatGPT or Claude over using IDE-integrated LLM tools like GitHub Copilot. An old friend reached out and asked if there is any part of my development workflow where LLM IDE integration makes me more productive. It turns out there is one place where I still like to use GitHub Copilot with VS Code: writing Git commit messages after I have made changes. For me, a good clean Git history is important. It helps me understand why I made a change. I’m a lazy person, so I often end up writing poor commit messages.

IDE integration fills this gap for me. I like this because it is again an explicit action. It’s not magically writing commit messages for me. I decide when I need to generate a commit message using AI. In VS Code, when you go to the Git commit window, you see the AI star button, and when you click it, it will generate the commit message for you.

If I click on the button, it generates the following message. I changed the db name in my GitHub actions CI file.

Update PostgreSQL database name in CI workflow configuration

This is good.

You can also specify custom instructions to tell GitHub Copilot how to generate a commit message.

A few years back, I read a blog https://cbea.ms/git-commit/ where the author gave multiple tips on how to create a good commit message. Below are the 4 key points from the post.

  1. Write the subject line in imperative mood, capitalized, max 50 characters, no period (“Add feature” not “Added feature”)
  2. Always separate subject from body with a blank line, then use the body to explain WHAT and WHY vs HOW, with each line wrapped at 72 characters
  3. Follow this basic structure:
   Verb-based action summary

   Problem or context explanation
   Solution or change details
   Impact or consequences
  1. Focus on telling the story of why this change was necessary – a good commit message should help future developers understand the reasoning behind the change, not just what was changed

I like this format for Git commit messages. So, I set custom instructions to use the above format.

To configure custom commit message generation instructions, use the github.copilot.chat.commitMessageGeneration.instructions setting. You can define custom instructions at the User or Workspace level.

"github.copilot.chat.commitMessageGeneration.instructions": [

      {
          "text": "Subject Line Rules: Write a concise subject line (50 chars max) that describes WHAT the change does\nStart with a capital letter and use imperative mood (\"Add\" not \"Added\" or \"Adds\")\nDon't end with a period\nFormat: {Verb} {what was changed} {brief context if needed}; Message Body Rules: - Leave one blank line between subject and body\n\n- Wrap body text at 72 characters\n\n- Use body to explain:\n\n  - WHY the change was made\n\n  - WHAT the problem was\n\n  - Any important side effects or consequences\n\n- Don't explain HOW you made the change (that's what the code is for)",
      }
  ]

After defining my custom instructions, it generated the below commit message.

Update PostgreSQL database name in CI workflow

Changed the PostgreSQL database name from 'foodb' to 'foodb1' to avoid conflicts with existing databases during testing and ensure a clean environment for CI runs.

Like I said before I don’t use GitHub copilot of code generation so I have disabled all other features of the GitHub Copilot extension in VS Code. Below are my settings for GitHub Copilot.

"github.copilot.enable": {
    "*": false,
    "plaintext": false,
    "scminput": true
},
"github.copilot.editor.enableCodeActions": false,
"github.copilot.renameSuggestions.triggerAutomatically": false,
"github.copilot.editor.enableAutoCompletions": false,

One thing I want to admit before ending this blog is that I’m still figuring out workflows to use these tools effectively. There are tools that might not feel natural today, but as I gain more experience with them, I will try them again with an open mind.


Discover more from Shekhar Gulati

Subscribe to get the latest posts sent to your email.

Leave a comment