Board index FlightGear Development

Git says I need to merge when I don't

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Git says I need to merge when I don't

Postby macnab » Wed Jan 01, 2014 2:42 am

If I do a git pull Git tries to do an automerge with Nasal/canvas/map//navdisplay.mfd, and then says I have merge conflict. I haven't touched this file.

Tried git merge --abort, but the problem comes back as soon as I try another pull.
macnab
 
Posts: 886
Joined: Tue Aug 02, 2011 7:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1

Re: Git says I need to merge when I don't

Postby hvengel » Wed Jan 01, 2014 8:10 pm

You need to finish the merge. If you have a merge conflict then you need to resolve the conflict before the merge can complete. If you have not changed the file then something happened to it so that git thinks it has been changed. For example it might be corrupted. Aborting the merge does nothing to resolve the conflict. Check to see if git thinks there are changes to this file locally and revert the changes before pulling. This will remove the conflict.
hvengel
Retired
 
Posts: 1128
Joined: Sun Dec 24, 2006 4:35 am
Location: Minden Nevada

Re: Git says I need to merge when I don't

Postby macnab » Thu Jan 02, 2014 2:44 am

This is what I get from git diff:
Code: Select all
diff --cc Nasal/canvas/map/navdisplay.mfd
index f560e94,f65dc9b..0000000
--- a/Nasal/canvas/map/navdisplay.mfd
+++ b/Nasal/canvas/map/navdisplay.mfd
@@@ -87,36 -94,21 +94,59 @@@ var NDStyles =
        }, # end of layer update predicate
     }, # end of airports layer
 
++<<<<<<< HEAD
 +   { name:'vor', disabled: 1, update_on:['toggle_range','toggle_stations','toggle_display_mode'], predicate: func(nd, layer) {
 +      # print("Running vor layer predicate");
 +      if(nd.rangeNm() <= 40 and
 +      nd.get_switch('toggle_stations') and
 +      nd.get_switch('toggle_display_mode') == "MAP"){
++||||||| merged common ancestors
++   { name:'vor', update_on:['toggle_range','toggle_stations','toggle_display_mode'], predicate: func(nd, layer) {
++      # print("Running vor layer predicate");
++      if(nd.rangeNm() <= 40 and
++      nd.get_switch('toggle_stations') and
++      nd.get_switch('toggle_display_mode') == "MAP"){
++=======
+    { name:'vor', update_on:['toggle_range','toggle_stations','toggle_display_mode'], predicate: func(nd, layer) {
+       var visible = nd.get_switch('toggle_stations') and nd.in_mode('toggle_display_mode', ['MAP']);
+       if(nd.rangeNm() <= 40 and visible) {
++>>>>>>> bd5b88765ed1f7ade8bf48afd228703b244730eb
           trigger_update( layer ); # clear & redraw
        }
-       layer._view.setVisible( nd.get_switch('toggle_stations') );
+       layer._view.setVisible( visible );
       }, # end of layer update predicate
     }, # end of VOR layer

It has the same for dme layer.
The crux seems to be
Code: Select all
-       layer._view.setVisible( nd.get_switch('toggle_stations') );
+       layer._view.setVisible( visible );

Edited both occurrences in navdisplay.mfd (changed + version to - version) and tried abort merge and pull. No change. git diff shows exactly the same.
Check the file again and my edits have reverted. So I seem to need to do something between the edit ad the pull.
macnab
 
Posts: 886
Joined: Tue Aug 02, 2011 7:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1

Re: Git says I need to merge when I don't

Postby Hooray » Thu Jan 02, 2014 2:49 am

those are changes from some other branch, are you sure that you are on the right branch ? next/master should never be touched at all, they should always be based on the origin (gitorious).

git fetch origin master
git diff origin/master

If you are trying to merge the wizard branch with next, that's not going to work just like that, too many changes ... but we can later on merge the wizard branch back into a copy of master.

again, never modify next or master.

PS: Happy New Year! :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Git says I need to merge when I don't

Postby macnab » Fri Jan 03, 2014 2:37 am

Second attempt to reply to this post. Last reply disappeared.
Happy New Year to you too.

I now only have master. The wizard branch was removed. But somehow navdisplay.mfd is changed.
Git doesn't recognise the use of origin.

Until I resolve this, I can no longer do a pull. I really don't want to start from scratch, it takes too long with too much chance of an interrupt, with no pause/resume.

Just one file messing up the works!!
macnab
 
Posts: 886
Joined: Tue Aug 02, 2011 7:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1

Re: Git says I need to merge when I don't

Postby psadro_gm » Fri Jan 03, 2014 4:03 am

I'm no git expert, but if you really don't think you have any mods to a file, you could just checkout the single file at head. Try this

http://www.norbauer.com/rails-consultin ... -file.html
8.50 airport parser, textured roads and streams...
psadro_gm
 
Posts: 751
Joined: Thu Aug 25, 2011 2:23 am
Location: Atlanta, GA USA
IRC name: psadro_*
Version: git
OS: Fedora 21

Re: Git says I need to merge when I don't

Postby macnab » Fri Jan 03, 2014 4:27 am

Did that.
Ran git diff.
Doesn't show the file as different.
In fact that file then looks the same as the copy at gitorius.
git pull then complains about the merge conflict.

EDIT: Would it help to do a commit with comment "Ignore/Delete - fixing conflicting files"?
macnab
 
Posts: 886
Joined: Tue Aug 02, 2011 7:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1

Re: Git says I need to merge when I don't

Postby Hooray » Fri Jan 03, 2014 5:03 am

switch to your master branch, use "git stash" to save anything that you may have modified and then use "git reset --hard" to origin/master (or your equivalent of origin, i.e. use "git remove -v" to come up with the name of the git repo). That will give you a clean master, next you can git fetch or pull
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Git says I need to merge when I don't

Postby macnab » Fri Jan 03, 2014 5:14 am

Used git remote -v.
It shows hooray git@gitorious.org/hoorays-fgdata.git (push and pull.)
So I did something wrong when I removed that topic!!
So even though git says I am in master, it is the wrong master.
Doesn't look good!!!

EDIT: Did this
Code: Select all
$ git remote rm hooray
$ git remote add origin git@gitorious.org/fg/fgdata.git
$ git config master.remote origin
$ git config master.merge refs/heads/master

Then git remote -v shows
origin git@gitorious.org/fg/fgdata,git (for fetch and push)

Still doesn't help. Same merge conflict.
macnab
 
Posts: 886
Joined: Tue Aug 02, 2011 7:20 am
Location: Johannesburg, South Africa
Callsign: ZS-ILH
Version: Git
OS: Win7Pro 64bit SP1


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest