From dfecdc3631fb3e4b930baf1fb13e3fe01e983c41 Mon Sep 17 00:00:00 2001 From: Matthieu Monsch Date: Sun, 20 Apr 2025 20:31:23 -0700 Subject: [PATCH] fix: improve placeholder prompt detection --- README.md | 5 +---- src/git_draft/__main__.py | 2 +- src/git_draft/drafter.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c5d897d..8ed6b77 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,6 @@ pipx install git-draft[openai] ## Next steps +* MCP bot. * Mechanism for reporting feedback from a bot, and possibly allowing user to interactively respond. -* Add MCP bot. -* Store configuration in `gitconfig` as `draft.*` entries. This can be used for - example to set a unique repo ID, and default bot to use per repo (or more - widely via shared `gitconfig` files). diff --git a/src/git_draft/__main__.py b/src/git_draft/__main__.py index c1d21f2..453b3c0 100644 --- a/src/git_draft/__main__.py +++ b/src/git_draft/__main__.py @@ -210,7 +210,7 @@ def main() -> None: # noqa: PLR0912 PLR0915 editable = False prompt = edit( text=drafter.latest_draft_prompt() or _PROMPT_PLACEHOLDER - ) + ).strip() if not prompt or prompt == _PROMPT_PLACEHOLDER: raise ValueError("Aborting: empty or placeholder prompt") else: diff --git a/src/git_draft/drafter.py b/src/git_draft/drafter.py index 76945d4..14ceb37 100644 --- a/src/git_draft/drafter.py +++ b/src/git_draft/drafter.py @@ -43,7 +43,7 @@ def _draft_ref(folio_id: int, suffix: int | str) -> str: return f"refs/drafts/{folio_id}/{suffix}" -_FOLIO_BRANCH_NAMESPACE = "drafts" +_FOLIO_BRANCH_NAMESPACE = "draft" _FOLIO_UPSTREAM_BRANCH_SUFFIX = "+"