• AVR Freaks

Hot!MCC merge tool on "main.c"

Author
oliverb
Super Member
  • Total Posts : 219
  • Reward points : 0
  • Joined: 2009/02/16 13:12:38
  • Location: 0
  • Status: offline
2019/06/12 06:54:15 (permalink)
0

MCC merge tool on "main.c"

Hi
I'm probably better off doing this manually but I was trying to figure out how to select the left or right hand versions in the merge. So far I've had two attempts where the window closed after changing nothing, and one where it closed and completely replaced main. The merge window seemed to close wherever I clicked?
 
How can I pick from the two files? If anything I think I want a "Keep both" merge and then clean up afterwards?
 
#1

4 Replies Related Threads

    PA91
    Junior Member
    • Total Posts : 70
    • Reward points : 0
    • Joined: 2012/09/03 21:45:40
    • Location: 0
    • Status: offline
    Re: MCC merge tool on "main.c" 2019/11/05 23:20:21 (permalink)
    0
    Hi,
     
    Please go through the below link. It provides you with the details of how MCC Merge works.
    https://microchipdeveloper.com/mcc:merge
    #2
    Mysil
    Super Member
    • Total Posts : 3403
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: MCC merge tool on "main.c" 2019/11/06 00:53:11 (permalink)
    0
    Hi,
    This thread started about half a year ago, so maybe the original poster have figured out how the merge tool works in the meantime.
     
    In my experience, the merge tool is good, but there are some quirks that are not obvious, especially when there are several files with differences. 
    There is no way to confirm acceptance of changes applied to each file individually.
    The fact that closing the merge window [merge X], will save the content of righthand window for all files as edited so far, is good, but not obvious, and have been subject of questions in this forum before.
     
    Not mentioned in the Microchipdeveloper description,
    It is possible to edit manually in the righthand panel of the merge tool,
    these edits will be saved, the same way as any block of updates selected for inclusion or removal.
     
    Even with a good merge tool, having a lot of changes made to generated files, may be a source of confusion, and is a risk of making mistakes.
    When there are a lot of changes made, I prefer to copy the file in questio into a different name and/or directory, and in MPLAB X Projects panel, select "Exclude file(s) from current configuration" / "Include file(s) in current configuration".
    This work well for .c source files, like main.c    and  mymain.c
    Any merge of updates must then be done manually, or by use of a diff tool.
     
    Header files may be more confusing.
    If there are header files with the same name in different directories, then the compiler do not know about MPLAB selections. C compiler preprocessor use it's own procedure and the search list when processing #include directives.
    So if header files with the same name and different content exist, there is risk that different parts of a program will be compiled with different declarations. This will cause hard to understand warnings and error messages, or even harder to find errors when running the program.
     
        Mysil
     
     
     
    post edited by Mysil - 2019/11/06 01:04:35
    #3
    oliverb
    Super Member
    • Total Posts : 219
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: MCC merge tool on "main.c" 2019/11/11 03:35:45 (permalink)
    0
    Thanks for the input. The specific scenario I was having trouble with was the case of running MCC on a pre-existing project, in which case the attempt to merge the MCC main into "main" resulted in a total disaster with huge chunks of existing source being matched to and replaced by MCC code. Fortunately the first time I tried the project had no "main.c" as it was called "fpamain.c" so all I had to do was exclude main.c from compliation and paste in the MCC changes manually.
     
    Also I was surprised because I'd previously seen MPLAB deal with GIT merges very well.
     
    post edited by oliverb - 2019/11/11 03:36:59
    #4
    Mysil
    Super Member
    • Total Posts : 3403
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: MCC merge tool on "main.c" 2019/11/13 06:55:48 (permalink)
    0
    Hi,
    It is my impression that in some earlier version of MCC,
    that if a file with name main.c exist already it was not touched by MCC at all.
    Only if no main.c file was present, a outline file for main.c would be created.
     
    The present behaviour seem more risky to me.
     
        Mysil
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5