libreoffice - Why does git warn me that my branch has diverged from master? -


i'm contributing libreoffice , have started learning git. i've cloned libreoffice repository , got successful build. libreoffice has 19 git repositories 1 named bootstrap , remaining @ 1 level lower named writer, calc, postprocess, base etc. has got script maned g running git commands simultaneously in repositories instead of running individually.

after cloning created patch pushed in remote repository. @ moment changes have been committed(i.e. git diff outputs nothing) , status i'm commit ahead of master branch.

now when run ./g pull -r output:

victor@victor-laptop:~/git/libo$ ./g pull -r ===== main repo ===== current branch master date. ===== artwork ===== current branch master date. ===== base ===== current branch master date. ===== calc ===== current branch master date. ===== components ===== current branch master date. ===== extensions ===== current branch master date. ===== extras ===== current branch master date. ===== filters ===== current branch master date. ===== ===== current branch master date. ===== impress ===== current branch master date. ===== libs-core ===== current branch master date. ===== libs-extern ===== current branch master date. ===== libs-extern-sys ===== current branch master date. ===== libs-gui ===== http://anongit.freedesktop.org/git/libreoffice/libs-gui    08137a2..d314277  master     -> origin/master first, rewinding head replay work on top of it... fast-forwarded master d3142771895c2e9ce029e3b52af7f1ea1b437a6b. ===== postprocess ===== current branch master date. ===== sdk ===== current branch master date. ===== testing ===== current branch master date. ===== ure ===== current branch master date. ===== writer ===== u   sw/source/core/doc/docdesc.cxx u   sw/source/core/frmedt/fews.cxx m   sw/source/core/inc/swxmlblockexport.hxx u   sw/source/core/inc/undocore.hxx u   sw/source/core/inc/ascharanchoredobjectposition.hxx u   sw/source/core/inc/frame.hxx pull not possible because have unmerged files. please, fix them in work tree, , use 'git add/rm <file>' appropriate mark resolution, or use 'git commit -a'. 

which shows problem files in write module (sw) , files mentioned ones used in patch contributed.

the git diff shows this:

victor@victor-laptop:~/git/libo$ cd sw victor@victor-laptop:~/git/libo/sw$ git diff diff --cc sw/source/core/doc/docdesc.cxx index 0900b18,52b984e..0000000 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@@ -216,7 -216,7 +216,11 @@@ void swdoc::chgpagedesc( sal_uint16 i,        if( rchged.getnumtype().getnumberingtype() != pdesc->getnumtype().getnumbe       {           pdesc->setnumtype( rchged.getnumtype() ); ++<<<<<<< head  +        // den seitennummernfeldern bescheid sagen, ++======= +         // bug 64121 - den seitennummernfeldern bescheid sagen, ++>>>>>>> removal of bogus comments in writer module           //            das sich das num-format geaendert hat           getsysfldtype( res_pagenumberfld )->updateflds();           getsysfldtype( res_refpagegetfld )->updateflds(); diff --cc sw/source/core/frmedt/fews.cxx index 6fe4bf0,4dc82ff..0000000 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@@ -1266,6 -1267,7 +1266,10 @@@ size swfeshell::getgraphicdefaultsize(       return aret;   }  ++<<<<<<< head ++======= + // add output parameter <bvertl2r> ++>>>>>>> removal of bogus comments in writer module   sal_bool swfeshell::isfrmvertical(const sal_bool benvironment, sal_bool& brtl,   {       sal_bool bvert = sal_false; diff --cc sw/source/core/inc/undocore.hxx index e8fda05,99f4722..0000000 --- a/sw/source/core/inc/undocore.hxx +++ b/sw/source/core/inc/undocore.hxx @@@ -133,6 -133,7 +133,10 @@@ class swundofmtcoll : public swundo, pr       void dosetfmtcoll(swdoc & rdoc, swpam & rpam);    public: ++<<<<<<< head ++======= + //    swundofmtcoll( const swpam&, swfmtcoll* ); ++>>>>>>> removal of bogus comments in writer module       swundofmtcoll( const swpam&, swfmtcoll*,                      const bool breset,                      const bool bresetlistattrs ); @@@ -202,6 -203,7 +206,10 @@@ public       virtual void repeatimpl( ::sw::repeatcontext & );   };  ++<<<<<<< head ++======= + //-------------------------------------------------------------------- ++>>>>>>> removal of bogus comments in writer module    const int nundostringlength = 20;  diff --cc sw/source/core/inc/ascharanchoredobjectposition.hxx index 16dde41,2f868a9..0000000 --- a/sw/source/core/inc/ascharanchoredobjectposition.hxx +++ b/sw/source/core/inc/ascharanchoredobjectposition.hxx @@@ -140,7 -140,7 +140,11 @@@ namespace objectpositionin               point getanchorpos() const;               // calculated relative position base line object position ty ++<<<<<<< head  + ++======= +             ++>>>>>>> removal of bogus comments in writer module               swtwips getrelposy() const;              // determined object rectangle including spacing object position diff --cc sw/source/core/inc/frame.hxx index 664f28b,94db9cc..0000000 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@@ -248,6 -250,9 +248,12 @@@ enum makepagetyp       makepage_nosection        // don't create section frames   };  ++<<<<<<< head ++======= + // #i28701# - replaced new class <swsortedobjs> + //typedef sdrobject* sdrobjectptr; + //sv_decl_ptrarr(swdrawobjs,sdrobjectptr,1,1); ++>>>>>>> removal of bogus comments in writer module    class swfrm: public swclient, public sfxbroadcaster   { (end) 

and git status shows this:

victor@victor-laptop:~/git/libo/clone/writer$ git status # not on branch. # changes committed: #   (use "git reset head <file>..." unstage) # #   modified:   sw/source/core/inc/swxmlblockexport.hxx # # unmerged paths: #   (use "git reset head <file>..." unstage) #   (use "git add/rm <file>..." appropriate mark resolution) # #   both modified:      sw/source/core/doc/docdesc.cxx #   both modified:      sw/source/core/frmedt/fews.cxx #   both modified:      sw/source/core/inc/undocore.hxx #   both modified:      sw/source/core/inc/ascharanchoredobjectposition.hxx #   both modified:      sw/source/core/inc/frame.hxx # # untracked files: #   (use "git add <file>..." include in committed) # #   0001-removal-of-bogus-comments-in-writer-module.patch 

if try resolve conflicts manually editing files, git tells me master has diverged origin/master. situation continues in cycle. please me out. can problem , how can resolve it?

why git warn me branch has diverged master?

git warning branch has diverged master because branch has diverged master.

if understood situation correctly, first created new commit (let's call b) on top of master (let's call a). git says correctly 1 commit ahead of origin's master.

a---b 

meanwhile, other people added new commits on top of origin's master:

a---b  \   c---d---e 

at point, master , origin's master have diverged. have 1 commit origin/master not have, , origin/master has 3 commits not have. 1 of these 3 might patch sent (i see file created git format-patch in git status output, guessing sent patch); applying patch not create exact same commit (at least commiter name , timestamp different).

when git pull, git has merge commit (b) commits not have, creating merge commit (let's call f):

a---b-------f  \         /   c---d---e 

note that, again, origin/master not have commits (b , f time). if adds new commits origin/master, have merge again.

now, how out of situation? there several ways. 1 push changes origin, has have. abandon commits , reset master origin/master. , third 1 rebase commits on top of origin/master.

if guessing correctly sent changes email via git format-patch , applied, best way out in case reset master origin/master. avoid problem in future, best work in separate branch , switch master before pulling changes upstream.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -