Skip to content

Conversation

@misrasaurabh1
Copy link
Contributor

@misrasaurabh1 misrasaurabh1 commented Nov 15, 2025

User description

dont make all commits created as codeflash bot. let it the default settings, until we figure out something better.


PR Type

Enhancement


Description

  • Stop forcing bot git user config

  • Use repository's default commit identity

  • Simplify snapshot commit workflow


Diagram Walkthrough

flowchart LR
  create["create_worktree_snapshot_commit"] -- "previously set bot user.name/email" --> config["Repo config writer"]
  create -- "now skips config override" --> commit["git add/commit with defaults"]
Loading

File Walkthrough

Relevant files
Enhancement
git_worktree_utils.py
Stop overriding git user for snapshot commits                       

codeflash/code_utils/git_worktree_utils.py

  • Remove per-repo override of git user.name/email
  • Keep add/commit flow using default identity
  • Reduce side effects on repo configuration
+0/-5     

…ttings, until we figure out something better.

Signed-off-by: Codeflash Bot <bot@codeflash.ai>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Codeflash Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@misrasaurabh1
Copy link
Contributor Author

removing this until we figure out a better way to do this @mohammedahmed18

@github-actions
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Behavior Change

Committing now relies on the repository's configured user.name/email. In environments without a local identity (e.g., fresh CI clones or bare worktrees), commits may fail or be authored as 'unknown'. Validate CI and ephemeral environments still produce commits successfully.

def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) -> None:
    repository = git.Repo(worktree_dir, search_parent_directories=True)

    repository.git.add(".")
    repository.git.commit("-m", commit_message, "--no-verify")
Logging/Observability

The function removed deterministic authoring; consider logging the author actually used for the commit to aid troubleshooting when defaults are misconfigured.

def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) -> None:
    repository = git.Repo(worktree_dir, search_parent_directories=True)

    repository.git.add(".")
    repository.git.commit("-m", commit_message, "--no-verify")

@github-actions
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Provide explicit commit identity

Ensure the commit has a configured author to avoid failures when local git
user.name/email are unset. Pass explicit author and committer identity to the commit
command so it works reliably in clean environments.

codeflash/code_utils/git_worktree_utils.py [22-23]

 repository.git.add(".")
-repository.git.commit("-m", commit_message, "--no-verify")
+repository.git.commit(
+    "-m",
+    commit_message,
+    "--no-verify",
+    "--author=Codeflash Bot <bot@codeflash.ai>",
+    env={
+        "GIT_AUTHOR_NAME": "Codeflash Bot",
+        "GIT_AUTHOR_EMAIL": "bot@codeflash.ai",
+        "GIT_COMMITTER_NAME": "Codeflash Bot",
+        "GIT_COMMITTER_EMAIL": "bot@codeflash.ai",
+    },
+)
Suggestion importance[1-10]: 7

__

Why: The PR removed config-writer setup for git user identity; explicitly setting author/committer for the commit mitigates failures in environments without global config. The approach is relevant and improves robustness, though the exact use of an env kwarg with GitPython’s commit wrapper may need verification.

Medium

Signed-off-by: Codeflash Bot <bot@codeflash.ai>
@misrasaurabh1 misrasaurabh1 changed the title no commits by codeflash bot account locally only tag the single commit by codeflash bot and then revert to defaults Nov 15, 2025
@misrasaurabh1 misrasaurabh1 merged commit 4ca0a60 into main Nov 15, 2025
20 of 22 checks passed
@misrasaurabh1 misrasaurabh1 deleted the git-commit-no-bot branch November 15, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants