Date: Sat, 28 Aug 2021 18:48:53 -0300 From: "Danilo G. Baio" <dbaio@FreeBSD.org> To: Warner Losh <imp@bsdimp.com> Cc: freebsd-git <freebsd-git@freebsd.org> Subject: Re: Phabricator workflow with Git Message-ID: <20210828214853.vbo7kh5fo5n5nrdn@t480.local> In-Reply-To: <CANCZdfqb4VMpa%2BLD1C5tmdf93Mp%2BjoEjE_tVdHigsQB9rLVA0w@mail.gmail.com> References: <20210828204434.n45rsndnehy2tsnb@t480.local> <CANCZdfqb4VMpa%2BLD1C5tmdf93Mp%2BjoEjE_tVdHigsQB9rLVA0w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--pacsgcql5ee3p3ay Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 28, 2021 at 03:02:00PM -0600, Warner Losh wrote: > Wow! That's convoluted. /me hides >=20 > On Sat, Aug 28, 2021 at 2:44 PM Danilo G. Baio <dbaio@freebsd.org> wrote: >=20 > > 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. > > > > ``` > > <<Replace this line with your Revision Title>> > > > > 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 > > >=20 > All that's replaced by 'git arc create HEAD' >=20 >=20 > > $ git commit --amend > > $ git rebase -i main > > $ git push remote_name FEATURE:main > > >=20 > git arc stage. This also takes care of adding differential revision, etc. >=20 > will stage it into main, then you can just 'git push freebsd' to put it in > the the tree. >=20 >=20 > > // 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 > > >=20 > git arc update <commits> >=20 > does this automatically. >=20 >=20 > > // 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 > > >=20 > I'd document only rebase. The git reset workflow is somewhat more dangero= us > and error-prone. >=20 > // Submit > > $ git push remote_name FEATURE:main > > >=20 > git arc stage > git push >=20 > 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. >=20 >=20 > > // Delete FEATURE branch > > > > $ git checkout main > > $ git pull origin main --no-ff > > >=20 > --ff-only don't you mean? You *NEVER* want a non-ff pull with upstream. > Ever. It leads to great evil and lost changes. >=20 Yes, sorry. >=20 > > $ git branch -d FEATURE > > >=20 > Yea, this is what I use, but I have a script that does this over all the > branches.... >=20 >=20 > > I know there are git-arc (tools/tools/git-arc) on base, but I still > > didn't use it. > > >=20 > We should only document it, since it hides all this ugliness and makes > things easier, less tedious and less error-prone. >=20 >=20 > > 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 >=20 >=20 > While you can document what you've said, I found it somewhat confusing to > follow, especially relative > to git arc. >=20 > 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. --=20 Danilo G. Baio (dbaio) --pacsgcql5ee3p3ay Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEORj0UTsjzCy+enIkmpN7LfMuiNcFAmEqr0JfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDM5 MThGNDUxM0IyM0NDMkNCRTdBNzIyNDlBOTM3QjJERjMyRTg4RDcACgkQmpN7LfMu iNdsYRAAsYuidoMzBe6YQrqLjerTWXdG8P3xALBT+1qc+iJLcjHA4ayYcAugQkgf oa9Pui7c3j5ISji0QbSploWvblzU5JGbqkgmX5aj6LiLsVmPc/KDeWYafJ0Zyx7Y JQzq83mdzBeOryioHEQb1DH3xdG5YP6uGH3cyZQM0aU4YsYif5d+7dP6+fty1aQe QaqNxbcBoEM5VsDLwOFaj4SszXybKDL/FgQ3IFSpGp4dG7FUgXNLmDsUb5mtZ13V nxbRIoKZGacQUE4rv5Rgo+gzogidwdSa0n6iR/3EXDNC8GCtu0bLsDEUjzUB5pGY YER9foMVzfoLH/BKtLt7kJYGaSLE0GOBEegLEt+eC/vSl8jaDxqESESXxb1qs5AX lS39aPRabqarWOxgu1iQiqFgqjkzavuLv2x9ixJtsD/M8eVRYzoq6fHw2Mhr5CiQ rm7Kh98U2eFSzFr4sDuhDfLT4KdvAK0xepufuIjRS3Mou+/Qd3FFV7TpH3MjKVI/ SJNWSJ5dCirregXCcy+h5ALRLLJOgXGnKS7PWVSGw21vICDCfNHyYIWN7UdNoX45 NSysu2Ztyabhcu/FAWXwAO1/EFoqeF6sGdo885f0Hy+WQ0i16YvFLMgCqblmutxY 1PAHpSrDD+OH5cuML+7NEescFqE6uZ/R3hL8uYGx0ajl26CFs0E= =cyOM -----END PGP SIGNATURE----- --pacsgcql5ee3p3ay--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210828214853.vbo7kh5fo5n5nrdn>