From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Using Git to manage your Emacs changes Date: Wed, 7 Apr 2010 15:23:13 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1270668217 29341 80.91.229.12 (7 Apr 2010 19:23:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Apr 2010 19:23:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 07 21:23:35 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NzaqY-00033C-6h for ged-emacs-devel@m.gmane.org; Wed, 07 Apr 2010 21:23:30 +0200 Original-Received: from localhost ([127.0.0.1]:44883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzaqX-0002Bf-6u for ged-emacs-devel@m.gmane.org; Wed, 07 Apr 2010 15:23:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzaqS-0002B5-AN for emacs-devel@gnu.org; Wed, 07 Apr 2010 15:23:24 -0400 Original-Received: from [140.186.70.92] (port=41296 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzaqR-0002Av-3o for emacs-devel@gnu.org; Wed, 07 Apr 2010 15:23:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzaqP-0001wC-7w for emacs-devel@gnu.org; Wed, 07 Apr 2010 15:23:23 -0400 Original-Received: from mail-pv0-f169.google.com ([74.125.83.169]:39497) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzaqP-0001w5-0U for emacs-devel@gnu.org; Wed, 07 Apr 2010 15:23:21 -0400 Original-Received: by pvg11 with SMTP id 11so1185126pvg.0 for ; Wed, 07 Apr 2010 12:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=TkM+/FT417z6WhCjnB3OMuQQuYtATQLdwg+it6k8/Oc=; b=kLwF5e1z2eTG5HHJLqavgwtj/RGjEOGHvDZPAPKPkA9HSrbbzUL85pesrzX3eQyzp0 oAOpXxK3PU9gF1Ju9p2IsaoRsuEQLoDEW/NcA6BsNiq+x1D0pAVcf9C+frbDVjCkr4nP pirFK1PXTiRok3xkP6CY1Uh3BU1hC6G/Ufw14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=Gyt8M1rbMQy2tUy0Gd5+AkwYtB7qLZMOfyu5PflhCzGNezm7PcGYjjeAaZZp/zDTV2 RucSagq6/vTUap3F0bA9/tIqybYrgFAfy2KBr7gF2vRn3rtYI3JuXuC2RmPhMFlWFhVF yNdpY9X6i76HPV/XntYGUTulPqE58JJHFDNAU= Original-Received: by 10.114.187.22 with SMTP id k22mr9144042waf.106.1270668200054; Wed, 07 Apr 2010 12:23:20 -0700 (PDT) Original-Received: from [192.168.9.141] (pool-74-105-230-191.nwrknj.fios.verizon.net [74.105.230.191]) by mx.google.com with ESMTPS id cm22sm11372504ibb.11.2010.04.07.12.23.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Apr 2010 12:23:18 -0700 (PDT) X-Mailer: Apple Mail (2.1078) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123325 Archived-At: If anyone here is like me and can't stand Bzr's interface/lack-of-speed = due to comfort with Git, there is a *somewhat* more palatable solution: 1. Install git-bzr (http://github.com/pieter/git-bzr). Make sure it = works by testing on some very small project from someplace. 2. Do a bzr checkout of Emacs. DO NOT use git-bzr to directly checkout = the Emacs tree. It will take days and days and download over 20G of = data. 3. Using git-bzr, point it at your local bzr checkout so it can do a = fully local translation of the Bzr commits to Git commits. This will take = several hours, but not hog network bandwidth. 4. When done, you can fetch Bzr changes into your tree with: git bzr fetch upstream 5. Now here's the tricky part. Move your .git directory from your = git-bzr checkout over into your Bzr working tree. Yes, we want Bzr and Git to manage = the same tree. You should be wearing your Depends; this is not for the faint = of heart. 6. Create a 'master' branch to queue your Git commits. You can make = topics branches off the branch, just never modify the upstream branch directly. git checkout -b master upstream 7. Sadly, git-bzr is sufficiently broken that you will not be able to = push your changes with "git bzr push upstream", as the docs indicate. = Instead, we have to use "git format-patch" and then turn each patch into a Bzr commit = manually, which get pushed with "bzr push". Once pushed, "git bzr pull = upstream" reflects that new commit back in Git: ./apply.sh upstream # apply commits using script below; stash = if needed bzr push git bzr fetch upstream git rebase upstream # git stash pop afterwards if needed 8. I expect a blank line after my initial commit description. If you = don't do this, remove the "| tail +2" from the apply script. It would seems that = using a blank line is standard in the Git community, but not using it in standard = for the Emacs tree. I know, it's quite ugly, but using Bazaar has proven even less = desirable. John #!/bin/bash git checkout ${1:-upstream} git format-patch ..master for i in [0-9]*.patch; do echo Applying $i patch -p1 < $i grep ^Subject: $i | sed 's/^Subject: \[PATCH\] //' > /tmp/msg.$$ perl -ne 'print if /^$/ .. /^---/;' $i | \ perl -ne 'print unless /^---/ .. eof()' | \ tail +2 >> /tmp/msg.$$ bzr commit -F /tmp/msg.$$ rm -f /tmp/msg.$$ done git reset --hard HEAD git checkout master rm -f [0-9]*.patch