Tuesday, March 14, 2023

Resolving Git conflicts

When looking at git conflict markers it can sometimes be confusing which half of the conflicting section belongs to which branch:

<<<<<<< HEAD
foo
=======
bar
>>>>>>> cb1abc6bd98cfc84317f81a95a7662815417802d
  • the top half is the branch you a merging into
  • the bottom half is from the commit that you are trying to merge in

What this means in practice if you are doing something like git pull (which is equivalent to a git fetch followed by a git merge) is:

  • the top half shows your local changes
  • the bottom half shows the remote changes, which you are trying to merge in

On the other hand, if you are doing something like git rebase origin/master, you are effectively trying to merge your local changes "into" the upstream changes (by replaying them on top); that means:

  • the top half shows the upstream changes
  • the bottom half shows your local changes, which you are trying to merge in
Resources:

Monday, July 25, 2022

How to remove a wrong commit from the pull request

 $ git checkout pull_request_branch

 $ git rebase -i HEAD~n //n is the number of commits you would like to see during rebase or you could specify the number of commits you have made to the pull request.

3. Replace pick with drop for commits that you want to discard from the PR

Once you are done with the rebase, push forcefully to the remote branch

$git push origin pull_request_branch -f

You are good!


Monday, July 4, 2022

How to show a progress monitor on eclipse rcp splash screen

Create plugin_customization.ini in your product branding plugin with the following property

# show progress on startup

org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true



Add plugin_customization.ini in plugin.xml property extension


<plugin>

   <extension

         id="myid"

         name="my-IDE"

         point="org.eclipse.core.runtime.products">

      <product

            application="org.eclipse.ui.ide.workbench"

            description="About product description"

            name="%product.name">

         <property

               name="appName"

               value="my-IDE">

         </property>

         

    <property

               name="preferenceCustomization"

               value="plugin_customization.ini">

        </property>

      </product>

   </extension>

</plugin>


To control the coordinates of the progress monitor and message on the splash screen add the following three properties

      <property

           name="startupForegroundColor"

           value="000000">

     </property>

     <property

           name="startupMessageRect"

           value="7,305,285,20">

     </property>

     <property

           name="startupProgressRect"

           value="7,290,490,15">

     </property>


In Eclipse 3.x RCP applications, this could be done directly from the .product splash screen page





Thursday, February 11, 2021

Installing features in eclipse from command line

We can install eclipse features from the command line also. Here is an example, where I am going to install esp-idf eclipse plugin into my eclipse cdt

Go to the command line
Go to the eclipse directory and run the below command

Installing a single feature
$ eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ -installIU com.espressif.idf.feature.feature.group

This installs com.espressif.idf.feature.feature.group feature from  https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ repository

$ eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/swtchart/releases/0.13.0 -installIU org.eclipse.swtchart.feature.feature.group

To install multiple features at the same time.
$eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ -installIU ,com.cthing.cmakeed.feature.feature.group,ilg.gnumcueclipse.debug.gdbjtag.openocd.feature.feature.group



Resources:

Monday, October 19, 2020

Icon editor for resizing and creating new icons

 http://www.xiconeditor.com/

This is a simple icon editor which I'm using these days for resizing and creating new icons for the eclipse plugin

Wednesday, August 19, 2020

Understanding OSGI Bundle states

Eclipse runs on top of the OSGi runtime, which manages the bundles (components) that make up an application. At any time, each bundle has one of these lifecycle states:

Bundle States:

  • Not in the list - If your bundle isn't in the list, then OSGi doesn't know anything about it. See the next section for debugging this problem.
  • INSTALLED - This means that OSGi knows about your bundle but there is something wrong and it couldn't resolve. Problems may include thing from missing dependencies to requiring a higher Java VM version than you are running with. To get more information on why your bundle is not resolved try running the diag <bundle id> command, where <bundle id> is your bundle id or bundle symbolic name.
  • RESOLVED - If your bundle is resolved but you expected it to be started, then try starting your bundle from the command-line with the start 123 command. If it won't start, then you should get some feedback as to what the problem is.
  • <<lazy>> - This means your bundle is resolved and is marked to be lazy started. Everything should be ok.
  • ACTIVE - your bundle is resolved and has been started, everything should be working as planned.


(source: OSGi Service Platform – Core Specification)


For example: I want to check the bundle states for my company plugins so I will use the below command.

osgi> ss com.espressif

"Framework is launched."

id State       Bundle

6 RESOLVED    com.espressif.idf.branding_1.2.0.qualifier

7 ACTIVE      com.espressif.idf.core_1.0.0.qualifier

8 STARTING    com.espressif.idf.help_1.0.0.qualifier

9 ACTIVE      com.espressif.idf.launch.serial.core_1.0.0.qualifier

10 ACTIVE      com.espressif.idf.launch.serial.ui_1.0.0.qualifier

11 STARTING    com.espressif.idf.sdk.config.core_1.0.1.qualifier

12 STARTING    com.espressif.idf.sdk.config.ui_1.0.0.qualifier

13 STARTING    com.espressif.idf.terminal.connector_1.0.0.qualifier

14 STARTING    com.espressif.idf.terminal.connector.serial_1.0.0.qualifier

15 ACTIVE      com.espressif.idf.ui_1.0.0.qualifier

721 ACTIVE      com.espressif.idf.debug.gdbjtag.openocd_1.0.0.qualifier


References:

https://wiki.eclipse.org/Where_Is_My_Bundle

Monday, June 29, 2020

GNU MCU Eclipse Plugins

Source code:
https://github.com/eclipse-embed-cdt/eclipse-plugins


It took some time to find this plugin source code since there are multiple GitHub repositories under GNU MCU Eclipse Plugin

Check more on this here https://gnu-mcu-eclipse.github.io/

GNU MCU Eclipse plug-ins getting rebranded as The Eclipse Embedded CDT plug-ins for Arm & RISC-V C/C++ developers