[sr-dev] why git push fails

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Jun 9 19:27:55 CEST 2010


On Jun 09, 2010 at 18:50, Juha Heinanen <jh at tutpro.com> wrote:
> Andrei Pelinescu-Onciul writes:
> 
> > So far the only problem was the missing info/allowed-users.
> > I md5'ed all the other hooks and they are the original version.
> > 
> > The repository data looks ok so far. I don't think Juha's pull conflict
> > is related to it.
> 
> i just gave up and deleted whole sip-router git directory.  then i did
> 
> git clone --depth 1 git://git.sip-router.org/sip-router sip-router
> git checkout -b kamailio_3.0 origin/kamailio_3.0
> 
> and when i then try to cherry pick the commit i earlier today did on
> master, it fails like this:
> 
> $ eg cherry-pick 976fb426bb577fab033e7846625fbfa2a8a38399
> Automatic cherry-pick failed.  After resolving the conflicts,
> mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
> and commit the result with: 
> 
>         git commit -c 976fb426bb577fab033e7846625fbfa2a8a38399


It looks to me like a normal conflict: the versions in kamailio_3.0 and
 master are just too different and so cherry-pick-ing doesn't work.
 If you look in  the file given by git status
 (modules/mediaproxy/mediaproxy.c) and search for conflict markers
 ("<<<<", ">>>>", "====="), you'll see the conflicts:

<<<<<<< HEAD
||||||| parent of 976fb42... modules/mediaproxy: ICE fixes
    Bool has_ice;
======= 
    Bool has_ice;
    Bool has_rtcp_ice;
>>>>>>> 976fb42... modules/mediaproxy: ICE fixes


Which that the k_3.0 version did not have any has_ice (nothing between
<<<< and ||||), the original ancestor of the cherry picked master commit
had it (between |||| and ====) and the new version that you try to
cherry pick has both "has_ice" and "has_rtp_ice".

There are several conflicts. To me it looks the kamailio 3.0 version is
quite old compared to the master one and you are trying to apply a
commit which is too new.
I think you have to cherry-pick more:

$ git log --oneline --left-right --cherry-pick master...origin/kamailio_3.0 modules/mediaproxy/*.[ch]
<976fb42 modules/mediaproxy: ICE fixes - ICE attributes may appear at the sessio
<635ac30 modules/mediaproxy: some minor bug fixes and code cleanups
<1dd0a33 modules/mediaproxy: Added support for ICE negotiation.

Note that if you try to cherry-pick 1dd0a33 and 635ac30 you will still
get some conflicts in pkg/kamailio/debian-lenny.  The problem is that
the directory was changed into a symbolic link with the same name and
that's one of the things that confuses git (in general one should avoid
 deleting a file and creating a directory or symlink with the same name
 or vice-versa).

To solve this, every time you get a conflict on
pkg/kamailio/debian-lenny, run git reset pkg/kamailio/debian-lenny and
then continue with git commit -c ....

Using the above "method" I was able to cherry pick all the commits for
mediaproxy. Here's are the exact commands:

git cherry-pick -x 1dd0a33
git reset -- pkg/kamailio/debian-lenny
git commit -c 1dd0a33
git cherry-pick -x 635ac30
git reset -- pkg/kamailio/debian-lenny
git commit -c 635ac30
git cherry-pick -x 976fb42

The result compiles, but since I don't use or know anything about recent
mediaproxy, someone else should review if these cherry-picks are ok for
3.0


Andrei



More information about the sr-dev mailing list