Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Dec 25, 2024

Description

New feature to make user can mention git diff and git status of current repository
New tool git stage & git commit for make cline generate commit message

Screenshot
image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

This PR adds Git diff and status mentions, and tools for staging and committing changes, with UI and backend support.

  • GitProvider:
    • New GitProvider class in GitProvider.ts to handle Git operations like getDiff(), getStatus(), stage(), and commit().
    • Handles initialization of the Git extension and repository.
  • UI Components:
    • Updates ChatRow.tsx and ChatTextArea.tsx to handle new Git actions (gitStage, gitCommit).
    • Adds context menu options for git-diff and git-status in ContextMenu.tsx.
  • Mentions and Context:
    • Updates context-mentions.ts to include git-diff and git-status mentions.
    • Modifies parseMentions() in mentions/index.ts to fetch and display Git diffs and statuses.
  • Testing:
    • Adds tests for GitProvider in GitProvider.test.ts to verify Git operations and error handling.

This description was created by Ellipsis for 8e480f7b00400dff0ae739f428b670f8989bde8e. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Dec 25, 2024

⚠️ No Changeset found

Latest commit: 1c74bee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mrubens
Copy link
Collaborator

mrubens commented Dec 26, 2024

Thanks @samhvw8! This is a bigger PR so I want to spend a little time with it to make sure I understand the proposed changes deeply. I'm currently travelling though, so it might take a little while. Thanks for your patience!

@timurlenqs
Copy link

Perfect system how can i enable this version on my pc ?

@samhvw8 samhvw8 force-pushed the feat/git-diff-mention branch 4 times, most recently from 4ca76df to 0dcae05 Compare December 31, 2024 03:06
@mrubens
Copy link
Collaborator

mrubens commented Jan 2, 2025

I love the idea of adding various git-related information to the @mentions, similar to what Cursor has: https://docs.cursor.com/context/@-symbols/@-git

As for the git-related tools - should that just be covered with a git MCP server for people who are interested?

@samhvw8
Copy link
Contributor Author

samhvw8 commented Jan 2, 2025

Thanks for your reply,

I love the idea of adding various git-related information to the @mentions, similar to what Cursor has: https://docs.cursor.com/context/@-symbols/@-git

Cursor has convenient @mentions tools that we can use as a reference for our implementation.

As for the git-related tools - should that just be covered with a git MCP server for people who are interested?

Could we implement this directly into cline? If we separate it into MCP, it would depend on models to process MCP correctly, and it could make the system prompt longer when there are too many git tools.

@mrubens
Copy link
Collaborator

mrubens commented Jan 2, 2025

As for the git-related tools - should that just be covered with a git MCP server for people who are interested?

Could we implement this directly into cline? If we separate it into MCP, it would depend on models to process MCP correctly, and it could make the system prompt longer when there are too many git tools.

I thought all of the models could handle MCP through Cline, and that it wouldn't turn out to be any different than what you added to the system prompt in this PR (and would only be added to the system prompt for people who choose to enable the git MCP).

@mrubens
Copy link
Collaborator

mrubens commented Jan 2, 2025

@samhvw8 would you be up for splitting out a PR specifically focused on adding git support to the @mentions while we continue to discuss the tools aspect? Thank you!!

@samhvw8
Copy link
Contributor Author

samhvw8 commented Jan 2, 2025

@samhvw8 would you be up for splitting out a PR specifically focused on adding git support to the @mentions while we continue to discuss the tools aspect? Thank you!!

oh, ok i understand now, i will split @metion into another pr, without tool like git_stage and git_commit

@samhvw8 samhvw8 force-pushed the feat/git-diff-mention branch from 0dcae05 to 1c74bee Compare January 3, 2025 18:50
@samhvw8
Copy link
Contributor Author

samhvw8 commented Jan 3, 2025

Hi @mrubens,
thanks for your feedback, i already update my PR, remove tool keep only for @-mention

@samhvw8 samhvw8 changed the title feat: git diff mention & tool feat: git diff mention Jan 6, 2025
@mrubens
Copy link
Collaborator

mrubens commented Jan 6, 2025

Hi @mrubens, thanks for your feedback, i already update my PR, remove tool keep only for @-mention

Thanks! I'm playing around with a similar PR based on what you did - will share it back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants