From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: Unable to a new branch with VC commit Date: Fri, 12 Mar 2021 16:14:53 +0100 Message-ID: <87v99we74i.fsf@gmail.com> References: <878s6sg0q5.fsf@gmail.com> <83h7lglf6e.fsf@gnu.org> <87zgz8e9lz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20210"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org, Tero Mononen To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 12 16:20:58 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKjaz-000565-It for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 12 Mar 2021 16:20:57 +0100 Original-Received: from localhost ([::1]:38870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKjay-0004up-FG for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 12 Mar 2021 10:20:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKjVC-0000EG-Pg for help-gnu-emacs@gnu.org; Fri, 12 Mar 2021 10:14:58 -0500 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:35092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKjVB-00013E-7D; Fri, 12 Mar 2021 10:14:58 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id l12so5016093wry.2; Fri, 12 Mar 2021 07:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=32810bBGCBXWf4sT7Iyg2CRlDge23Q5XhyTtCAGgErU=; b=pDYZXJDNbdNuurcV7ExagX53ydrZix2qTx9AzXbDttjLtYoY0E6ngEe4jnjbtOCDT3 vP8V8tap7VbwcvXXDSCe3CKbvmHBd4bTmKnRZo3UGsZWEDVACC2a7hS/fS5RelV7h6wM 0Wom+cTaLqUSgwXhTIQ4p/HLWXxe9+izrXPHE5f+1eoXTChlna2c9e00yRQNWoSfs0jH wdkZifnr5qP5ImRKtlSGt+9FBhWg5gxCU0nzRs99yFtlFjAtlYKF5rX8wzVqVH1NdwYU 7cax/kKbkKUM0GdmEB2/jWBOKMfWasWmmmEvGMyip0aCfqIedhlFmvvymUuwv3JeY3Kx 4irw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=32810bBGCBXWf4sT7Iyg2CRlDge23Q5XhyTtCAGgErU=; b=L99TVKz8zdo3wPHJShNZNd5Kxeq0SJf3CYLwkYoE0bIoZRyjtNMLemx2cUrtrgE6b+ qSYyNZamAyUxkdSYdJpN74wF602pZjNPoFqENF9DrsSf921mtvmW0G+DUWDBLbfpjFk4 lTDclPH4kOhwBIyoMvhUKKLQaagWW9YUw6hqFFOVI6/gFHwF9okm/Ew+bWBzuiqn3zt1 p+NFD3JugMzuC3u4+MLQPWa2zZqZdKcCrjIPvDDNefmaPS+9rG/ULiieEgDaUnJeMC2T j1pFrRwKXm0aktJKeKnu5TXC6cAvOVm8eT2VSOBa7n85S6YwYnq1be28vZ1sghL3xigi BEYQ== X-Gm-Message-State: AOAM530RaSKSoxVyzL1T/uWO+9p6fHxXr/6m7hr54gsmK6UN7eWtFVIc 6Cib/6FFr4M+BS/eNXvpOIK71sXCD6fQ4w== X-Google-Smtp-Source: ABdhPJyDnqp5h7gGZbi8UUU7fU6bn83Xec4A6BCGbRKBe3Ildl6/8666r+jLIEwqhOt7qNP8pPbIAg== X-Received: by 2002:a5d:6b8a:: with SMTP id n10mr14633977wrx.150.1615562095364; Fri, 12 Mar 2021 07:14:55 -0800 (PST) Original-Received: from rltb (91-175-207-237.subs.proxad.net. [91.175.207.237]) by smtp.gmail.com with ESMTPSA id v13sm9185968wrt.45.2021.03.12.07.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 07:14:54 -0800 (PST) Gmane-Reply-To-List: yes In-Reply-To: <87zgz8e9lz.fsf@gmail.com> (Robert Pluim's message of "Fri, 12 Mar 2021 15:21:12 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=rpluim@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128400 Archived-At: >>>>> On Fri, 12 Mar 2021 15:21:12 +0100, Robert Pluim s= aid: >>>>> On Fri, 12 Mar 2021 14:39:05 +0200, Eli Zaretskii said: >>> From: Robert Pluim >>> Date: Fri, 12 Mar 2021 10:50:10 +0100 >>> Cc: help-gnu-emacs@gnu.org >>>=20 >>> Neither git nor Mercurial fall under the "On centralized version >>> control systems" clause of the 'Creating New Branches' >>> documentation. Eli> Is there any good reason why "C-u C-x v v" won't work for a dVCS? Eli> There's an advantage in keeping the UI consistent as much as Eli> reasonably practical, even though the two VCS types are very Eli> different. Robert> I don=CA=BCt see why it shouldn't. Someone just needs to add th= e right Robert> incantations to vc-git-checkin and vc-hg-checkin (and maybe Robert> vc-bazaar-checkin), and deprecate the vc-create-tag branch-crea= ting Robert> usage. Something like this untested patch for vc-git. Tero, does this work for you? diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 465ed8735c..287512c255 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -915,7 +915,7 @@ vc-git-log-edit-mode "Major mode for editing Git log messages. It is based on `log-edit-mode', and has Git-specific extensions.") =20 -(defun vc-git-checkin (files comment &optional _rev) +(defun vc-git-checkin (files comment &optional rev) (let* ((file1 (or (car files) default-directory)) (root (vc-git-root file1)) (default-directory (expand-file-name root)) @@ -937,6 +937,10 @@ vc-git-checkin (if (eq system-type 'windows-nt) (let ((default-directory (file-name-directory file1))) (make-nearby-temp-file "git-msg"))))) + ;; When specified 'rev' is a branch name to create. + (when rev + (vc-git-command nil 0 nil "update-index" "--refresh") + (vc-git-command nil 0 nil "checkout" "-b" rev)) (cl-flet ((boolean-arg-fn (argument) (lambda (value) (when (equal value "yes") (list argument)))= )) Robert --=20