all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Using Git to manage your Emacs changes
@ 2010-04-07 19:23 John Wiegley
  2010-04-07 19:32 ` David Reitter
                   ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: John Wiegley @ 2010-04-07 19:23 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2010-04-27 20:59 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 19:23 Using Git to manage your Emacs changes John Wiegley
2010-04-07 19:32 ` David Reitter
2010-04-07 20:25   ` John Wiegley
2010-04-07 21:22     ` David Reitter
2010-04-21 17:30   ` Ted Zlatanov
2010-04-21 18:12     ` David Reitter
2010-04-21 19:29       ` John Wiegley
2010-04-21 20:42         ` Eli Zaretskii
2010-04-22  7:17           ` John Wiegley
2010-04-22  9:41             ` Lennart Borgman
2010-04-22 10:28               ` Andreas Schwab
2010-04-22 11:09                 ` Lennart Borgman
2010-04-22 11:29                   ` Andreas Schwab
2010-04-22 16:20                     ` endless version control debates [was Re: Using Git to manage your Emacs changes] Glenn Morris
2010-04-22 17:02                       ` endless version control debates Óscar Fuentes
2010-04-22 17:07                       ` endless version control debates [was Re: Using Git to manage your Emacs changes] Leo
2010-04-22 17:52                         ` Chad Brown
2010-04-22 19:16                           ` Andreas Schwab
2010-04-22 20:09                             ` Chad Brown
2010-04-23  2:50                               ` endless version control debates Miles Bader
2010-04-22 20:16                           ` endless version control debates [was Re: Using Git to manage your Emacs changes] Leo
2010-04-22 20:46                             ` Eli Zaretskii
2010-04-22 21:10                             ` Jeff Clough
2010-04-22 10:40               ` Using Git to manage your Emacs changes Miles Bader
2010-04-23  8:38                 ` Juri Linkov
2010-04-23  9:29                   ` Ævar Arnfjörð Bjarmason
2010-04-24 13:20                   ` Richard Stallman
2010-04-24 15:27                     ` Jason Earl
2010-04-24 15:45                       ` Ævar Arnfjörð Bjarmason
2010-04-24 17:10                       ` Alfred M. Szmidt
2010-04-24 19:33                         ` Jason Earl
2010-04-24 20:33                           ` Alfred M. Szmidt
2010-04-24 20:36                           ` Eli Zaretskii
2010-04-24 21:54                             ` Jason Earl
2010-04-25  8:26                             ` Stephen J. Turnbull
2010-04-27 20:59                             ` Karl Fogel
2010-04-25 16:47                           ` Georg Brandl
2010-04-26 14:33                       ` Richard Stallman
2010-04-26 17:35                         ` Eli Zaretskii
2010-04-21 22:16         ` Andreas Schwab
2010-04-07 20:53 ` Giuseppe Scrivano
2010-04-07 20:37   ` Thierry Volpiatto
2010-04-08 22:27     ` John Wiegley
2010-04-08 22:43       ` Jonas Bernoulli
2010-04-09  6:04       ` Thierry Volpiatto
2010-04-08 16:57 ` Ken Raeburn

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.