From dca75f1e13130d548692135cf159c0e18f7b68fb Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 28 Apr 2026 17:59:45 +0300 Subject: vc: do not use branch as default topic. --- lisp/forgejo-vc.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/forgejo-vc.el b/lisp/forgejo-vc.el index 5d76dd7..02c3f1d 100644 --- a/lisp/forgejo-vc.el +++ b/lisp/forgejo-vc.el @@ -337,11 +337,18 @@ With prefix arg FORCE-PUSH-P, force-push to update an existing PR." (target (if (string-match "\\`\\([^/]+\\)/\\(.+\\)\\'" choice) (match-string 2 choice) choice))) - (list remote - (let ((input (read-string (format "Topic (default: %s): " branch)))) - (if (string-empty-p input) branch input)) - target - current-prefix-arg))) + (let* ((pr-branch-p (string-match-p "\\`pr-[0-9]+\\'" branch)) + (default-topic (unless pr-branch-p branch))) + (list remote + (if default-topic + (let ((input (read-string (format "Topic (default: %s): " default-topic)))) + (if (string-empty-p input) default-topic input)) + (let ((input (read-string "Topic: "))) + (when (string-empty-p input) + (user-error "Topic is required for pr-N branches")) + input)) + target + current-prefix-arg)))) (let ((target (replace-regexp-in-string "\\`.+/" "" target))) (if force-push-p (forgejo-vc--git-push -- cgit v1.0