From nobody Sat Aug 28 21:02:00 2021 X-Original-To: freebsd-git@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 6FB82179B2F5 for ; Sat, 28 Aug 2021 21:02:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vk1-xa2a.google.com (mail-vk1-xa2a.google.com [IPv6:2607:f8b0:4864:20::a2a]) (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 4Gxptd208dz3DvV for ; Sat, 28 Aug 2021 21:02:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vk1-xa2a.google.com with SMTP id j12so3057917vka.6 for ; Sat, 28 Aug 2021 14:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wLzdTWQRtt3BFKpPOOAcK2Zegi8mb4Q9ve3h+iaL3Ps=; b=ksnzLigXzbyzrD6wRfkR1MADF75R/0gqiKsSqtLm4U9tdjuiZGUIhsaZEXsynvXdoL cWAGpum4fEH35U2GWIrQxe1SdChaqqw6TOMmd9OTfiDSHM/I5NVBUgEIwm+g/T1FL5lb xsjIU6j+TENGUIg4RRalcYeQFCKU70NibIZK8YASBs5G/uUJAOReq20k7eYCMmyBa4zD OcoPzQAtbUAFsFz5xMRpOlwSQQS4uQ4uor8xwxMrb1EMA1Z8fPuKpXkknpIdyERmmvoC h9xGe3JX0U7mJ6OnjygzJt5a32TrT2z2Go7IH1avdXMA6LTuvy5I9dWNV3krea/Unbgt 8AbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wLzdTWQRtt3BFKpPOOAcK2Zegi8mb4Q9ve3h+iaL3Ps=; b=Kt5DxdI8Hfw8/X1i7IYYNsSctBJrdGP45Q8k6xBzruVQv9Sshn34uXtS+gQXarK+cA c7peaEZj6ozKvfn/WagjRl4ZnTGaUB8ARjQ3tcbUaOr/h+skSab+q+IhGl9F5y1IV2GB vHJe/TIS58eN8xEEAWUNPpOKAmp+xYIa44Vy2ZXUhX5W8EK956CXdfYsAE6Fij04ziIl NCzJ7InFeAx6+tSh8OHC4rRNCXjmyGT9gEs908Anvo4B4eEQ8CYt2PafoSrEqO2BfFjU +gX6UJDlmHwaRfN26g3SgqtHDibOGSh8j+tpxBP3zaZrjB5vSo4bFnsdhfgOw7wjsHF6 Iqeg== X-Gm-Message-State: AOAM533mb7f0oLx1UaPJSDEoIIs0684sO4rT5Uts+alwWwU3pGSrqF95 //akHPd8Ocsb1fDnSLlsFDsNGlAlxq5YmasFk+lGlIhAal2lBQ== X-Google-Smtp-Source: ABdhPJyyWoR2M6yesLyC4ruz1ynxeXZtbQ8f3q4trErTa1fFt4DipX9qgE5kIamPsgNga/Tpxmq7tK6Xw+hczLWJMxE= X-Received: by 2002:a1f:46c4:: with SMTP id t187mr8797191vka.10.1630184530809; Sat, 28 Aug 2021 14:02:10 -0700 (PDT) List-Id: Discussion of git use in the FreeBSD project List-Archive: https://lists.freebsd.org/archives/freebsd-git List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-git@freebsd.org MIME-Version: 1.0 References: <20210828204434.n45rsndnehy2tsnb@t480.local> In-Reply-To: <20210828204434.n45rsndnehy2tsnb@t480.local> From: Warner Losh Date: Sat, 28 Aug 2021 15:02:00 -0600 Message-ID: Subject: Re: Phabricator workflow with Git To: "Danilo G. Baio" Cc: freebsd-git Content-Type: multipart/alternative; boundary="000000000000e0a46405caa4e912" X-Rspamd-Queue-Id: 4Gxptd208dz3DvV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000e0a46405caa4e912 Content-Type: text/plain; charset="UTF-8" Wow! That's convoluted. On Sat, Aug 28, 2021 at 2:44 PM Danilo G. Baio wrote: > Hi. > > I'm currently using this workflow: > > - - - - - - - - - - - - - - - - - - - - - - - - - > > // Create a new branch > $ git checkout -b FEATURE > > // Change stuff and git commit > // Note that you already can include the Review information in > // Phabricator format. > > ``` > <> > > Summary: > > Test Plan: > > Reviewers: > > Subscribers: > ``` > > // Open a review with the first commit > $ arc diff --create HEAD~ > > > // If it's accepted, fix the commit log message, rebase with main > // branch, and push > All that's replaced by 'git arc create HEAD' > $ git commit --amend > $ git rebase -i main > $ git push remote_name FEATURE:main > git arc stage. This also takes care of adding differential revision, etc. will stage it into main, then you can just 'git push freebsd' to put it in the the tree. > // If it's NOT accepted > // Change stuff and add a second git commit > > // Update review with the two commits > $ arc diff --update DXXXXX HEAD~2 > git arc update does this automatically. > // If it's accepted, you can soft reset both commits and do a new one > // or, just use `git merge and squash`. > > // merge/squash way > // Set the second commit to be squashed > > $ git rebase -i main > > ``` > pick 954c5d4626 Readme: First commit > squash 7231873f23 Makefile: Second commit > ``` > > or > > $ git reset --soft HEAD~2 > // And add a final commit > I'd document only rebase. The git reset workflow is somewhat more dangerous and error-prone. // Submit > $ git push remote_name FEATURE:main > git arc stage git push is what I use, but I know lots of people like the branch:main notation. It's harder to use, though when you lose the race. If you stage on main, then git pull --rebase will do the right thing in one step rather than several. > // Delete FEATURE branch > > $ git checkout main > $ git pull origin main --no-ff > --ff-only don't you mean? You *NEVER* want a non-ff pull with upstream. Ever. It leads to great evil and lost changes. > $ git branch -d FEATURE > Yea, this is what I use, but I have a script that does this over all the branches.... > I know there are git-arc (tools/tools/git-arc) on base, but I still > didn't use it. > We should only document it, since it hides all this ugliness and makes things easier, less tedious and less error-prone. > I just want to check if there are other ways to do that (that you > recommend), or if can I document it, at least for now, on our > Phabricator Wiki page [1]. > > > 1 - https://wiki.freebsd.org/Phabricator While you can document what you've said, I found it somewhat confusing to follow, especially relative to git arc. Warner --000000000000e0a46405caa4e912--