# RE: git-svn and u-boot broken.

6 messages from 2006-10-15 to 2006-10-18. Participants: Joakim Tjernlund, Eric Wong, Seth Falcon.
Thread: https://gitlist.dev/t/5933

## Joakim Tjernlund, 2006-10-15 22:09

Subject: RE: git-svn and u-boot broken.
Message-ID: <012b01c6f0a6$a1a636e0$1267a8c0@Jocke>
URL: https://gitlist.dev/e/012b01c6f0a6%24a1a636e0%241267a8c0%40Jocke

```
> > > Any chance you can update it with more examples?
> > > Especially one that show how one can do one big initial
> > > commit then merge your own changes on top of that?
> > 
> > Hmm.. large imports from git to svn can get confusing, and generally
> > aren't very useful on the svn side since history gets flattened.
> > So I generally don't recommend importing complete git histories into
> > svn.
> 
> Yes, that's what I am trying to avoid below. Basically I want 
> to commit to SVN the
> whole u-boot tree as one commit up to the point where I 
> started to do my changes.
> Then I want my changes per commit on top of that. However I 
> don't want to loose the
> ability to merge/pull in future updates from denx u-boot tree.
> 
> I just don't know how to do it, the script below fails when 
> it tries to 
> pull the rest of the tree. Any ideas?

I really need some advice here, if you can share some ideas that would be great.

> 
> > 
> > > Something like this
> > > REPO="file:///tmp/SVNuboot"
> > > REPO_PATH="/tmp/SVNuboot"
> > > GIT_REPO="/tmp/mygituboot"
> > > ORG_REPO="/usr/local/src/u-boot"
> > > rm -rf "$REPO_PATH"
> > > rm -rf "$GIT_REPO"
> > > svnadmin create "$REPO_PATH"
> > > svn mkdir -m "initial repo layout" "$REPO"/trunk 
> > "$REPO"/branches "$REPO"/tags
> > > mkdir -p "$GIT_REPO"
> > > cd "$GIT_REPO"
> > > git-svn init "$REPO"/trunk
> > > echo  [user] >> .git/config
> > > echo  name="jocke" >> .git/config
> > > echo  email="Joakim.Tjernlund@transmode.se" >> .git/config
> > > git-svn fetch
> > > git checkout -b svn-branch remotes/git-svn
> > > git-fetch "$ORG_REPO" tmcu2:tmcu
> > > git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
> > > git pull . initial-uboot
> > > # --squash makes one large commit.
> > > git pull --squash . initial-uboot
> > > cg-commit -m "merge up to 
> f5e0d03970409feb3c77ab0107d5dece6b7d45c9"
> > > git-svn commit -q remotes/git-svn..svn-branch
> > > git pull . tmcu # This doesn't work, I get merge conflicts
> > > git-svn commit -q remotes/git-svn..svn-branch
> > > 
> > > Anyhow, I am glad to report that after applying your patch all my
> > > problems with went away, no more Too many open file desc,  memory
> > > alloc failed or Inappropriate ioctl for device, Thanks a lot.
> > 
> > Cool, good to know.  It seems like the apply_textdelta 
> returning undef
> > was a result of memory allocation failures, then.
> 
> Or possibly the older subversion I used(1.3.2), now I am on 1.4.0 
> 

```

## Eric Wong, 2006-10-16 03:47

Subject: Re: git-svn and u-boot broken.
Message-ID: <20061016034736.GA8782@localdomain>
URL: https://gitlist.dev/e/20061016034736.GA8782%40localdomain
In-Reply-To: <012b01c6f0a6$a1a636e0$1267a8c0@Jocke>

```
Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:
> > > > Any chance you can update it with more examples?
> > > > Especially one that show how one can do one big initial
> > > > commit then merge your own changes on top of that?
> > > 
> > > Hmm.. large imports from git to svn can get confusing, and generally
> > > aren't very useful on the svn side since history gets flattened.
> > > So I generally don't recommend importing complete git histories into
> > > svn.
> > 
> > Yes, that's what I am trying to avoid below. Basically I want 
> > to commit to SVN the
> > whole u-boot tree as one commit up to the point where I 
> > started to do my changes.
> > Then I want my changes per commit on top of that. However I 
> > don't want to loose the
> > ability to merge/pull in future updates from denx u-boot tree.
> > 
> > I just don't know how to do it, the script below fails when 
> > it tries to 
> > pull the rest of the tree. Any ideas?
> 
> I really need some advice here, if you can share some ideas that would be great.
> 
> > 
> > > 
> > > > Something like this
> > > > REPO="file:///tmp/SVNuboot"
> > > > REPO_PATH="/tmp/SVNuboot"
> > > > GIT_REPO="/tmp/mygituboot"
> > > > ORG_REPO="/usr/local/src/u-boot"
> > > > rm -rf "$REPO_PATH"
> > > > rm -rf "$GIT_REPO"
> > > > svnadmin create "$REPO_PATH"
> > > > svn mkdir -m "initial repo layout" "$REPO"/trunk 
> > > "$REPO"/branches "$REPO"/tags
> > > > mkdir -p "$GIT_REPO"
> > > > cd "$GIT_REPO"
> > > > git-svn init "$REPO"/trunk
> > > > echo  [user] >> .git/config
> > > > echo  name="jocke" >> .git/config
> > > > echo  email="Joakim.Tjernlund@transmode.se" >> .git/config
> > > > git-svn fetch
> > > > git checkout -b svn-branch remotes/git-svn
> > > > git-fetch "$ORG_REPO" tmcu2:tmcu

I assume the tmcu* branch is private as I don't see it in the u-boot
repo.

> > > > git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
> > > > git pull . initial-uboot
> > > > # --squash makes one large commit.
> > > > git pull --squash . initial-uboot
> > > > cg-commit -m "merge up to 
> > f5e0d03970409feb3c77ab0107d5dece6b7d45c9"
> > > > git-svn commit -q remotes/git-svn..svn-branch
> > > > git pull . tmcu # This doesn't work, I get merge conflicts
> > > > git-svn commit -q remotes/git-svn..svn-branch

Using -q suppresses potentially useful information.  I wouldn't use
it if you're not sure about what you're doing.

I would do something like this:

... (same stuff as above before with svn setup...)
git clone $ORG_REPO $GIT_REPO
cd $GIT_REPO
git-svn init "$REPO"/trunk
git-svn fetch

# sync the SVN repo with initial-uboot
# this will just commit a snapshot, without history, which I assume
# is what you want.
git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
git-svn commit initial-uboot
git checkout -b svn-branch remotes/git-svn
git-pull . tmcu2

# this should work assuming the path from initial-uboot..tmcu2 is linear
# use gitk initial-uboot..tmcu2 to check
git-svn dcommit

Also, git-svn is really designed for individual developers who prefer to
use git, but need to interact with project that already uses SVN.
u-boot already uses git, so I don't see why you'd need git-svn :)

-- 
Eric Wong

```

## Joakim Tjernlund, 2006-10-16 10:06

Subject: Re: git-svn and u-boot broken.
Message-ID: <453359A2.5090704@transmode.se>
URL: https://gitlist.dev/e/453359A2.5090704%40transmode.se
In-Reply-To: <20061016034736.GA8782@localdomain>

```
Eric Wong wrote:
[SNIP]
> 
> Using -q suppresses potentially useful information.  I wouldn't use
> it if you're not sure about what you're doing.

OK.

> 
> I would do something like this:
> 
> ... (same stuff as above before with svn setup...)
> git clone $ORG_REPO $GIT_REPO
> cd $GIT_REPO
> git-svn init "$REPO"/trunk
> git-svn fetch
> 
> # sync the SVN repo with initial-uboot
> # this will just commit a snapshot, without history, which I assume
> # is what you want.
> git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
> git-svn commit initial-uboot
> git checkout -b svn-branch remotes/git-svn
> git-pull . tmcu2
> 
> # this should work assuming the path from initial-uboot..tmcu2 is linear
> # use gitk initial-uboot..tmcu2 to check
> git-svn dcommit

Great! This was exactly what I wanted, thanks. I never realized that one should
do git-svn commit initial-uboot to get that single commit.
I also replaced git-svn dcommit with git-svn commit remotes/git-svn..svn-branch
as I don't have that version yet.

You should add this as an example I think.

Can I ask for an example that used multi-init and multi-fetch? I tried, but
could not make it work.

> 
> Also, git-svn is really designed for individual developers who prefer to
> use git, but need to interact with project that already uses SVN.
> u-boot already uses git, so I don't see why you'd need git-svn :)

Yes, but the thing is that the rest of our product is svn based including
the build env. So I have to supply a SVN tree for build purposes and if someone
else has to do a minor fix I can't ask him to learn git first :(

 jcoke

```

## Eric Wong, 2006-10-16 18:31

Subject: [RFH] git-svn documentation [was Re: git-svn and u-boot broken]
Message-ID: <20061016183101.GL27128@hand.yhbt.net>
URL: https://gitlist.dev/e/20061016183101.GL27128%40hand.yhbt.net
In-Reply-To: <453359A2.5090704@transmode.se>

```
Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:
> Eric Wong wrote:
> > I would do something like this:
> > 
> > ... (same stuff as above before with svn setup...)
> > git clone $ORG_REPO $GIT_REPO
> > cd $GIT_REPO
> > git-svn init "$REPO"/trunk
> > git-svn fetch
> > 
> > # sync the SVN repo with initial-uboot
> > # this will just commit a snapshot, without history, which I assume
> > # is what you want.
> > git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
> > git-svn commit initial-uboot
> > git checkout -b svn-branch remotes/git-svn
> > git-pull . tmcu2
> > 
> > # this should work assuming the path from initial-uboot..tmcu2 is linear
> > # use gitk initial-uboot..tmcu2 to check
> > git-svn dcommit
> 
> Great! This was exactly what I wanted, thanks. I never realized that one should
> do git-svn commit initial-uboot to get that single commit.
> I also replaced git-svn dcommit with git-svn commit remotes/git-svn..svn-branch
> as I don't have that version yet.
> 
> You should add this as an example I think.
> 
> Can I ask for an example that used multi-init and multi-fetch? I tried, but
> could not make it work.

git-svn multi-init https://svn.musicpd.org/mpd -T trunk -t tags -b branches
git-svn multi-fetch

In the latest git-svn (should be in 1.4.3), you can re-run 'git-svn
multi-init' with no arguments to discover new tags+branches.

Anybody willing to supply patches for better documentation?  I'll be
quite busy with other projects the next two weeks, asciidoc is quite
slow for me; but I'd like to have better docs for git-svn in 1.4.3.

-- 
Eric Wong

```

## Joakim Tjernlund, 2006-10-16 21:44

Subject: RE: [RFH] git-svn documentation [was Re: git-svn and u-boot broken]
Message-ID: <015f01c6f16c$4a447440$1267a8c0@Jocke>
URL: https://gitlist.dev/e/015f01c6f16c%244a447440%241267a8c0%40Jocke
In-Reply-To: <20061016183101.GL27128@hand.yhbt.net>

```
> Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:
> > Eric Wong wrote:
> > > I would do something like this:
> > > 
> > > ... (same stuff as above before with svn setup...)
> > > git clone $ORG_REPO $GIT_REPO
> > > cd $GIT_REPO
> > > git-svn init "$REPO"/trunk
> > > git-svn fetch
> > > 
> > > # sync the SVN repo with initial-uboot
> > > # this will just commit a snapshot, without history, 
> which I assume
> > > # is what you want.
> > > git-branch initial-uboot f5e0d03970409feb3c77ab0107d5dece6b7d45c9
> > > git-svn commit initial-uboot
> > > git checkout -b svn-branch remotes/git-svn
> > > git-pull . tmcu2
> > > 
> > > # this should work assuming the path from 
> initial-uboot..tmcu2 is linear
> > > # use gitk initial-uboot..tmcu2 to check
> > > git-svn dcommit
> > 
> > Great! This was exactly what I wanted, thanks. I never 
> realized that one should
> > do git-svn commit initial-uboot to get that single commit.
> > I also replaced git-svn dcommit with git-svn commit 
> remotes/git-svn..svn-branch
> > as I don't have that version yet.
> > 
> > You should add this as an example I think.
> > 
> > Can I ask for an example that used multi-init and 
> multi-fetch? I tried, but
> > could not make it work.
> 
> git-svn multi-init https://svn.musicpd.org/mpd -T trunk -t tags -b branches
> git-svn multi-fetch

This is how far I got too(sorry for beeing unclear). It is the 
remaing bits that I got stuck on. How would the remaining git-svn
commands look like in the above example?

> 
> In the latest git-svn (should be in 1.4.3), you can re-run 'git-svn
> multi-init' with no arguments to discover new tags+branches.
> 
> Anybody willing to supply patches for better documentation?  I'll be
> quite busy with other projects the next two weeks, asciidoc is quite
> slow for me; but I'd like to have better docs for git-svn in 1.4.3.

That would be great, I am still very much in the dark.

 Jocke

```

## Seth Falcon, 2006-10-18 17:22

Subject: Re: [RFH] git-svn documentation
Message-ID: <m2mz7tr121.fsf@ziti.local>
URL: https://gitlist.dev/e/m2mz7tr121.fsf%40ziti.local
In-Reply-To: <20061016183101.GL27128@hand.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:
> Anybody willing to supply patches for better documentation?  I'll be
> quite busy with other projects the next two weeks, asciidoc is quite
> slow for me; but I'd like to have better docs for git-svn in 1.4.3.

I'm starting to use git-svn more and would be willing to attempt to
contribute some additional docs.  What I have in mind is a howto use
git-svn sort of document (unless that isn't seen as useful)

... unfortunately, as I use git-svn more I'm encountering some
questions which will need resolution before I can have much confidence
in my howto :-\

Will post some howto and questions separately.

+ seth

```
