From owner-freebsd-hackers@freebsd.org Mon Jan 25 17:58:05 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DAAC4EAB39 for ; Mon, 25 Jan 2021 17:58:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPczJ36Lxz4mFD for ; Mon, 25 Jan 2021 17:58:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x82a.google.com with SMTP id c1so10345482qtc.1 for ; Mon, 25 Jan 2021 09:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mime-version :content-disposition; bh=k8PfbMA/cgIQUcjErbvN5AXbE9gLcuAV8IqYVrM03jk=; b=YnpmgAoJ4KsSzj209TRNi8LhPp0X/vCt4qU5F5VdJRUnvuGMcP48SFYkV7lBLCaphS 0xiSpwfgyQtMLA6zuGdmMtSsPKTfHOO0iMxjsMGdVmGHEnINYZNIS3gnFmDqgUJlcI2w tL2cA6GIQBOLpRoCBUHJ2spySJCZFeFI5eD5FzRevwWJajASxLNXIZ6kIHUBpeBzCbgR uAPPOi4sArIYphkivCtI/MszayZgnohp2zagNXd7IfjHFRyh2SXaMiWH5HHI4Bhm49TM cWuG2sdkLRl+56vRl4Kh0qASgO0i81IAjK7hkUyW5CA8r7e4f22fMOUYC5Ga83WqQyO5 t5PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-disposition; bh=k8PfbMA/cgIQUcjErbvN5AXbE9gLcuAV8IqYVrM03jk=; b=VIKZ40us6PGyyc5j4vMwp3+WEnUjtlK8bV6qpZiPGYu3gUWu+bbGRPVRQmjdv9ecxX eO2ESFT5YOHd3PmCDiu5QcNi2hCRE+Vit8fWsDd+KFl95fghw+hfXB/tw3jCDLKF+LM6 1Zqn7WcH2KM+czXhVa8QfxUXS0+g7NPd2g8ege5Rj8GX9jypEZ1SRD1DPvzaKYontS0g Fx0nz5qirXVfT2Lt7FElBFiLfBxNYql8es63AZuUc2QeXiAsBeOOtBHskrVf1mPkyNzJ 4dT0Xcctcw+DI6rGoPjwKEB/PWyep4gnkqaBpFkQppvjjWsdqk2AhfJWi/ZHqkXGTlG/ qjkg== X-Gm-Message-State: AOAM531bUnK1AdgwwNXxBVXoqp5de+7Gwm7OSD1shJxa068IutT3sJ9f u+nQmeuuDjhz32/MtrBYA52+Pw/qf6Xuig== X-Google-Smtp-Source: ABdhPJyqtBLk/w7GLEHNpQO0sYNF3+EYcKyVzeywUfwctpKVPfS2gmLgbLQrydRsfNOaRavuolKUEA== X-Received: by 2002:ac8:7259:: with SMTP id l25mr1614307qtp.1.1611597483224; Mon, 25 Jan 2021 09:58:03 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id o45sm9300463qto.91.2021.01.25.09.58.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 09:58:02 -0800 (PST) Sender: Mark Johnston Date: Mon, 25 Jan 2021 12:58:00 -0500 From: Mark Johnston To: freebsd-hackers@freebsd.org Subject: arc wrapper for tracking phabricator reviews Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4DPczJ36Lxz4mFD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=YnpmgAoJ; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::82a as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::82a:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::82a:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82a:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 17:58:05 -0000 Hi, For the past while I've been using a script, git arc, to automate some of my interactions with Phabricator. A few other developers have found it useful so it seems time to make it more accessible by committing it to the src tree. The script is here: https://reviews.freebsd.org/D28334 The basic idea is to make it simple to create and update Phabricator reviews from git commits, without adding any metadata to your git repository so as to stay as flexible as possible. In particular, I tend to rebase sets of commits regularly so things like notes and branch pointers end up being invalidated. git arc lets you - Create reviews from a series of commits. It automatically creates parent/child pointers between consecutive Differential revisions. - Update reviews after amending commits based on reviewer feedback. - Stage commits in preparation for pushing to the upstream repository. This automatically adds "Reviewed by:" and "Differential Revision:" tags. See the rather verbose usage message for more details. To map git commits to phabricator revisions it uses commit summaries. This is kind of gross but I don't see a better way to do it that doesn't involve adding metadata to my git tree, and it seems to work fine in practice. In general git arc wraps the functionality of arc, though in some cases it uses jq and arc's "call-conduit" functionality to call into the lower-level Phabricator APIs. There exists a script with similar goals, arcgit, in the tools/ dir. I used it for a while but found that with its workflow I still had to do a fair bit of manual work to keep phabricator in sync with my commits. I'm not sure how best to reconcile the two scripts. It would be better for new developers to not have to choose between them. The main advantage of arcgit is that it helps maintain large patch stacks by making it easier to edit intermediate commits in response to review feedback. In particular, it adds a branch for each review posted to phabricator, so it's a bit easier to go back and edit a particular commit, but I believe this assumes that you aren't rebasing your branch. I'd appreciate any feedback/suggestions/complaints regarding the new script, especially if you use arcgit today. Thanks to jhb for submitting a number of improvements and suggesting a few others that I implemented recently.