From nobody Sat Aug 28 22:04:38 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 7ABEC178D1B5 for ; Sat, 28 Aug 2021 22:04:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) (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 4GxrGv2m3Fz3mt9 for ; Sat, 28 Aug 2021 22:04:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x92b.google.com with SMTP id y36so5507346uad.7 for ; Sat, 28 Aug 2021 15:04:55 -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=ziOe25zmLmAkGprx1GLiHe4Ub0PIvxk3lIRDyE5Hki0=; b=KQkl6D7gL4lCsswgDv0oTLetA9Ru5Gz1dTqmAc8V8mjryd1Wy+LvOXNHIBZGRT0Fcd uW4O0BfLSSVl/mlbc603YAwzvT+OoYZfEvDFGvRrq8pn5fk04/40nigVntjQ8HmxCC+x tgeO+oroMuAbK4XqGxJn4W1aN4uScq3zenh7V9I3tHXj9GHFd32i4NspCJLOftmrhNgf Q7uRyWzKRCBYtfrBJEEx8jojmPXVhSvBejpxkhTLAMfT8BSnlWXFHpEx2lfmep5e/olG UxrikZR4J5nlHQC9edFoSwvKkPlkDLkjZhIRY4XyC53+c/SqR04QayQMdxG+0qfyP9Ey TwtA== 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=ziOe25zmLmAkGprx1GLiHe4Ub0PIvxk3lIRDyE5Hki0=; b=c70g08voNwNKEu53NdHc5jDrVGi0YuKFolvp050K/JHEbWCCqod1DvJfvZI1Vc1WOh yki7Ibdj+i9r8Ma5DaEa3FFmZqnNElZqbrhq7m0wbu4NjgaRYfDVrN3wlS1W/llY/ASX mskyVycgddX0SLeFf7MvbA56CQfVHnG5UGTkRwYHydAxZ7/wW5R+JdPOtSQPqcdPZuuV nKeMRNXUgEoT+BDHErBtto8U4xccAnXhOsgTX/kAZZkDRwhVTd7Cjo3IBf67zl4pofQo e9siupS3q+NuZ3/FSsi/qzXLZp6U5vYz/vWQqeudM0Dt0iTk9RwiOci2DrHpkN1LMUcF R31Q== X-Gm-Message-State: AOAM533qSHLgsiYZHk9IIqA7TzD91ya8couzxxaljP3sgN6LtcR47O5c JiTzeOm7Wd3MV2ffbbD2RUOGuzabpXH9woJcxYTzqd5iH4ZKbg== X-Google-Smtp-Source: ABdhPJxMx9xetM40ElnA9Aun+Aca+FI4faMkDCyMksz8sCJYn1puKq+6LevJeyaurwbCKA6IP2RyY+jCgMrlKyMBhXk= X-Received: by 2002:a9f:31c8:: with SMTP id w8mr11711375uad.77.1630188289086; Sat, 28 Aug 2021 15:04:49 -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> <20210828214853.vbo7kh5fo5n5nrdn@t480.local> In-Reply-To: <20210828214853.vbo7kh5fo5n5nrdn@t480.local> From: Warner Losh Date: Sat, 28 Aug 2021 16:04:38 -0600 Message-ID: Subject: Re: Phabricator workflow with Git To: "Danilo G. Baio" Cc: freebsd-git Content-Type: multipart/alternative; boundary="000000000000e36cff05caa5c963" X-Rspamd-Queue-Id: 4GxrGv2m3Fz3mt9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000e36cff05caa5c963 Content-Type: text/plain; charset="UTF-8" On Sat, Aug 28, 2021 at 3:48 PM Danilo G. Baio wrote: > On Sat, Aug 28, 2021 at 03:02:00PM -0600, Warner Losh wrote: > > Wow! That's convoluted. > > /me hides > Sorry, I guess I wasn't as kind at pointing out improvements to this as I could have been. Sorry about that. Warner > > > > 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. > > > > > Yes, sorry. > > > > > > $ 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 > > > > Glad that I sent this message here. > > So, I'll test/use `git arc`. > > Is there anything written about it elsewhere? > > Thank you for the prompt reply and the tips. > > Regards. > -- > Danilo G. Baio (dbaio) > --000000000000e36cff05caa5c963--