From nobody Sat Aug 28 22:28: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 86DAC179E1FA for ; Sat, 28 Aug 2021 22:28:03 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gxrnb36ZGz3s3P; Sat, 28 Aug 2021 22:28:03 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4B91AD2F3; Sat, 28 Aug 2021 22:28:03 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 4264C27C0054; Sat, 28 Aug 2021 18:28:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 28 Aug 2021 18:28:03 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudduiedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesghdtre ertddtvdenucfhrhhomhepfdffrghnihhlohcuifdruceurghiohdfuceouggsrghiohes hfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepieefjeeujedtveeigfetue eggeeftdejueetleekueegleekvedvffffhedtheeknecuffhomhgrihhnpehfrhgvvggs shgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepuggsrghiohdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidquddukedu feeluddvtddqvdeikedtvdejieekqdgusggrihhopeephfhrvggvuefuffdrohhrghesfh grshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Aug 2021 18:28:01 -0400 (EDT) Date: Sat, 28 Aug 2021 19:28:00 -0300 From: "Danilo G. Baio" To: Warner Losh Cc: freebsd-git Subject: Re: Phabricator workflow with Git Message-ID: <20210828222800.ifyamklolyzz2vx7@t480.local> References: <20210828204434.n45rsndnehy2tsnb@t480.local> <20210828214853.vbo7kh5fo5n5nrdn@t480.local> 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="izrn6qracfwy63oh" Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N --izrn6qracfwy63oh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2021 at 04:04:38PM -0600, Warner Losh wrote: > On Sat, Aug 28, 2021 at 3:48 PM Danilo G. Baio wrote: >=20 > > On Sat, Aug 28, 2021 at 03:02:00PM -0600, Warner Losh wrote: > > > Wow! That's convoluted. > > > > /me hides > > >=20 > Sorry, I guess I wasn't as kind at pointing out improvements to this as I > could have been. > Sorry about that. >=20 > Warner >=20 Ah don't worry, you helped me a lot. =3D) Thanks! >=20 > > > > > > 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 o= ne > > > > // 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 notatio= n. > > > It's harder to use, though when you lose the race. If you stage on ma= in, > > > 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 upstrea= m. > > > 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 confusin= g 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) > > --=20 Danilo G. Baio (dbaio) --izrn6qracfwy63oh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEORj0UTsjzCy+enIkmpN7LfMuiNcFAmEquHBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDM5 MThGNDUxM0IyM0NDMkNCRTdBNzIyNDlBOTM3QjJERjMyRTg4RDcACgkQmpN7LfMu iNfUVA//Qv+1VHoQAbc7wuT40GrwAhOG6w5koR0wVtx700C8OB2ON3elYsW0nei0 RL58t5UraGxjqDXFVBySfxerDD07K2UKlgS8QKn8pidR3GEeqwbjQuXzrJrXaNH8 FagGHvaB5OWrAoNGayjtXod3huEjCmJApOUN1VK5bEm7n0Hdun2ivEW+dRFmzxIU BLxsgICKbpkZFX4XU/ARCfaVROnJAuRim3TLJPYXz7TRFvbHVBQkkPHQsaErAUga mmhBeCsy2bZWGrdJ/d7IyksflJu9E93en21RAB1nBCoJ5naMlmBUvWAladdTt5MV C5B1w3di2elLjhDweTNl6XPLc63QQKbL09W4plwFItBN7wflDCVpAiGkYQQDSMSE yzwEHkd46p1pR58QMV3qvwATFR5m30otNA6rGUCIrWbAF0mtuPRJtxrUlqW0HZMM aLYIOnM/d1jSKOdUfe1P1TR7fRY1TdPUMUeccfepnv9pgbm4vW3Y8PPKCI/pb7yZ IQ22J4JS1+Y9xMbTa/HTt1lX40Gru7le+W93dH4U1J83TR64NjWsVSBU/bUI3b7o +u63/s0VpklO9/mcba7CQTOsF0jSVqCZWgnRcn9N/CwyfYSSSjqrRtnAPzbhVyOh ddoWbb5gAioGjEukLmfEXp9AQhTI8SB1UByGeDeUmIyfYrJYMw8= =bKQF -----END PGP SIGNATURE----- --izrn6qracfwy63oh--