From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.devel Subject: Re: Switching from old git tree Date: Fri, 14 Nov 2014 14:29:33 +0100 Message-ID: <877fyxc3lu.fsf@yahoo.fr> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415971823 19361 80.91.229.3 (14 Nov 2014 13:30:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2014 13:30:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: peder@news.klingenberg.no (Peder O. Klingenberg) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 14 14:30:13 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpGx0-0003PY-LX for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2014 14:30:10 +0100 Original-Received: from localhost ([::1]:36550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpGwz-000162-Vd for ged-emacs-devel@m.gmane.org; Fri, 14 Nov 2014 08:30:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpGwX-0000vh-Rq for emacs-devel@gnu.org; Fri, 14 Nov 2014 08:29:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpGwS-0001ok-8m for emacs-devel@gnu.org; Fri, 14 Nov 2014 08:29:41 -0500 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:13519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpGwS-0001oX-3I for emacs-devel@gnu.org; Fri, 14 Nov 2014 08:29:36 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiQKAPcCZlSkD4Xx/2dsb2JhbABbhDyCNrcOBpsKAoE2AQEBAQF9hAMBAQMBeQULCAMhJQ8BBFMJGgGIEAEMCbxYjRwBhy8BAQEBBgEBAQEehj6CSIdOTgeESwWeTIE0g1SCY4sFhAqDfTwwgksBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 14 Nov 2014 14:29:34 +0100 In-Reply-To: (Peder O. Klingenberg's message of "Fri, 14 Nov 2014 12:26:41 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177072 Archived-At: peder@news.klingenberg.no (Peder O. Klingenberg) writes: > I have been using the old git-mirror for a while. In there, I have a > branch with some local modifications. > > I understand that I need to check out a fresh tree now after the > conversion? What is the smoothest way of integrating my local branch in > this new tree? I'm a very basic git user, and the only way I can think > of is to extract the patches from my old branch and applying them by > hand in the new tree. Is there something else I should be doing > instead? Hello, First of all, you can add the new repository as a remote of your old one (or your old repo in your new tree, if you prefer). This means that both old and new (rewritten) commits will live in one repository, which also means you can use full git power instead of having to transfer patches from one tree to the other. (although that certainly is a solution also) Then rebasing is your friend, with its "--onto" argument. Here's my approach. (See also "caveats" at the end) First, find where your branch diverged from the (now deceased) official git mirror : MERGEBASE=$(git merge-base old-mirror-on-savannah/emacs-24 emacs-24) In the above, - The name of the branch old-mirror-on-savannah/emacs-24 is clear. - "emacs-24" is my personnal branch, where I have commits that are not in the official tree. Alternatively, you can look at the "git log emacs-24" and write down the first SHA1 that's not a commit of yours. Now, you have to find a commit in the branch emacs-new-savannah-repo/emacs-24 which looks similar to $MERGEBASE, because that's where you want to graft your commits. To do that, I look for an identical commit date. This is the kind of game I can't play well, so please forgive unnecessary complicatedness : Here's the unix timestamp of $MERGEBASE : DATESTAMP=$(git --no-pager show -s --format="%at" $MERGEBASE) and here is a commit which has the same timestamp : ONTOHASH=$(git log --format="%H %at" emacs-new-savannah-repo/emacs-24 | grep $DATESTAMP'$' | head -1 | cut -d" " -f 1) (it's awful, surely there's a better way.) Now you can check that $ONTOHASH and $MERGEBASE are indeed "the same" commit, and use git rebase --onto $ONTOHASH $MERGEBASE Then, repeat for every branch you want to rebase. "worked for me"... at least I think so :) -- Nicolas Richard