Skip to content

Falkon.PS #95645

@jcjcjcjc88

Description

@jcjcjcjc88

Get OLLAMA installed

And Then

Extension Settings
This extension contributes the following settings that you can customize:

Setting Description Default
generate-local-commit.endpoint Ollama API endpoint URL http://localhost:11434
generate-local-commit.model Ollama model to use qwen2.5:3b
generate-local-commit.maxTokens Maximum tokens to generate (300 normal, 30000 thick mode) 300
generate-local-commit.temperature Temperature for generation (higher is more creative) 0.2
generate-local-commit.contextRange Number of context lines to include above and below each change 3
generate-local-commit.promptTemplate Template for the prompt with ${diff} placeholder (See below)
generate-local-commit.useConventionalCommits Follow conventional commits format true
generate-local-commit.showDiffConfirmation Show confirmation dialog with diff before generating false
generate-local-commit.enhancePrompt Template for enhancing commit messages with ${message} placeholder (See settings)
generate-local-commit.reducePrompt Template for reducing commit messages with ${message} placeholder (See settings)
Accessing Settings
You can access the extension settings in multiple ways:

Quick Actions Sidebar: Click the Git Commit icon in the activity bar and use the "Open Settings UI" action
Source Control View: Click the "Open Generate Local Commit Settings" button in the SCM title menu
VS Code Settings: Go to File → Preferences → Settings and search for "generate-local-commit"
Command Palette: Use Ctrl+Shift+P and type "Open Generate Local Commit Settings"
Max Tokens Feature
The extension now supports two token modes:

Normal Mode (300 tokens): Suitable for regular commit messages and standard diffs
Thick Mode (30,000 tokens): Designed for complex diffs with extensive changes that require more detailed analysis
Use the Quick Actions sidebar to easily switch between modes based on your needs.

Context Range Feature
The context range setting allows you to include additional lines of code above and below each change in the diff. This provides more context to the model, helping it understand the changes better and generate more accurate commit messages.

For example:

Setting contextRange to 5 will include 5 lines before and 5 lines after each changed section
Setting contextRange to 0 will only include the changed lines themselves
Increasing the context range can be particularly useful when:

Working with complex code where understanding surrounding context is important
Making small changes in large functions
Customizing the Prompt
You can customize the prompt template in settings. The ${diff} placeholder will be replaced with the actual git diff.

Example prompt template:

You are an AI assistant specialized in creating concise and meaningful git commit messages. When provided with a git diff, your task is to generate a clear commit message following the conventional commit format.

Your commit messages should:

  1. Follow the pattern: type(optional scope): description
  2. Use one of these types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
  3. Focus on WHAT changed and WHY, not HOW it was implemented
  4. Be under 50 characters whenever possible
  5. Use imperative, present tense (e.g., "add feature" not "added feature")
  6. Generate the git commit message inside [COMMIT][/COMMIT] tags based on the content of the diff provided inside [DIFF][/DIFF] tags

Types explained:

  • feat: A new feature or significant enhancement
  • fix: A bug fix
  • docs: Documentation changes only
  • style: Changes that don't affect code meaning (formatting, whitespace)
  • refactor: Code changes that neither fix bugs nor add features
  • perf: Performance improvements
  • test: Adding or correcting tests
  • build: Changes to build system or dependencies
  • ci: Changes to CI configuration/scripts
  • chore: Routine maintenance tasks, dependency updates

[DIFF]${diff}[/DIFF]
License
This extension is licensed under the MIT License.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions