Skip to content

Add logging for silent git exceptions #48

@davidpoblador

Description

@davidpoblador

Summary

Git-related exceptions are silently swallowed with pass, making it difficult to debug why git operations might not be working.

File to update

  • src/blogtuner/utils/git.py

Current code (lines 30-31)

except (git.InvalidGitRepositoryError, git.NoSuchPathError, ValueError):
    pass  # Not a git repo or file not tracked

Proposed change

except (git.InvalidGitRepositoryError, git.NoSuchPathError, ValueError) as e:
    logger.debug(f"Not using git mv (reason: {e}), falling back to regular rename")

Rationale

  • Debug-level logging provides visibility without cluttering normal output
  • Helps diagnose unexpected behavior when git operations silently fall back
  • Maintains current functionality while improving observability

Priority

Low

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