git-svn 1.5.3 does not understand grafts?
svnadmin create /usr/local/src/TM/svn-tst/7720-svn/
svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir" svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"
In my git repo I do
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echo da783cce390ce013b19f1d308ea6813269c6a6b5 $graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git-svn dcommit
fails with:
Committing to file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ... Commit da783cce390ce013b19f1d308ea6813269c6a6b5
has no parent commit, and therefore nothing to diff against. You should be working from a repository originally created by git-svn
Jocke
Quoted 14 lines · Joakim Tjernlund
svnadmin create
/usr/local/src/TM/svn-tst/7720-svn/
svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir" svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"In my git repo I do
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git-svn dcommit
Quoted 8 lines
fails with:
Committing to file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ... Commitda783cce390ce013b19f1d308ea6813269c6a6b5
has no parent commit, and therefore nothing to diff against. You should be working from a repository originally created by git-svnJocke
Using filter-branch helps, but git-svn isn't too happy:
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echo da783cce390ce013b19f1d308ea6813269c6a6b5 $graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git filter-branch $graftid..HEAD
git-svn dcommit
Now I get alot of complaints, but it commits to svn.
It takes forever though:
r3 = 55a489bd4f66dd1f641a4676359d7b8911dc7d83 (git-svn)
W: HEAD and refs/remotes/git-svn differ, using rebase:
:100644 100644 f85ae11af7715a224015582724cb2bab87ec914a7dc27f2dc58f6dd46cff79d5d762e630febfd419 M Makefile :100644 1006444fa08aee7d4cd193cb161115cc079e7c50326e230246a89da64f08b0b48f7aa16886bbb2b12df237 M adc.c :100644 10064484eba702cce3a9e4f125162f77f3ea52ae45aebc78347f1f40f7526142bcc5db0708f50dd6150c0a M adc.h :100644 100644890dfe7abdac0aa03eeca24572d98e3953db69d7c2367a52e99af1f036dfc1de442f08cb187a58ab M bmi.c :100644 10064492ae3ce7c8c0b3a664dc4ace8ce29b9ac7fd2d9b40fb9b886e3a51189e662d54cbdbb968e244aa53 M bmi.h :100644 100644a21005f15af34cd17e6acd8f1de974e3d82af0f4ba2c2c4b19bbbfdabae6d3a9980132c4e1e1c07c M cdrbug.c :100644 1006445a299761b62ca83fc22d30086b9a082c4de23ee43f885b0d8b7c29e7970997ed608df12e23d78644 M config.c :100644 1006448a0a8ed90e50d18a9865fa2f5e644ca083a8b783 a2153ef48a59ffdf5a84ca6b93106c98dcb27a9c M control.c :100644 100644 760b828d8e55f6314d313e176578546e3d76b22b 143b44923e1f40d89fa9e87a30dd63abc48cea57 M database.c :100644 100644 e7cab9865317c1ab4cbe8ecb47b5fda7c0eddcd8 ff519b51ae5428b93504f124ea1f24452b69fa94 M database.h :100644 100644 a28219bc7b5bc692242639fae0e5b54cfaec7bc3 78c8df626c1cf9c989f127f96161850f92cd4588 M defines.h :100644 100644 21e68f9a09a2618493eed4f4c1796293db78c82868659b3a1bc25a90b103824e089c7c6126f5367b M eeprom.c :100644
100644 3095638b3f28d5b8e04be1c660fc37bf82e034c27ea0835e82aa230f1834b9977ec6a634c400e244 M eeprom.h :100644 0000008f7368e29d7ba3dbe34c8e6ad7a3738b68dd1d78
0000000000000000000000000000000000000000 D fpga.c :100644 0000002dded257891ada8228f684e9be213b86b6c1fda5
0000000000000000000000000000000000000000 D fpga.h :100644 10064497ccea82dd35a7d5973199511d7a9127981f74d33758a9334cf04bb670ae2563ad5f2b95af257f3b M fwrev.h :100644 100644cd80946581062ead075ba6047d51ae2605e4cc142ef670ea229b62bc1b10d087ab2bd3850f08e91a M glitch.c :100644 100644d14716ec4351b610dbac81637623a9ca3a8e89029e1789933635a5b9e2c562a3c69a973e07b31b7b M i2cmux.c :100644 1006446551153cf879ba87d73aa53aa6b768867b026842 4a2813b41231461ab4b316829f9e59ac36498813 M i2cmux.h :100644 100644 2967bc6e21ab9581a47266966867ded04d8076f15294b80cbad8d7501fa8c415a0b7b0e1a3343262 M led.c :100644 1006449b8016b9c3f13a5fb4446a1f31d1d2311ece32df2014113eaff9c22f4efd347031d3b7651aa78648 M led.h :100644 100644e4d50a5a735105187304f0458cde9102c64aa163faba2f86b6f86f944ce4995ec5cab2edea0d3bb6 M lvd.c :100644 100644aa86ba2a2c313ca688700e75a4353a4d66846b54bbc2a887b404a06d28ee77c5343278f3a309371f M main.c :100644 100644d0f5f5f6538924cfe757e8cdb328f4d7bf9858bd25e10d528df873425cf32b366c42c01a84367459 M memmap.c :100644 1006449bdc8d928ce77ed2f529a0709a3f54a882c37b8b086b7fc9dd915e43f21e94e963a18184669d361d M optosfp.c :000000 100644
0000000000000000000000000000000000000000bb8184467f03194f7aa8cc964a5dfe37603539e3 A pld.c :000000 100644
0000000000000000000000000000000000000000405486a29ca8be8212bc307017404ebbed904fe0 A pld.h :100644 100644b361784c0b617bdceac5e297e0c3dbb96b2a3dae869bf82b2e8b710150abf88ca34a9e12378f1415 M protocol.c :100644
100644 988233f538e9df6c681b2f60a19279567ca2536d55d9627846575f5f63d907a6dd07979040c64552 M protocol.h :100644
100644 b43a0c32977e11ad6ccbe9704ce8fdace8914e4d 7872778d025990cdc014d6ca907a3cf9e75050b1 M shell.c :100644 100644 0134ff4ca1a1f8b8d760eb4e367057dbb88b68edcda0e129d5fc1390dd7d1e1dd5b9695651c5dcdd M spi.c :100644 1006443ea874f32fa1eab87f4d2261a922dc293f37994724e1be7f8bfe9570464260b6d210cbf7771edaab M task.c :100644 100644ca1f966200e5f7126fe0b61a768a5e4b1d49bc9487a516572095292add8b1b19687a624c38ad205f M trans.c :100644 100644b298cc58873100e5e74f53d2a3f62028caba8951853c18b6c42f9d463f14eede3b84ed700b00dcd5 M transceiver.cFirst,
rewinding head to replay your work on top of it...
HEAD is now at 55a489b... Initial import of 7700, sws100034.
I get alot similar messages until it is finished.
Jocke
Quoted 36 lines · Joakim Tjernlund
Quoted 14 lines · Joakim Tjernlund
svnadmin create
/usr/local/src/TM/svn-tst/7720-svn/
svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir" svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"In my git repo I do
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git-svn dcommitQuoted 8 lines
fails with:
Committing to file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ... Commitda783cce390ce013b19f1d308ea6813269c6a6b5
has no parent commit, and therefore nothing to diff against. You should be working from a repository originally created by git-svnJocke
Using filter-branch helps, but git-svn isn't too happy:
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git filter-branch $graftid..HEAD
git-svn dcommit
Quoted 5 lines
Now I get alot of complaints, but it commits to svn. It takes forever though:
r3 =55a489bd4f66dd1f641a4676359d7b8911dc7d83(git-svn)
W: HEAD and refs/remotes/git-svn differ, using rebase:
:100644 100644f85ae11af7715a224015582724cb2bab87ec914a
[SNIP]
Just wanted to add that 1.5.2.2 works with grafts and that I suspect sub read_commit_parents in git-svn, but as I don't do perl I am stuck.
Jocke
Oh, Eric W. CC:ed as well this time
Quoted 34 lines · Joakim Tjernlund
Quoted 33 lines · Joakim Tjernlund
Quoted 14 lines · Joakim Tjernlund
svnadmin create
/usr/local/src/TM/svn-tst/7720-svn/
svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir" svn mkdir file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"In my git repo I do
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git-svn dcommitQuoted 5 lines
fails with:
Committing to file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ... Commitda783cce390ce013b19f1d308ea6813269c6a6b5
has no parent commit, and therefore nothing to diff against. You should be working from a repository originally created by git-svnUsing filter-branch helps, but git-svn isn't too happy:
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid > .git/info/grafts #da783... is the initial commit in my git tree.
git filter-branch $graftid..HEAD
git-svn dcommit
Quoted 5 lines
Quoted 5 lines
Now I get alot of complaints, but it commits to svn. It takes forever though:
r3 =55a489bd4f66dd1f641a4676359d7b8911dc7d83(git-svn)
W: HEAD and refs/remotes/git-svn differ, using rebase:
:100644 100644f85ae11af7715a224015582724cb2bab87ec914a
I haven't used filter-branch myself, but you probably need to remove all .rev_db* files in $GIT_DIR after running it (git-svn can recreate them unless you use the svmRevProps or noMetadata options.
Quoted 5 lines
[SNIP]
Just wanted to add that 1.5.2.2 works with grafts and that I suspect sub
read_commit_parentsin git-svn, but as I don't do perl I am stuck.
Crap, it looks like I completely forgot about the existence of grafts while doing this function.
Quoted 2 lines
Jocke
Oh, Eric W. CC:ed as well this time
Thanks.
Signature · 1 line
Eric Wong
Quoted 56 lines
-----Original Message-----
From: Eric Wong [mailto:[email protected]]
Sent: den 8 september 2007 07:02
To: Joakim Tjernlund
Cc: git
Subject: Re: git-svn 1.5.3 does not understand grafts?Quoted 4 lines · Joakim Tjernlund
Quoted 3 lines · Joakim Tjernlund
Quoted 2 lines · Joakim Tjernlund
svnadmin create
/usr/local/src/TM/svn-tst/7720-svn/svn mkdirfile:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir"
Quoted 1 line
Quoted 1 line
Quoted 1 line
svn mkdir
file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
In my git repo I do
git-svn initfile:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit inmy git tree
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
graftid=
git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid.git/info/grafts
Quoted 5 lines
Quoted 5 lines
#da783... is the initial commit in my git tree.
git-svn dcommitfails with:
Committing tofile:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ...
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Commit
da783cce390ce013b19f1d308ea6813269c6a6b5has no parent commit, and therefore nothing to diff against. You should be working from a repository originallycreated by git-svn
Quoted 9 lines
Quoted 9 lines
Using filter-branch helps, but git-svn isn't too happy:
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid >.git/info/grafts
Quoted 9 lines
Quoted 9 lines
#da783... is the initial commit in my git tree.
git filter-branch $graftid..HEAD
git-svn dcommitNow I get alot of complaints, but it commits to svn. It takes forever though:
r3 =55a489bd4f66dd1f641a4676359d7b8911dc7d83(git-svn)
W: HEAD and refs/remotes/git-svn differ, using rebase:
:100644 100644f85ae11af7715a224015582724cb2bab87ec914a
Quoted 4 lines
I haven't used filter-branch myself, but you probably need to remove all
.rev_db* files in $GIT_DIR after running it (git-svn can recreate them unless you use the svmRevProps or noMetadata options.
havn't used it either, but I wanted to see if it makes a difference. I will remember to remove the .rev_db* files next time I try.
filter branch is overkill if the grafts file works as git-svn will rewrite the commits so once the first dcommit has been made, I can remove the grafts file.
I do have another project though were I want to fix som odd parenting caused by set-tree, there I will have to used filter-branch to make it permanet.
Quoted 9 lines
Quoted 6 lines
[SNIP]
Just wanted to add that 1.5.2.2 works with grafts and that I suspect sub
read_commit_parentsin git-svn, but as I don't do perl I am stuck.Crap, it looks like I completely forgot about the existence of grafts while doing this function.
:)
Do you have to worry about grafts in git-svn?
Can't git plumbing do this for you?
Quoted 10 lines
Quoted 3 lines
Jocke
Oh, Eric W. CC:ed as well this timeThanks.
Signature · 1 line
Eric Wong
Quoted 63 lines
-----Original Message-----
From: Eric Wong [mailto:[email protected]]
Sent: den 8 september 2007 07:02
To: Joakim Tjernlund
Cc: git
Subject: Re: git-svn 1.5.3 does not understand grafts?Quoted 4 lines · Joakim Tjernlund
Quoted 3 lines · Joakim Tjernlund
Quoted 2 lines · Joakim Tjernlund
svnadmin create
/usr/local/src/TM/svn-tst/7720-svn/svn mkdirfile:///usr/local/src/TM/svn-tst/7720-svn/trunk -m "Add trunk dir"
Quoted 1 line
Quoted 1 line
Quoted 1 line
svn mkdir
file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp -m "Add swp dir"
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
In my git repo I do
git-svn initfile:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit inmy git tree
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
graftid=
git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid.git/info/grafts
Quoted 5 lines
Quoted 5 lines
#da783... is the initial commit in my git tree.
git-svn dcommitfails with:
Committing tofile:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp ...
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Commit
da783cce390ce013b19f1d308ea6813269c6a6b5has no parent commit, and therefore nothing to diff against. You should be working from a repository originallycreated by git-svn
Quoted 9 lines
Quoted 9 lines
Using filter-branch helps, but git-svn isn't too happy:
git-svn init file:///usr/local/src/TM/svn-tst/7720-svn/trunk/swp git-svn fetch
git branch svn remotes/git-svn
#make remotes/git-svn parent to the initial commit in my git tree graftid=git-show-ref -s svn
echoda783cce390ce013b19f1d308ea6813269c6a6b5$graftid >.git/info/grafts
Quoted 9 lines
Quoted 9 lines
#da783... is the initial commit in my git tree.
git filter-branch $graftid..HEAD
git-svn dcommitNow I get alot of complaints, but it commits to svn. It takes forever though:
r3 =55a489bd4f66dd1f641a4676359d7b8911dc7d83(git-svn)
W: HEAD and refs/remotes/git-svn differ, using rebase:
:100644 100644f85ae11af7715a224015582724cb2bab87ec914aI haven't used filter-branch myself, but you probably need to remove all
.rev_db* files in $GIT_DIR after running it (git-svn can recreate them unless you use the svmRevProps or noMetadata options.
Quoted 8 lines
Quoted 5 lines
[SNIP]
Just wanted to add that 1.5.2.2 works with grafts and that I suspect sub
read_commit_parentsin git-svn, but as I don't do perl I am stuck.Crap, it looks like I completely forgot about the existence of grafts while doing this function.
hmm, I think git-cat-file is to blame.
git-cat-file commit da783cce390ce013b19f1d308ea6813269c6a6b5 does not list list any parent even though I did graftid=git-show-ref -s remotes/git-svn
echo da783cce390ce013b19f1d308ea6813269c6a6b5 $graftid > .git/info/grafts
Jocke
Quoted 3 lines · Joakim Tjernlund
hmm, I think git-cat-file is to blame.
git-cat-file commitda783cce390ce013b19f1d308ea6813269c6a6b5does not list list any parent...
The plumbing cat-file does not deal with grafts and this is deliberate. Otherwise you would not be able to find the true set of parents when you'd want to.
So do not blame cat-file, but blame the Porcelain that uses cat-file to read a commit object, without annotating what it read with what is in grafts, in this case your command line experiment ;-).
The log family of commands and rev-list plumbing while traversing commit ancestry chain do take grafts into account.
One caveat is pretty=raw output format shows true parents without grafts on "parent " header line, while the "commit " fake header prepended in the output for each commit shows the parents that takes into account.
To illustrate, if you forge the history and say the parent of 1ddea77 is 5da1606 (when the true parent is 820eca68) with grafts mechanism, here is what happens:
$ echo '1ddea77e449ef28d8a7c74521af21121ab01abc0 5da1606d0bf5b970fadfa0ca91618a1e871f6755' >.git/info/grafts
$ git show -s --pretty=raw --parents 1ddea77
commit 1ddea77e449ef28d8a7c74521af21121ab01abc0 5da1606d0bf5b970fadfa0ca91618a1e871f6755
tree e9e61bc801438062978ff47b0963c536ed1e51a9
parent 820eca68c2577d7499d203d7f4f7ae479b577683
author Nick Hengeveld <[email protected]> 1127757131 -0700
committer Junio C Hamano <[email protected]> 1127805558 -0700 [PATCH] Return CURL error message when object transfer fails
Return CURL error message when object transfer fails
...
$ git-cat-file commit 1ddea77
tree e9e61bc801438062978ff47b0963c536ed1e51a9
parent 820eca68c2577d7499d203d7f4f7ae479b577683
author Nick Hengeveld <[email protected]> 1127757131 -0700
committer Junio C Hamano <[email protected]> 1127805558 -0700
[PATCH] Return CURL error message when object transfer fails
Return CURL error message when object transfer fails
...PATCH 1/1 git-svn: understand grafts when doing dcommit
Use the rev-list --parents functionality to read the parents of the commit. cat-file only shows the raw object with the original parents and doesn't take into account grafts; so we'll rely on rev-list machinery for the smarts here.
---
Quoted 35 lines · Junio C Hamano
Quoted 3 lines · Joakim Tjernlund
hmm, I think git-cat-file is to blame.
git-cat-file commitda783cce390ce013b19f1d308ea6813269c6a6b5does not list list any parent...The plumbing cat-file does not deal with grafts and this is deliberate. Otherwise you would not be able to find the true set of parents when you'd want to.
So do not blame cat-file, but blame the Porcelain that uses cat-file to read a commit object, without annotating what it read with what is in grafts, in this case your command line experiment ;-).
The log family of commands and rev-list plumbing while traversing commit ancestry chain do take grafts into account.
One caveat is pretty=raw output format shows true parents without grafts on "parent " header line, while the "commit " fake header prepended in the output for each commit shows the parents that takes into account.
To illustrate, if you forge the history and say the parent of 1ddea77 is 5da1606 (when the true parent is
820eca68) with grafts mechanism, here is what happens:$ echo '1ddea77e449ef28d8a7c74521af21121ab01abc0 5da1606d0bf5b970fadfa0ca91618a1e871f6755' >.git/info/grafts $ git show -s --pretty=raw --parents 1ddea77 commit 1ddea77e449ef28d8a7c74521af21121ab01abc0 5da1606d0bf5b970fadfa0ca91618a1e871f6755 tree e9e61bc801438062978ff47b0963c536ed1e51a9 parent 820eca68c2577d7499d203d7f4f7ae479b577683 author Nick Hengeveld <[email protected]> 1127757131 -0700 committer Junio C Hamano <[email protected]> 1127805558 -0700
Quoted 4 lines
[PATCH] Return CURL error message when object transfer fails
Return CURL error message when object transfer fails
...
Interesting. I didn't know about the --parents option before.
git-svn.perl | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-)
git-svn.perl +3 -8
@@ -841,14 +841,9 @@ sub working_head_info { sub read_commit_parents { my ($parents, $c) = @_; - my ($fh, $ctx) = command_output_pipe(qw/cat-file commit/, $c); - while (<$fh>) { - chomp; - last if ''; - /^parent ($sha1)/ or next; - push @{$parents->{$c}}, $1; - } - close $fh; # break the pipe + chomp(my $p = command_oneline(qw/rev-list --parents -1/, $c)); + $p =~ s/^($c)\s*// or die "rev-list --parents -1 $c failed!\n"; + @{$parents->{$c}} = split(/ /, $p); } sub linearize_history {
Signature · 1 line
Eric Wong