Guilhem Bonnefille wrote:I did something similar recently: http://www.spinics.net/lists/git/msg29119.html The secret is to do a squash merge (git merge --squash) and commit that as a single revision onto the branch you commit into svn. 1--2--3------------4 (upstream) \ A--B--C--D (topic) As far as git's history is concerned, at this point you have a topic branch with a bunch of commits ABCD, and an upstream branch with a bunch of commits 1234. Revision 4 has the contents of ABCD but is not marked as a merge in git's revision history, which means git-svn won't be confused since it doesn't know how to follow merges. Now you do git svn dcommit to commit revision 4, which shows up as one commit on the svn side. git-svn will delete your revision 4 and create a new one whose comment includes the svn revision ID, so you'll have: 1--2--3------------4' (upstream) \ A--B--C--D (topic) Since git-svn will never look earlier than revision 4' to figure out which svn revision it should use as a basis for future svn commits, you can do whatever you want with the history up to revision 4'. In particular, you can use git's "grafts" feature to fake git into thinking that a merge actually took place. Open .git/info/grafts in your favorite editor and add a line with three SHA-1 hashes: hash-of-4' hash-of-3 hash-of-D Now as far as git is concerned you have the history you want: 1--2--3------------4' (upstream) \ / A--B--C--D (topic) Subsequent merges on the git side, whether they're squashed or not, will know about the merge you've just done. In his reply to my script, Junio correctly pointed out that all this fiddling really ought to be happening in git-svn itself; it ought to know that you've done a merge and should record that fact directly in the metadata for 4' rather than treating it as a single-parent commit. If you do the above a zillion times you'll end up with a huge grafts file which is not so clean. But as a stopgap measure, this does work adequately. -Steve - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| David Miller | Slow DOWN, please!!! |
| Press, Jonathan | RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning |
| Greg Kroah-Hartman | [patch 01/40] POWERPC: Fix platinumfb framebuffer |
| Chuck Ebbert | Why do so many machines need "noapic"? |
git: | |
| Matthieu Moy | git push to a non-bare repository |
| Junio C Hamano | Re: [PATCH] merge-recursive: Only print relevant rename messages |
| Petr Baudis | Re: [PATCH] Git homepage: remove all the references to Cogito |
| Sergei Organov | Newbie: report of first experience with git-rebase. |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | tbench wrt. loopback TSO |
| Elvis Pranskevichus | Re: sky2: eth0: hung mac 7:69 fifo 0 (165:176) |
| Richard Stallman | Real men don't attack straw men |
| Bertram Scharpf | First install: Grub doesn't find partitions |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Brian Candler | waitpid() thread race |
| VPN's on NetBSD | 4 hours ago | NetBSD |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 5 hours ago | Linux kernel |
| USB statistics | 7 hours ago | Linux kernel |
| Block Sub System query | 11 hours ago | Linux kernel |
| kernel module to intercept socket creation | 12 hours ago | Linux kernel |
| Image size changing during each build | 12 hours ago | Linux kernel |
| Soft lock bug | 17 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 1 day ago | Linux kernel |
| Question on swap as ramdisk partition | 1 day ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
