From owner-freebsd-git@freebsd.org Thu Jun 25 17:47:37 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 8547B34088D for ; Thu, 25 Jun 2020 17:47:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) (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 49t6t057NSz4NRb for ; Thu, 25 Jun 2020 17:47:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2f.google.com with SMTP id t7so3205792qvl.8 for ; Thu, 25 Jun 2020 10:47:36 -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=96+hupQZWeMolrTGU26wP+fIKERdVbFhF6tPlLsFnIY=; b=BCMvYhOFo46ToSDSVBRI7QusigcO3W6UdItIUwc7wCJcCzvFPskqAzdJWe0NvMVIAQ yoMwkNgPZxY4uzGw27VlwadHgMiLkNk1K6DWeHXuFxNYNVgrRvH6w09z9Lx/G5FtGWeQ q9fwdF6m913Np9pmGrcIdze7nP3afaGEu/YjR7za86y7SEG21crt8ta+K8LfXvZ3vKhG cxQydFH5T0vitTTl9qmqgQSL1lAlA1egnGWmlEAs7XnaT3JfA1Ho5ySjVI14fHjIWUj0 RZ34ltkgKtNFzI/QFq1QFrNcZ5TeHfg/pOY/glH2pDXng8+OkvsPNdJVEHn6MtFDksdt NWkg== 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=96+hupQZWeMolrTGU26wP+fIKERdVbFhF6tPlLsFnIY=; b=iJwuuTkjrZFtaNo/G95SS2n4ipuapCD9xIGgr9t85yRLGOkTrtNApSyzhwn8IJBAln YKKdCli5uiyORoq/pJI+jIzfNHhhiKXCnPBrUon5lC7sEQ58kiHVR7Wu1YZKifCj/0K4 3jC0ZENqJ02KDBBSpeWxOvWIaEmeQA5nd8z1LmQlVFLHkD+h/gMJyVBXhjgX9m60yv9H om4pIEahdV667EmMIhAs7xg/XalAUWdW9VBkTEQ4TABn8924REr0uDE5jC+2kMpmsNQQ KhQF5rwlQAUJlf9FUwZOpa0suvOJO29Xuig+dYqZtiyr2GSKLHLYO/+lVb6EOX0wYCfE u7Yg== X-Gm-Message-State: AOAM5302vAPhr+ZzwfJDLuyBhi/DVjrEkQH31L3fD/d09/SQvopwqRAK bc/Z3WErVisZVcy83sVht3UpXqouiMHHghctVyYlMV+P8jU= X-Google-Smtp-Source: ABdhPJypsyPndmYAzSsLk1y/PhAQ+zIK/38GvjfpOvuor/G/w8hHQgizGYSidLDiBrLaTz9urq+VxzsI/jvsBfo6CeQ= X-Received: by 2002:a05:6214:922:: with SMTP id dk2mr37784051qvb.87.1593107255052; Thu, 25 Jun 2020 10:47:35 -0700 (PDT) MIME-Version: 1.0 References: <20200625165547.GA75705@spindle.one-eyed-alien.net> <20200625171314.GB75705@spindle.one-eyed-alien.net> In-Reply-To: <20200625171314.GB75705@spindle.one-eyed-alien.net> From: Warner Losh Date: Thu, 25 Jun 2020 11:47:24 -0600 Message-ID: Subject: Re: svn primer translation to git To: Brooks Davis Cc: Sean Chittenden , freebsd-git@freebsd.org X-Rspamd-Queue-Id: 49t6t057NSz4NRb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=BCMvYhOF; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f2f) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.53 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.87)[-0.866]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.943]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.72)[-0.723]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2f:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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 17:47:37 -0000 On Thu, Jun 25, 2020 at 11:13 AM Brooks Davis wrote: > 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 teams > 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 encourage > > `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. > 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. 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. 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.... Warner