* git-svn error "Unable to extract revision information from commit ...~1"
@ 2007-06-26 19:09 Victor Bogado da Silva Lins
2007-06-27 1:50 ` Steven Grimm
0 siblings, 1 reply; 5+ messages in thread
From: Victor Bogado da Silva Lins @ 2007-06-26 19:09 UTC (permalink / raw)
To: git
First of all, before I state the problems I am running into, I must say
that I loved git. It is easy to setup, since there is no need to
initialize a server or repository, powerful, because one can branch and
merge as needed something that was harder in others. And on top of
everything it is very easy to follow up the history with gitk. :-)
But not everything are flowers in my git-life. I have to use svn to
commit upstream, in fact there are two different upstream svn servers. I
tryied to maintain both coordinates using two git-svn repositories. But
there are ocasions that the git-svn repository gets into a state that
dcommit simply does not work anymore. :-(
The problem seem to be that when I merge the head with another branch
git-svn does not know where to follow to meet the "svn trunk". So what
happens it that I have a head that was merged from a side track
development (usually rooted on the other svn server) and then it goes to
the wrong side.
for instance :
o master (merge commit) 17696dc402da59f8eba0dcd60f15a66859cb0c2a
|\
| o remotes/trunk svn head c0691ffaa3a41c6b5c13aec5b06b64f6321efd35
| |
o | mine local modifications f1494e9bb4c237253587c1ffdc150394c6813100
| |
...
...
When I try to use dcommit the command fails to find the coorect path to
make and send the diffs. I saw that svn-git user uses git-rev-list to
make this path, but look at the list this command gives me :
17696dc402da59f8eba0dcd60f15a66859cb0c2a
f1494e9bb4c237253587c1ffdc150394c6813100
c0691ffaa3a41c6b5c13aec5b06b64f6321efd35
the problem is that the last element is not a git-svn commit and the
tool simply whants him to be son of a git-svn commit, this is the commit
that goes "f1494e9bb4c237253587c1ffdc150394c6813100", an it is not on
the last position as expected.
Got searchs for metadata in the wrong place and "boom" break... I don't
know how to rever into a sane state, nor how can I avoid to get into
this situatiom, since I havo not yet found a clear reason on how this
came to be.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-svn error "Unable to extract revision information from commit ...~1"
2007-06-26 19:09 git-svn error "Unable to extract revision information from commit ...~1" Victor Bogado da Silva Lins
@ 2007-06-27 1:50 ` Steven Grimm
2007-06-27 2:20 ` Junio C Hamano
[not found] ` <1182947236.21320.3.camel@omicron.ep.petrobras.com.br>
0 siblings, 2 replies; 5+ messages in thread
From: Steven Grimm @ 2007-06-27 1:50 UTC (permalink / raw)
To: Victor Bogado da Silva Lins; +Cc: git
Victor Bogado da Silva Lins wrote:
> The problem seem to be that when I merge the head with another branch
> git-svn does not know where to follow to meet the "svn trunk".
The current release of git-svn doesn't support committing merges. It has
no clue how to walk nonlinear history, as you point out. The current
practice is to do "git merge --squash" when merging into the git-svn
branch that you want to use as the basis for your svn commit. The
--squash option will make git merge the contents of the other branch(es)
but record the resulting tree as a regular commit, not as a merge.
There is a work-in-progress patch which might help you if you need to
preserve merge ancestry on the git side. Search the mailing list
archives for "[PATCH] git-svn: allow dcommit to retain local merge
information" if you want to try it (but be aware that it is just an
initial implementation and may have bugs; it was posted so people could
try it out and report back any problems to the author.)
-Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-svn error "Unable to extract revision information from commit ...~1"
2007-06-27 1:50 ` Steven Grimm
@ 2007-06-27 2:20 ` Junio C Hamano
[not found] ` <1182947236.21320.3.camel@omicron.ep.petrobras.com.br>
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2007-06-27 2:20 UTC (permalink / raw)
To: Steven Grimm; +Cc: Victor Bogado da Silva Lins, git
Steven Grimm <koreth@midwinter.com> writes:
> Victor Bogado da Silva Lins wrote:
>> The problem seem to be that when I merge the head with another branch
>> git-svn does not know where to follow to meet the "svn trunk".
>
> The current release of git-svn doesn't support committing merges. It
> has no clue how to walk nonlinear history, as you point out. The
> current practice is to do "git merge --squash" when merging into the
> git-svn branch that you want to use as the basis for your svn
> commit. The --squash option will make git merge the contents of the
> other branch(es) but record the resulting tree as a regular commit,
> not as a merge.
>
> There is a work-in-progress patch which might help you if you need to
> preserve merge ancestry on the git side. Search the mailing list
> archives for "[PATCH] git-svn: allow dcommit to retain local merge
> information" if you want to try it (but be aware that it is just an
> initial implementation and may have bugs; it was posted so people
> could try it out and report back any problems to the author.)
... which has been cooking in 'next' for the past two weeks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-svn error "Unable to extract revision information from commit ...~1"
[not found] ` <1182947236.21320.3.camel@omicron.ep.petrobras.com.br>
@ 2007-06-27 16:57 ` Steven Grimm
[not found] ` <e2a1d0aa0706271031n3191a27fi41ca5ba3f14c3a51@mail.gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Steven Grimm @ 2007-06-27 16:57 UTC (permalink / raw)
To: Victor Bogado da Silva Lins; +Cc: 'git'
Victor Bogado da Silva Lins wrote:
> I will try that, but on the other hand is it possible to commit the
> diff between my head and the svn head with a new message? This would
> be good enough for me.
Yes, that's pretty easy; you just have to do a squash merge to eliminate
the nonlinear history. Assuming the svn head is called "trunk" and your
head is called "myhead":
# start with the svn head
git checkout -b trunk tempbranch
# bring in all the changes from your branch
git merge --squash myhead
# commit with whatever message you want
git commit
# and ship it up to svn land
git svn dcommit
-Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-svn error "Unable to extract revision information from commit ...~1"
[not found] ` <e2a1d0aa0706271031n3191a27fi41ca5ba3f14c3a51@mail.gmail.com>
@ 2007-06-27 20:25 ` Steven Grimm
0 siblings, 0 replies; 5+ messages in thread
From: Steven Grimm @ 2007-06-27 20:25 UTC (permalink / raw)
To: Patrick Doyle; +Cc: 'git'
Patrick Doyle wrote:
> Wouldn't the svn head be called "git-svn"?
> Should the first checkout be written as:
>
> git checkout -b tempbranch git-svn
>
> (In other words, were the "trunk" and "tempbranch" arguments swapped
> in your example?)
Yes, sorry, I swapped the arguments. Should indeed be "git checkout -b
(your new branch name) (svn head branch name)" rather than the other way
around. My apologies for not proofreading my message.
However, the name of the svn head branch depends on the version of
git-svn you're using, and how you cloned the svn repository. If you used
the -T/--trunk option, then the svn head branch will indeed be called
"trunk" (and you might also have other branches corresponding to
whatever branches you're tracking in the svn repository.) If you're not
using that option, then your svn tracking branch will be called
"git-svn" or "origin" depending on your git-svn version.
> Finally, what is the purpose of creating a new branch as part of that
> command?
You never ever want to work directly on the git-svn tracking branch. It
is considered a remote branch and while it is technically possible to
check it out and commit to it, you will almost certainly confuse git-svn
if you do.
Also, creating a new branch means you still have your original nonlinear
history easily accessible if you need it (just check out your old
branch.) You can certainly still get at the old history without creating
a new branch, but it's more awkward.
-Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-27 20:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26 19:09 git-svn error "Unable to extract revision information from commit ...~1" Victor Bogado da Silva Lins
2007-06-27 1:50 ` Steven Grimm
2007-06-27 2:20 ` Junio C Hamano
[not found] ` <1182947236.21320.3.camel@omicron.ep.petrobras.com.br>
2007-06-27 16:57 ` Steven Grimm
[not found] ` <e2a1d0aa0706271031n3191a27fi41ca5ba3f14c3a51@mail.gmail.com>
2007-06-27 20:25 ` Steven Grimm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).