From nobody Mon Nov 07 22:46:32 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N5mYj1Vlzz4gc3h; Mon, 7 Nov 2022 22:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N5mYj0MRNz4Pjw; Mon, 7 Nov 2022 22:46:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667861193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=698KpAd+uiVXO5m8TxAev9qw5Yap1xsvZWZEj6afs4U=; b=LFb7LA/ZrXkCg2XPkKFLo2vlMLVRHTJDOegqGEXI1vRPJW7HhjbiTtDTCBOCzy73ZJA/gR 2gBfj9z7VaYtZG8DPIAfrqBEq2J8/nzYbgW2P1CFzBeiwr7Bw4gJ8XKz2rbs5WlGl2U2Zd VPu5Y8Su9kj3vb6beyZWIeOcPuRBhKWA1YJmSZmTj7frLXcZKXCnecHNsL+8A3/2SLwL2D 4AR6ICU/sUMytEf8OTsu0KX3PLREhBoSzMW2a/fMRgeUrTaARoakCiKe52JAKIPUjYVRi8 RIeJoi8w2xFSc0dv+mbkeJLdfy79cI4bJdRo57hmoMYLHxvzZi8PnTGqAfWWGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N5mYh68NWzJCK; Mon, 7 Nov 2022 22:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A7MkWPE066093; Mon, 7 Nov 2022 22:46:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A7MkWj8066092; Mon, 7 Nov 2022 22:46:32 GMT (envelope-from git) Date: Mon, 7 Nov 2022 22:46:32 GMT Message-Id: <202211072246.2A7MkWj8066092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 613aaf59afa3 - main - git-arc: Accept message via -m when updating reviews. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 613aaf59afa307fc77c8eed01962a59423b1c5f3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667861193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=698KpAd+uiVXO5m8TxAev9qw5Yap1xsvZWZEj6afs4U=; b=XYh4VuRWAeleeXxcvWIql6YzqA/ZeHkQsqlsDHVezUbCllN2k4oe+nf9rUmjQ973lofwHR fkW+H9R82eX2QQwtmn6Q72HbgKJFehEaVuXhq9WpJ53fIZep55cBgdYRfP/xZ6pmiWAx0M z0QTrEE6AWd6I9yVv4uvGiR2vA/dZ5O/htsGegnU5tSPGMv7QLYabxeYJmXInzUUrBdBWr BqXwiNA+W1E7H62wDhkQTyhERmMGs/5fZBj2IunITjGTXZscAE6MpligvoCGG9jCeGcX64 zwnwXk6unMgzYQCHoU6tRrgQZ9bXgXGrIha9Rbq2jle3mZ4nrlRH6PD8aQxgWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667861193; a=rsa-sha256; cv=none; b=Gwfn/8sS8XMpc/5RGt4PelqyfqzHuzsyZLGLWAr10LIvJccGOvHHYqcDs3D8LNoNCSRvkD CUT9qEOaiHEURXnXO93dx6wmUMY9EADJBW4N2KCCC8ZGy0oQGpjSPz0e1Ix7U/o4SOxZ0w KsFHenDL3hY6cmIoAJUfAVaHLvKIf+NL/ptb2TDs7R9Y6qW0H/oar0d5tnQw8GKZ92zuuI /pbB6kW0DWJgMiUQrHcm/TumcCD69qyHtCYoS8vxLLKSyFIm22CWm8WJsrvklrQPH9aEVP D1D3lsQjoAr6V8pHyIxbq5/RgrWCqmYwLZxShJgdtJztaJgEU/24p8kB10RPrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=613aaf59afa307fc77c8eed01962a59423b1c5f3 commit 613aaf59afa307fc77c8eed01962a59423b1c5f3 Author: John Baldwin AuthorDate: 2022-11-07 22:43:49 +0000 Commit: John Baldwin CommitDate: 2022-11-07 22:46:15 +0000 git-arc: Accept message via -m when updating reviews. If a -m argument is given to update, it is passed through to arc diff when updating each review. Note that if an empty message is specified via -m, arc diff will update the review without adding a note. If an -m argument is not given, then the user's editor is invoked by arc to supply a message for each review matching the previous behavior. This can be used to simplify the process for updating a set of reviews, e.g.: git checkout foo git rebase main git arc update -m "Rebase" main.. This will rebase the 'foo' branch and update the reviews for all commits on the branch without invoking the user's editor separately for each review. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D37260 --- tools/tools/git/git-arc.1 | 12 +++++++++++- tools/tools/git/git-arc.sh | 26 ++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index c499c2da3320..2e107a708d9d 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2022 +.Dd November 7, 2022 .Dt GIT-ARC 1 .Os .Sh NAME @@ -48,6 +48,7 @@ .Op Ar commit Ns | Ns Ar commit-range .Nm .Cm update +.Op Fl m Ar message .Op Ar commit Ns | Ns Ar commit-range .Sh DESCRIPTION The @@ -105,6 +106,15 @@ Synchronize the Differential Revisions associated with the specified commits. Currently only the diff is updated; the review description and other metadata are not synchronized. +If a message is specified with +.Fl m , +that message is added as a note to the Differential Revision. +If no message is supplied, +the user's editor will be opened to provide an update message for +each revision. +If an empty message is supplied via +.Fl m , +then no notes will be added when updating Differential Revisions. .El .Sh CONFIGURATION These are manipulated by diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index a9faed2ea876..5e8cc44ce3cc 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -53,7 +53,7 @@ Commands: list | patch [ ...] stage [-b branch] [|] - update [|] + update [-m message] [|] Description: Create or manage FreeBSD Phabricator reviews based on git commits. There @@ -501,7 +501,20 @@ gitarc__stage() gitarc__update() { - local commit commits diff + local commit commits diff have_msg msg + + while getopts m: o; do + case "$o" in + m) + msg="$OPTARG" + have_msg=1 + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) commits=$(build_commit_list "$@") for commit in ${commits}; do @@ -514,8 +527,13 @@ gitarc__update() # The linter is stupid and applies patches to the working copy. # This would be tolerable if it didn't try to correct "misspelled" variable # names. - arc diff --allow-untracked --never-apply-patches --update "$diff" \ - --head "$commit" "${commit}~" + if [ -n "$have_msg" ]; then + arc diff --message "$msg" --allow-untracked --never-apply-patches \ + --update "$diff" --head "$commit" "${commit}~" + else + arc diff --allow-untracked --never-apply-patches --update "$diff" \ + --head "$commit" "${commit}~" + fi done }