Jump to content
David Schwartz

How do you deal with git conflict annotations added to DFM files

Recommended Posts

I got a strange compiler error while trying to build some newly updated Delphi code from a colleague -- it said there was an error in the use of a 16-bit resource in a file. Hmmm.... very strange.

 

It turned out it was caused by annotations that git added to highlight merge conflicts during a commit.

 

This is a snippet from one that I found in a DFM file.

  inherited pnlHelpDog: TPanel
<<<<<<< HEAD
    Left = 1183
=======
    Left = 1020
>>>>>>> 091477ff512cddd0288e69e330a1024cd0f011b5
    TabOrder = 4

 

I'm wondering how others deal with this?

Share this post


Link to post

Slap your coworker because he obviously did not resolve a conflict and just commited this (this is git 101).

This is how git annotates the code when there is a conflict and usually you then call git mergetool (or similar) or just use the resolve conflict button in whatever git ui client you are using.

 

Remove lines 2, 4 and 6 and decide if you want to keep 3 or 5

Edited by Stefan Glienke

Share this post


Link to post

at what point? Is this something that should be resolved during the commit / push process? 

 

I'm surprised to see these annotations in source code at all.

Share this post


Link to post

We have 3 people on our project and two are trying to use git as if it's TFS. I keep telling them they're not using it correctly, but they refuse to listen.

 

They also only use the command-line interfaces. They won't use a GUI.

 

I know they're heading for a train-crash, and this is the first evidence of it.

Share this post


Link to post
21 minutes ago, David Schwartz said:

this is the first evidence of it

 

I often wonder how many issues in a mature product are actually the misuse of Version Control..

  • Sad 2

Share this post


Link to post

Well if you are working with ignoramuses you have to get the bigger guns out and install some commit hooks to prevent them from committing unresolved conflicts.

Google will help you finding out how that works.

  • Thanks 1
  • Haha 1

Share this post


Link to post
17 hours ago, David Schwartz said:

We have 3 people on our project and two are trying to use git as if it's TFS. I keep telling them they're not using it correctly, but they refuse to listen.

 

They also only use the command-line interfaces. They won't use a GUI.

It's not only git which uses this kind of annotations. svn and probably many other SCMs do too. So how can it be that somebody commits stuff like this?

 

One option for dealing with this kind of stupidity is setting up a continous build server and slapping everybody who commits stuff that does not compile. But this requires somebody with authority to do the initial slapping.

  • Like 1

Share this post


Link to post
Guest
23 minutes ago, dummzeuch said:

But this requires somebody with authority to do the initial slapping.

In case of lack of authority, proceed with slapping until the desired level is achieved. 🙂

Share this post


Link to post

Its easy to build an automated "training device" with this Bluetooth stuff, RadServer for IoT, GIT and a CI-Server.

https://www.amazon.com/PetSafe-Smart-Bluetooth-Training-Collar/dp/B01K73MUTI

(If you google somewhat deeper you will find versions with high voltage electroshock too :classic_wink: ).

 

(I like to get one for myself sometimes, to get a shock whenever I did something wrong).

  • Haha 4

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×