vegard,
@vegard@mastodon.social avatar

PSA: everybody should set their conflictstyle to diff3 or zdiff3:

git config --global merge.conflictStyle diff3

I have no idea why this isn't already the default. Without this, you have no idea what the actual conflict is.

Meaning of the conflict markers:

<<<<<<<
this is what is in your current tree before cherry-picking
|||||||
this is what the patch expected to find there

this is what the patch wants it to be after being applied
>>>>>>>

diff3 basically adds the middle part.

geert,
@geert@society.oftrolls.com avatar

@vegard I gave it a try, but it made today's conflicts when merging drm-misc into Linus' tree even more incomprehensible...

See also Stephen's resolutions for linux-next (which are a big help, as usual, thanks!)
https://lore.kernel.org/all/20231114112503.6e098829@canb.auug.org.au/

kernellogger,
@kernellogger@fosstodon.org avatar

@geert @vegard

side note: there is an unimportant detail I never understood, maybe somebody here can help to satisfy my curiosity:

How does Stephen carry these resolutions over to future trees?

I (wrongly?) assume he's recreating -next from scratch, so I (wrongly?) suspect the same conflict will happen on the next day again and needs to be handled manually again. Or is there some way to handle this automatically?

shenki,
kernellogger,
@kernellogger@fosstodon.org avatar

@shenki @geert @vegard

ahh, many thx, wasn't aware of that git command!

/me notices that the man page starts with "The git rerere functionality is a bit of a hidden feature. […]" and feels a little less stupid for asking here

mgedmin,
@mgedmin@floss.social avatar

@vegard diff3 is the best. Also, I've never heard of zdiff3 before, what's the difference?

vegard,
@vegard@mastodon.social avatar

@mgedmin it's "zealous", meaning it trims off lines that are identical in the conflict region. From <https://git-scm.com/docs/git-config#Documentation/git-config.txt-mergeconflictStyle>:

> Another alternate style, "zdiff3", is similar to diff3 but removes matching lines on the two sides from the conflict region when those matching lines appear near either the beginning or end of a conflict region.

I guess it produces smaller conflicts at the expense of "hiding" that these lines were changed identically in both branches. That's my understanding anyway.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tacticalgear
  • DreamBathrooms
  • cisconetworking
  • khanakhh
  • mdbf
  • magazineikmin
  • modclub
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • ngwrru68w68
  • JUstTest
  • everett
  • tester
  • cubers
  • normalnudes
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines