Home > Software design >  Why Compare function of GitLab say the files are different when they are same?
Why Compare function of GitLab say the files are different when they are same?

Time:10-13

Please go to https://gitlab.com/torrentech/hub.torrentech.org/ and take a look at gitlab-ci.yml on main and dev branches - they are the same.

Now go use Repository>Compare utility and it tells that the files are different showing differences between current and previous version which seem to be stuck somewhere "in limbo".

Don't want to say I found the bug but I really can't explain this? Yes I was tweaking gitlab-ci-yml file in the GitLab interface on main, because I wanted to fast-test if it works, and when it worked out I merge the changes to dev, and the Compare function is broken for me from there on. And then I tried ti Revert that last change - Compare function stills says they are different, but they are the same because I manually edited the dev version to be the same as main, after I reverted.

Gotta admit it's a whole lot of mess in my head now, anybody experienced take a look, probably I'm overseeing something crucial.

CodePudding user response:

You see the changes that would be displayed in a merge request, if you wanted to merge dev in main.

This is the diff between the merge base of main and dev on one side, and dev on the other side.

From a cli on your local clone :

  • you can get the hash of git merge-base main dev
  • then inspect git diff <sha> dev

or

  • run git diff main...dev (3 dots, not a typo, documented in the first paragraphs of git help diff)
  • Related