From owner-freebsd-git@freebsd.org Thu Jun 25 18:06:23 2020 Return-Path: Delivered-To: freebsd-git@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 39622340D91 for ; Thu, 25 Jun 2020 18:06:23 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49t7Hf3Gp4z4PKZ for ; Thu, 25 Jun 2020 18:06:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 66CC13C0199; Thu, 25 Jun 2020 18:06:21 +0000 (UTC) Date: Thu, 25 Jun 2020 18:06:21 +0000 From: Brooks Davis To: Warner Losh Cc: Sean Chittenden , freebsd-git@freebsd.org Subject: Re: svn primer translation to git Message-ID: <20200625180621.GC75705@spindle.one-eyed-alien.net> References: <20200625165547.GA75705@spindle.one-eyed-alien.net> <20200625171314.GB75705@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oJ71EGRlYNjSvfq7" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49t7Hf3Gp4z4PKZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-2.41 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.36)[-0.363]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.80)[-0.797]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.35)[-0.354]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2020 18:06:23 -0000 --oJ71EGRlYNjSvfq7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 25, 2020 at 11:47:24AM -0600, Warner Losh wrote: > On Thu, Jun 25, 2020 at 11:13 AM Brooks Davis wrote: >=20 > > On Thu, Jun 25, 2020 at 10:08:28AM -0700, Sean Chittenden wrote: > > > > > > > > generally follow a process of staging with `git add -p` + `git add`= for > > > > new files followed by `git status` and/or `git diff --staged`, and = then > > > > `git commit`. > > > > > > > > > > This is a good callout, Brooks. > > > > > > I'm routinely shocked by the number of people who don't know about or= use > > > `git add -p` as their muscle-memory way to add something to a commit.= We > > > definitely should go out of our way to document best practices. For > > > instance, this has been the workflow that I've worked in or pushed te= ams > > to > > > for the last 6yrs and have had decent success: > > > > > > 1. Create Github issue > > > 2. git checkout -b gh-${issue_number} > > > 3. git add -p > > > 4. git status > > > 5. git diff --staged > > > 6. git commit > > > 7. git push -u origin gh-${issue_number} > > > > > > Where `gh-` would be whatever bug-tracking system of choice that you > > fancy, > > > but it keeps branch naming concise and gives the future reader a hint= as > > to > > > where to look for discussion. While there may be variants of this, we > > > should begin to prescribe a consistent workflow that does not encoura= ge > > > `git commit -a -m "fixedit"` or committing directly to main (svn's fka > > > trunk branch). > > > > One practice I've not adopted that we may want to recommend (especially > > if we're going to have pre-commit scripts for people to install) is to > > make your origin use a read-only url so you have to make an explicit > > push to (e.g.) a freebsd remote. At least at the beginning when it > > appears we're going to be allowing direct commit, that's a way to > > limit foot shooting. > > >=20 > I almost always do a git show for each and every commit I push. The few > times I've tried to short cut this, I've wound up in trouble. >=20 > I also am a big believer in git rebase -i and git commit --amend to curate > the commits I'm going to push in. The more you can show people how to > double check the commit, fix what's broken, etc, the better off we'll be. > And the better off people will be since they will have more tools to > un-screwup something they did by mistake. Unlike svn, rewriting history > (especially local history) is a big feature. >=20 > I use git commit -a all the time, though, since I hate git add. But only > when I'm sure that's the right thing and I have enough checks and balances > in place with the curation process I can do that). I agree, we should > recommend against it. Since I also know how to un-footshoot w/o it being a > traumatic web search and anxiety ridden typing of git commands blind, > hoping for the best.... There's a time and place for many foot cannons, but there's no need to even mention them in our documentation unless it's completely essential. People can explore the infinite vastness of git options on their own. -- Brooks --oJ71EGRlYNjSvfq7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJe9OecAAoJEKzQXbSebgfAJcgIAKHlTycVagqTuIZqxM4BRDJ4 P/dxolyHCcCN1G6Ekx8OqsrZ0/3E8yghI4qcPQ/2fPVnbYto0vnqDzyfGAkdPBLl nw3Wqn2dnRnApox2c/wY+0oDs9ncLy5dVjrWiq+3avHp31mZPpBCFiaQ8oLIBe+s vODo2YJ48olc0GlTYYgQuWXblnri+IPnNoFDb32gOnn0X3aqIKVX80BfeM1VKZ+t SemqMaNHYYaoxx8nix9c/+g7Oj/mG/12mFpOR/RC1Pu2W0iTWpzGyMZuwB50S3Oj 9X8ELC1xKhFJxCWe8S3vaBObqSsBOwIxGVssV7s8Uba6MVQzHlMrYoFy4QDklQA= =8ngy -----END PGP SIGNATURE----- --oJ71EGRlYNjSvfq7--