From owner-freebsd-git@freebsd.org Sat Feb 25 09:32:53 2017 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C32C90116 for ; Sat, 25 Feb 2017 09:32:53 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id C91E115DD for ; Sat, 25 Feb 2017 09:32:53 +0000 (UTC) (envelope-from bright@mu.org) Received: from Alfreds-MacBook-Pro-2.local (unknown [IPv6:2601:645:8003:a4d6:d8bf:e990:4c4e:16c0]) by elvis.mu.org (Postfix) with ESMTPSA id 3C837346DE24 for ; Sat, 25 Feb 2017 01:32:53 -0800 (PST) Subject: Re: Reconsider switching from svn to git? To: freebsd-git@freebsd.org References: <49da18e4-b211-c48d-5486-368cda912fc0@multiplay.co.uk> <86mvdfy3qs.fsf@desk.des.no> <931513c8-3247-3664-3958-c352400d0736@gjunka.com> From: Alfred Perlstein Message-ID: Date: Sat, 25 Feb 2017 01:32:53 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <931513c8-3247-3664-3958-c352400d0736@gjunka.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 25 Feb 2017 09:32:53 -0000 On 2/21/17 2:41 PM, Grzegorz Junka wrote: > I am not the recipients of these questions but would like to add some > comments. > > On 21/02/2017 20:22, Ed Maste wrote: >> On a different (non-public) list we've been discussing git in FreeBSD, >> and I wanted to discuss one of Warner's points further. Before asking >> I asked for approval to quote the message here. >> >> On 21 February 2017 at 11:36, Warner Losh wrote: >>> However, there's one big drawback we don't have with svn: it destroys >>> history. Rebasing branches destroys history, as does deleting >>> branches. In svn, you can always get that information back, but not so >>> with git. It's very easy to do these operations and quite difficult to >>> undo them. >> I'd like to understand this better. In my opinion, in general >> commit(s) should stand alone -- any metadata associated with the >> commit (PR numbers, review links, etc.) should be in the commit >> message itself. The fact that they were originally done on a branch >> should only be an "implementation detail." So I agree rebasing and >> committing loses that history, but think in general it should not >> matter. >> > > Rebasing doesn't destroy history, just rewrites them. It creates as > many commits as the original branch, but they are applied on top of > the changed branch, so may differ from the original commits depending > on what changes were in the original branch. However, this shouldn't > matter since rebasing should NOT be used with branches that are public > (were pushed to the remote server). That's precisely because rebase > rewrites commits - if someone rebased 5 last commits in a branch which > someone else already pulled, when merging these 5 commits back > together there will be conflicts because the rebased commits don't > match the original ones. > > So, any public branches should be merged rather than rebased, and > merge preserves all history, including the previous and next commits > in the chain of changes. In order to reduce amount of commits it's > also a good practice to squash the commits before merging. For > example, someone works on a feature in a separate branch, then instead > of merging that branch to the integration branch directly they create > a squashed commit that contains all changes from that separate branch. Yes! -Alfred