Error after rebase because of missing MAV_GENERATOR_STATUS_... definition

Thank you @peterbarker, I will try that as soon as I understand what I’m doing. Sorry, I’m not so familiar with GitHub and repos and in the past I have learned that It’s better not to hurry here.
So could you give me a little deeper explanation of your last recommended doing, please.

Thank you @peterbarker, I will try that as soon as I understand what I¢m doing. Sorry, I¢m not so familiar with GitHub and repos and in the past I have
learned that It¢s better not to hurry here.

So one trick is to make it really, really easy to take backups. I use two
scripts, one to make a backup of a branch and one to take a backup of my
entire ArduPilot repo. The former takes milliseconds to run, the latter a
minute or so.

pbarker@bluebottle:~/rc$ ls -l which date-branch which date-tarball
-rwxrwxr-x 1 pbarker pbarker 142 Apr 17 2018
/home/pbarker/bin/date-branch
-rwxrwxr-x 1 pbarker pbarker 291 Mar 22 2017
/home/pbarker/bin/date-tarball
pbarker@bluebottle:~/rc$ ls ardupilot*tar
ardupilot-201901180845.tar ardupilot-202012081408.tar
ardupilot-202010011011.tar
pbarker@bluebottle:~/rc$ cd ardupilot
pbarker@bluebottle:~/rc/ardupilot((HEAD detached at
rmackay9/lthall-scurve4))$ git branch | grep backup/ | head -2
backup/AP_MAX_LOG_FILES-20200910135046
backup/DEBUG/f35-spi-20200409102304
pbarker@bluebottle:~/rc/ardupilot((HEAD detached at
rmackay9/lthall-scurve4))$

So could you give me a little deeper explanation of your last recommended doing, please.

So make a backup first :slight_smile:

Make sure you’re clean with

git status

Then checkout ardupilot’s master branch:

git fetch origin
git checkout remotes/origin/master

update the submodules:

git submodule update --init --recursive

rebase your mavlink commit:

cd modules/mavlink
git fetch origin
git checkout pr/my-branch-which-contains-custom-mavlink
git rebase remotes/origin/master

push your mavlink changes up to your github repo:

git push -f github pr/my-branch-which-contains-custom-mavlink

reference the commit in your ardupilot repo:

git checkout pr/my-branch-which-used-custom-mavlink
git add modules/mavlink
git commit -m “mavlink: reference my awesome new mavlink changes”

push your new branch up to github:

git push -f github pr/my-branch-which-used-custom-mavlink

Some commit messages may need tweaking. I’ve just done this off the top
of my head… let’s see how well I did…

1 Like

Today I worked through that, but with no success - same error as before.

Maybe we missunderstood - I never changed anything in MavLink.
So I replaced
“git checkout pr/my-branch-which-contains-custom-mavlink” by “git checkout MisRelSep”
“git push -f github pr/my-branch-which-contains-custom-mavlink” by “git push -f origin MisRelSep” and also
“git push -f github pr/my-branch-which-used-custom-mavlink” by “git push -f origin MisRelSep”.

It would help if you would have a look at https://github.com/ArduPilot/ardupilot/pull/14663 - was my doing on 17.Oct correct or is that the rootcause of my problems?

That’s my normal way to rebase:
starting Git Bash

cd Documents/GitHub/ardupilot

git checkout MisRelSep

git fetch upstream

git rebase upstream/master

just if something has to be decided manually:
git log
(edit necessary files)

git add --all
or
git add (e.g.) ArduPlane/config.h
git add (e.g.) libraries/AP_Mission/AP_Mission.h
git add …

git rebase --continue

git commit -m “some senseful text”

git submodule update --init --recursive

git log --oneline --decorate --all --graph (for checking)

git push -f origin MisRelSep

So where in that process is the correct line to merge the MavLink-Submodule rebase?
Or am I completely on the wrong way of thinking?

You need to do the submodule rebase after the git submodule update and before the git push -f

I get an error
Failed to merge submodule modules/mavlink (commits don’t follow merge-base)
after the first few commands and don’t have an idea how to solve that:

@peterbarker: I don’t understand what
pr/my-branch-which-contains-custom-mavlink
and
pr/my-branch-which-used-custom-mavlink
should say.
In the moment I have one branch MisRelSep with one PR based on it (https://github.com/ArduPilot/ardupilot/pull/14663)

So is it necesary to create a help/interim branch? And if yes, where?
Btw I never changed anything in MavLink.

fyi that are my remotes:
$ git remote -v
origin https://github.com/WillyZehnder/ardupilot.git (fetch)
origin https://github.com/WillyZehnder/ardupilot.git (push)
upstream https://github.com/ArduPilot/ardupilot.git (fetch)
upstream https://github.com/ArduPilot/ardupilot.git (push)
Ist that “standard”?

If you never changed anything in mavlink why do you want to compile with custom mavlink messages???

BTW there have been a lot of changes in ArduPilot`s mavlink branch lately. Maybee some of the stuff you wanted is already there.

A conclusion for better understanding:

  • I had a green/OK checked PR.
  • After four months I thought it’s a good idea to rebase, to be prepared when the PR will be reviewed.
  • So I did a rebase
  • After the rebase the PR run into an error (see first post) and naturally also the build run into an error (in libraries/AP_Generator/AP_Generator_RichenPower.cpp the defines MAV_GENERATOR_STATUS_FLAG_… are used, but there is no declaration for them)

In the meantime I found that in common.xml of the new mavlink-submodule (that is the base for common.h) that declarations are done.

Now all I need is the actual mavlink-code in my repo, because thats necessary for the new master-code.

I thougt, that a “git submodule update --init --recursive” will do that, but it seems that’s not the case.

In former times a copy and paste of that code had been the sufficient solution, but in a version-control system that should not be a good idea.

In the meantime I tried different things and looked at the PR - and I’m very sure that my mavlink-problem is not a problem, but the result of a horrible mistake I did at rebase on Oct 17


Don’t know how that happened, but it seems to be horrible.

So could an experienced developer give me a briefing or a hint how to proceed, please?

I safed all my files and I could do a complete restart - but in a version-control system there should be a smarter solution.

Is it possible to rollback to the former state and restart here e.g.?

I already tried

$ git checkout -b MisRel_Test  d34d5c2

and that MisRel_Test branch is buildable without error.

Tomorrow, if I have time, I will clone your branch and rebase it on master.

I would appreciate that very much - thank you Amilcar - and no need to hurry.
It would also be great if you could describe how you have done that. So I’am able to understand and learn.

cd modules/mavlink
git checkout master
git pull internet master
cd ../..
git submodule update --recursive
git fetch internet master
git remote add WillyZehnder https://github.com/WillyZehnder/ardupilot.git
git fetch WillyZehnder MisRelSep
git checkout MisRelSep
git rebase internet/master
git gui  -> remove modules/gbenchmark and modules/mavlink commits
./Tools/gittools/git-subsystems-split
git checkout -b MisRelDec

For more info:
https://ardupilot.org/dev/docs/git-rebase.html
https://ardupilot.org/dev/docs/git-branch.html
and
https://ardupilot.org/dev/docs/git-interactive-rebase.html

I have done a PR to your repo now, the trick is to not commit any changes to the gbenckmark or mavlink repos. I re-formated your commits to match Ardupilot guidelines

1 Like

Many thanks Amilcar!
As you know I’m an experienced developer but dont have experience with git, I’m very uncertain what I have to do next - I don’t want to nearly kill my repo again.


My favorite is to create just a merge commit, but I don’t understand the other options - so i will be careful.

first do this on you local machine

git checkout master
git pull upstream master
git push origin

That will sync all the master branches.

Now, because you do not want to merge MisRelDec it to master, you want to create a local branch. As a simple rule don’t mess with master, master should always track the upstream master, that makes things easier. So:

git remote add amilcar https://github.com/amilcarlucas/ardupilot.git
git fetch amilcar MisRelDec
git checkout MisRelDec
git rebase master
git push origin

If that is working fine and you want to update your PR to ardupilot, then you first need to locally delete your MisRelSep branch using gitk --all
And after that rename the MisRelDec branch to MisRelSep
and finally to update the pull request git push -f origin

And after that gitk --all on your local machine should be very clear. with everything in the right place.

I tried to ignore the warning “This branch cannot be rebased due to conflicts” (see screencopy above), but unfortunatelly that isn’t possible.

Btw what do you mean with “git push Willy”? I guess my remote fork “origin https://github.com/WillyZehnder/ardupilot.git” so I use “git push origin”?

Updated again, was missing a step. Keep me posted, I`m curious if it all works :slight_smile:

In the moment I’ve escalation management - I’ll try tomorrow :upside_down_face:

So today I tried the repair and for me all is looking fine.
Git Bash log - repair by Amilcar.pdf (107.4 KB)

But at build (I only tested SITL/plane) I still run into an error:

And as plausibility check I started the same build on master - with the same result:

The define of OSD_PARAM_NONE you can find on mavlink-master in ardupilotmega.xml - but sorrowly not in my repo.
Maybe you have forgotten the “git submodule update --recursive” before “git push origin”?
Edit: I tried that in a MisRelDec_PlayCopy of MisRelDec, but with no success.

In the meantime I noticed that the cleaned commits you made are probably not on my local yet?
(I didn’t completely understand that, but because we did a fetch/push instead a merge that could be ok?):


Many thanks again for your support and energy you give in here, Amilcar - I hope you will get it.

Edit 02.01.2021:

After a second rebase of origin/master and “git submodule update --init --recursive” the submodules seem to be updated (Submodule path ‘modules/mavlink’: checked out ‘d8cad47bb3e4ecf21ae631e492e9643cd063cb8c’) and the build of master is running without error.

Then I tried to checkout MisRelDec_PlayCopy and rebase also, but I don’t understand and how to solve the CONFLICT (submodule):
2021-01-02 17_45_32-Window

And I have an additional question, for that I could not find an answer in git tutorials:
What will that “M…”-line tell me? I guess “be careful, the submodules are not fitting”
2021-01-02 17_36_10-Window

fyi here is the error I’m getting when I try to build MisRelDec_PlayCopy:

@amilcarlucas solved that problem here: How to solve a CONFLICT (submodule) during rebase?