From d1437b76665a4e4f51d6ea21200a0b817e6157c3 Mon Sep 17 00:00:00 2001 From: "Andrew Grigorev (aider)" Date: Sat, 12 Apr 2025 17:57:04 +0300 Subject: [PATCH] chore: add debug prints for attribute_co_authored_by --- aider/main.py | 2 ++ aider/repo.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/aider/main.py b/aider/main.py index a8535d02c..61100d14a 100644 --- a/aider/main.py +++ b/aider/main.py @@ -501,6 +501,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F # Parse again to include any arguments that might have been defined in .env args = parser.parse_args(argv) + print(f"DEBUG: After final parse, args.attribute_co_authored_by = {args.attribute_co_authored_by}") # DEBUG if git is None: args.git = False @@ -891,6 +892,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F repo = None if args.git: try: + print(f"DEBUG: Before GitRepo init, args.attribute_co_authored_by = {args.attribute_co_authored_by}") # DEBUG repo = GitRepo( io, fnames, diff --git a/aider/repo.py b/aider/repo.py index f0d436526..5a57ffb46 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -60,6 +60,7 @@ class GitRepo: git_commit_verify=True, attribute_co_authored_by=False, # Added parameter ): + print(f"DEBUG: GitRepo.__init__ received attribute_co_authored_by = {attribute_co_authored_by}") # DEBUG self.io = io self.models = models @@ -71,6 +72,7 @@ class GitRepo: self.attribute_commit_message_author = attribute_commit_message_author self.attribute_commit_message_committer = attribute_commit_message_committer self.attribute_co_authored_by = attribute_co_authored_by # Assign from parameter + print(f"DEBUG: GitRepo.__init__ set self.attribute_co_authored_by = {self.attribute_co_authored_by}") # DEBUG self.commit_prompt = commit_prompt self.subtree_only = subtree_only self.git_commit_verify = git_commit_verify @@ -117,6 +119,8 @@ class GitRepo: if not fnames and not self.repo.is_dirty(): return + print(f"DEBUG: GitRepo.commit start, self.attribute_co_authored_by = {self.attribute_co_authored_by}") # DEBUG + diffs = self.get_diffs(fnames) if not diffs: return @@ -141,6 +145,8 @@ class GitRepo: attribute_commit_message_committer = self.attribute_commit_message_committer attribute_co_authored_by = getattr(self, 'attribute_co_authored_by', False) + print(f"DEBUG: GitRepo.commit after retrieval, attribute_co_authored_by = {attribute_co_authored_by}") # DEBUG + commit_message_trailer = "" prefix_commit_message = False use_attribute_author = False @@ -153,6 +159,7 @@ class GitRepo: # Determine author/committer modification and trailer + print(f"DEBUG: GitRepo.commit before logic check, attribute_co_authored_by = {attribute_co_authored_by}") # DEBUG if attribute_co_authored_by: model_name = "unknown-model" if coder and hasattr(coder, "main_model") and coder.main_model.name: @@ -201,6 +208,7 @@ class GitRepo: committer_name = f"{original_user_name} (aider)" # Apply author/committer modifications based on flags determined earlier + print(f"DEBUG: GitRepo.commit before setting env, use_attribute_author={use_attribute_author}, use_attribute_committer={use_attribute_committer}") # DEBUG if use_attribute_committer: os.environ["GIT_COMMITTER_NAME"] = committer_name if use_attribute_author: