0

I have a file that is a constant conflict.

It contains just two lines

versionCode Int
versionName String in the form of "a.b.c"

I want to write an automatic something that will resolve this conflict if it ever exists and always takes the higher version code as the resolver.

Is there a way to do that?

Lena Bru
  • 13,521
  • 11
  • 61
  • 126
  • 2
    I don't know if this is possible, but it might be worth asking yourself _why_ the file is in constant conflict. Changing the version number on several branches at the same time is somewhat unusual; usually it's only changed on a release branch and not merged back into other branches. – Thomas Mar 29 '21 at 07:51
  • 1
    `always takes the higher version code as the resolver` ... can you clearly define what this means? What about the case of a tie? – Tim Biegeleisen Mar 29 '21 at 07:51
  • Is this an android project by any chance? In any case I would generate the variables automatically at build time from git tags and semantic versioning. – fredrik Mar 29 '21 at 09:00
  • Also see this: https://stackoverflow.com/questions/16231059/apply-git-merge-stategy-only-on-one-file – David Meu Mar 29 '21 at 10:34
  • @TimBiegeleisen if there is a tie, there is no conflict – Lena Bru Mar 29 '21 at 10:41

0 Answers0