Errors handling during git rebase

Need help, or want to share a macro? Post here!
Jee-Bee
Posts: 627
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Errors handling during git rebase

Postby Jee-Bee » Tue Feb 28, 2017 7:20 pm

Hello

I start basic programming for FEM workbench... see http://forum.freecadweb.org/viewtopic.php?f=18&t=20217&p=162309#p162309
the problem i have is rebasing. Since i started some stuff changes so i get rebase errors.

Code: Select all

USER@Picasso:~/FCdev/FreeCAD$ git rebase upstream2/femdev
First, rewinding head to replay your work on top of it...
Applying: Add buckling functionality no gui for ccx solver
Using index info to reconstruct a base tree...
M   src/Mod/Fem/FemInputWriterCcx.py
M   src/Mod/Fem/FemToolsCcx.py
A   src/Mod/Fem/_FemSolverCalculix.py
.git/rebase-apply/patch:63: trailing whitespace.
   
.git/rebase-apply/patch:115: trailing whitespace.
       
warning: 2 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging src/Mod/Fem/PyObjects/_FemSolverCalculix.py
Auto-merging src/Mod/Fem/FemToolsCcx.py
Auto-merging src/Mod/Fem/FemInputWriterCcx.py
CONFLICT (content): Merge conflict in src/Mod/Fem/FemInputWriterCcx.py
error: Failed to merge in the changes.
Patch failed at 0001 Add buckling functionality no gui for ccx solver
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".


when i use git rebase --continue i can fix afterwards but this repeat every rebase... and this annoys me!
What is a proper/ better working method to avoid this??
wmayer
Site Admin
Posts: 11342
Joined: Thu Feb 19, 2009 10:32 am

Re: Errors handling during git rebase

Postby wmayer » Tue Feb 28, 2017 7:53 pm

The merge conflict was caused by this change: https://github.com/FreeCAD/FreeCAD/pull ... cc0f0L1079

when i use git rebase --continue i can fix afterwards but this repeat every rebase... and this annoys me!

You first have to fix the conflict and then do git commit -m "message text" src/Mod/Fem/FemInputWriterCcx.py Afterwards you can do git rebase --continue

Edit: Added url
Jee-Bee
Posts: 627
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Errors handling during git rebase

Postby Jee-Bee » Wed Mar 01, 2017 6:33 am

I did try what you said... but get this result

Code: Select all

Applying: Add buckling functionality no gui for ccx solver
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

So i think i abort this and start over again... :(
wmayer
Site Admin
Posts: 11342
Joined: Thu Feb 19, 2009 10:32 am

Re: Errors handling during git rebase

Postby wmayer » Wed Mar 01, 2017 7:49 am

Yes, I resolved the issue already and pushed everything to master.
Jee-Bee
Posts: 627
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Errors handling during git rebase

Postby Jee-Bee » Wed Mar 15, 2017 3:13 pm

I priorities than fix the rebase... I did finished all errors today...
But now i walk into the next problem and i ask that either because i had that before.

I had to fix my commits including all fixes i had to do because i broke thinks before... but now i get some messages in terminal about my rebase what diverse
Rebased with bernds femdev i got this

Code: Select all

jee-bee@Picasso:~/FCdev/FreeCAD$ git rebase upstream2/femdev
Current branch buckletest is up to date.

So that is right i think if i want to push it to my branch it doesn't work

Code: Select all

jee-bee@Picasso:~/FCdev/FreeCAD$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': Jee-Bee
Password for 'https://Jee-Bee@github.com':
To https://github.com/Jee-Bee/FreeCAD
 ! [rejected]        buckletest -> buckletest (non-fast-forward)
error: failed to push some refs to 'https://github.com/Jee-Bee/FreeCAD'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

As i check the status i got

Code: Select all

jee-bee@Picasso:~/FCdev/FreeCAD$ git status
On branch buckletest
Your branch and 'origin/buckletest' have diverged,
and have 249 and 10 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean

How can i have a negative difference against my own branch what can i do to fix...
i don't want the same result as last time
https://github.com/FreeCAD/FreeCAD/compare/master...Jee-Bee:buckle
Jee-Bee
Posts: 627
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Errors handling during git rebase

Postby Jee-Bee » Thu Mar 16, 2017 9:58 am

I had made a copy before rebasing (and running into trouble) is it better to delete the current buckletest create a new one and redo the rebasing( and hopefully this time without errors)?