Recommend zdiff3 merge.conflictStyle#1260
Conversation
|
The option zdiff3 is rather new, added in 2.35 from last year. So this change would break systems with older git versions. |
|
True - Git 2.35 was released 2022-01-24. But I'm not sure a >1 year old version is such a concern... Users on such old versions also have many unpatched CVEs, since Git doesn't backport security fixes too far 🤷♂️ |
|
@dandavison Would you consider to merge this change? Thanks 😄 |
|
100% happy to add the recommendation to the manual; no hesitation there (does anyone want to come up with good "before and after" examples/screenshots showing the advantage?). As for the front-page recommended config, we don't have an explicit policy yet on compatibility with Git versions. I think this could be viewed as a statistical question: where does the Git version that this requires fall in the distribution of Git versions used by delta users? Which leads to the question: what version of Git do the most common operating systems ship with or in the cases where people get git from package managers what do they get? (I don't think CVEs in Git are relevant; people use whatever version of Git they have.) |
|
Maybe we can link to this GitHub blog post, which explains zdiff3 pretty well?
Some examples: |
|
Thanks @simono, I read the blog post example, but I admit I was waiting until I could personally started noticing the improvements in my own workflows. This may be old news to everyone else but for the record, here's an example. It's simpler than the one in the GitHub blog -- in a way there is no conflict, just two adjacent changes. So this one's a big improvement because under zdiff3 in my Git UI (magit/vscode/lazygit etc) I can just stage it without resolving anything, whereas diff3 would require me to choose a resolution. with diff3:
with zdiff3:
Detailsdiff --cc service/frontend/workflow_handler.go
index a3df8fc7e,8484f2a3e..000000000
--- a/service/frontend/workflow_handler.go
+++ b/service/frontend/workflow_handler.go
@@@ -2157,34 -2149,34 +2165,42 @@@ func (wh *WorkflowHandler) ResetWorkflo
}
// TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event
// in the history and immediately terminating the execution instance.
func (wh *WorkflowHandler) TerminateWorkflowExecution(ctx context.Context, request *workflowservice.TerminateWorkflowExecutionRequest) (_ *workflowservice.TerminateWorkflowExecutionResponse, retError error) {
defer log.CapturePanic(wh.logger, &retError)
if request == nil {
return nil, errRequestNotSet
}
if err := validateExecution(request.WorkflowExecution); err != nil {
return nil, err
}
++<<<<<<< HEAD
+ if err := wh.validateLinks(namespace.Name(request.GetNamespace()), request.GetLinks()); err != nil {
+ return nil, err
+ }
+
++||||||| parent of 9f57b1a51 (Instrument some more endpoints)
++=======
+ trace.SpanFromContext(ctx).SetAttributes(
+ telemetry.WorkflowIDKey(request.WorkflowExecution.WorkflowId),
+ )
+
++>>>>>>> 9f57b1a51 (Instrument some more endpoints)
namespaceID, err := wh.namespaceRegistry.GetNamespaceID(namespace.Name(request.GetNamespace()))
if err != nil {
return nil, err
}
_, err = wh.historyClient.TerminateWorkflowExecution(ctx, &historyservice.TerminateWorkflowExecutionRequest{
NamespaceId: namespaceID.String(),
TerminateRequest: request,
})
if err != nil {
return nil, err
}
return &workflowservice.TerminateWorkflowExecutionResponse{}, nil
} |
|
zdiff3 was a game changer for me |
aabfcfe to
f7d0cf7
Compare
|
@th1000s do you think enough time has passed to put this in the example config that people will blindly copy and paste, or should we just add it as a recommendation for now? |
|
Okay, on an incompatible setting it causes the next git pull/rebase command to fail, even if there was no conflict: |
|
OK, thanks all! Merging this after a 2-year docs PR review process :) |
|
Yay, thanks! |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [dandavison/delta](https://github.com/dandavison/delta) | minor | `0.18.2` → `0.19.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>dandavison/delta (dandavison/delta)</summary> ### [`v0.19.1`](https://github.com/dandavison/delta/releases/tag/0.19.1) [Compare Source](dandavison/delta@0.19.0...0.19.1) This patch release fixes a release automation [bug](dandavison/delta#2127): release [0.19.0](https://github.com/dandavison/delta/releases/tag/0.19.0) did not include all release binaries. #### What's Changed - Fix CD: replace defunct ubuntu-20.04 runners by [@​dandavison](https://github.com/dandavison) in [#​2129](dandavison/delta#2129) **Full Changelog**: <dandavison/delta@0.19.0...0.19.1> ### [`v0.19.0`](https://github.com/dandavison/delta/releases/tag/0.19.0) [Compare Source](dandavison/delta@0.18.2...0.19.0) Tons of improvements; thanks very much to all delta contributors. **This release is missing several binaries due to a [bug in the GitHub Actions release workflow](dandavison/delta#2127). Please use <https://github.com/dandavison/delta/releases/tag/0.19.1> instead.** #### What's Changed - Do not double panic in FakeParentArgs::drop by [@​dvermd](https://github.com/dvermd) in [#​1856](dandavison/delta#1856) - Improve blame file type detection ([#​1803](dandavison/delta#1803)) by [@​dvermd](https://github.com/dvermd) in [#​1829](dandavison/delta#1829) - Use same example config in manual as README by [@​dandavison](https://github.com/dandavison) in [#​1879](dandavison/delta#1879) - Clarify grep highlighter-related code by [@​dandavison](https://github.com/dandavison) in [#​1877](dandavison/delta#1877) - Don't set colorMoved in introductory instructions by [@​dandavison](https://github.com/dandavison) in [#​1884](dandavison/delta#1884) - Recommend zdiff3 merge.conflictStyle by [@​adamchainz](https://github.com/adamchainz) in [#​1260](dandavison/delta#1260) - Add themes `weeping-willow`, `mirthful-willow` by [@​lvdh](https://github.com/lvdh) in [#​1864](dandavison/delta#1864) - CI: switch to macos-13, as 12 will be unsupported soon by [@​th1000s](https://github.com/th1000s) in [#​1890](dandavison/delta#1890) - Add optional capture-output writer to run\_app() by [@​th1000s](https://github.com/th1000s) in [#​1889](dandavison/delta#1889) - Center-align README content by [@​dandavison](https://github.com/dandavison) in [#​1893](dandavison/delta#1893) - Redundant Option Checks, Unwrap Safety by [@​sharma-shray](https://github.com/sharma-shray) in [#​1892](dandavison/delta#1892) - Add console commands for git configuration by [@​harmtemolder](https://github.com/harmtemolder) in [#​1896](dandavison/delta#1896) - Honor pager path when checking less version by [@​dandavison](https://github.com/dandavison) in [#​1903](dandavison/delta#1903) - Rename some variables by [@​dandavison](https://github.com/dandavison) in [#​1904](dandavison/delta#1904) - Delete now-unused pricate homebrew formula step from Makefile (III) by [@​dvermd](https://github.com/dvermd) in [#​1830](dandavison/delta#1830) - Support {host} in hyperlinks by [@​dandavison](https://github.com/dandavison) in [#​1901](dandavison/delta#1901) - Allow multiple hyperlinks per line by [@​th1000s](https://github.com/th1000s) in [#​1909](dandavison/delta#1909) - Clippy 1.83 by [@​th1000s](https://github.com/th1000s) in [#​1918](dandavison/delta#1918) - Support external subcommands: rg, diff, git-show (etc.) by [@​th1000s](https://github.com/th1000s) in [#​1769](dandavison/delta#1769) - Don't keep subcommand stdout around by [@​th1000s](https://github.com/th1000s) in [#​1920](dandavison/delta#1920) - hyperlink commit hashes of length 7 as well by [@​th1000s](https://github.com/th1000s) in [#​1924](dandavison/delta#1924) - clippy 1.84 fix by [@​th1000s](https://github.com/th1000s) in [#​1938](dandavison/delta#1938) - chore(deps): update git2 to use libgit2 1.9 by [@​chenrui333](https://github.com/chenrui333) in [#​1930](dandavison/delta#1930) - Suggest minimum bat version in manual by [@​ernstki](https://github.com/ernstki) in [#​1941](dandavison/delta#1941) - Upgrade unicode-width to v0.1.14 (but still < 0.2.0) by [@​th1000s](https://github.com/th1000s) in [#​1937](dandavison/delta#1937) - Update terminal-colorsaurus version to 0.4.8 by [@​rashil2000](https://github.com/rashil2000) in [#​1936](dandavison/delta#1936) - Fix index out of bounds crash for '@​@​ @​@​' hunk header by [@​adamchainz](https://github.com/adamchainz) in [#​1995](dandavison/delta#1995) - Tune themes weeping-willow, mirthful-willow by [@​lvdh](https://github.com/lvdh) in [#​2011](dandavison/delta#2011) - clippy 1.88 fixes by [@​injust](https://github.com/injust) in [#​2016](dandavison/delta#2016) - Fix diff output when a diff ends with a mode change by [@​th1000s](https://github.com/th1000s) in [#​2023](dandavison/delta#2023) - fix: `cargo install git-delta --locked` fails on systems with GCC 15 by [@​tquin](https://github.com/tquin) in [#​2007](dandavison/delta#2007) - Normalize `merge.conflictStyle` casing by [@​injust](https://github.com/injust) in [#​2015](dandavison/delta#2015) - Styled zero lines fix by [@​th1000s](https://github.com/th1000s) in [#​1916](dandavison/delta#1916) - config: add setup instructions for Jujutsu (jj) vcs by [@​arjunmahishi](https://github.com/arjunmahishi) in [#​2048](dandavison/delta#2048) - all: fix clippy complaints by [@​charlievieth](https://github.com/charlievieth) in [#​2038](dandavison/delta#2038) - Cache the Git remote URL to speed up rendering hyperlinks by [@​charlievieth](https://github.com/charlievieth) in [#​1940](dandavison/delta#1940) - deps: update cc by [@​ognevny](https://github.com/ognevny) in [#​2053](dandavison/delta#2053) - rg json handling: fix line comment highlighting by [@​th1000s](https://github.com/th1000s) in [#​2057](dandavison/delta#2057) - Update dirs dependency to version 6 by [@​musicinmybrain](https://github.com/musicinmybrain) in [#​2063](dandavison/delta#2063) - default line number to 1 for hyperlinks by [@​schpet](https://github.com/schpet) in [#​2061](dandavison/delta#2061) - Fix line numbers showing filename when hyperlinks enabled by [@​tsvikas](https://github.com/tsvikas) in [#​2058](dandavison/delta#2058) - less hist file: look at xdg paths by [@​th1000s](https://github.com/th1000s) in [#​2065](dandavison/delta#2065) - CI: remove x86 apple/macOS by [@​th1000s](https://github.com/th1000s) in [#​2074](dandavison/delta#2074) - Update bat dependency from 0.24 to 0.26 by [@​dandavison](https://github.com/dandavison) in [#​2115](dandavison/delta#2115) #### New Contributors - [@​dvermd](https://github.com/dvermd) made their first contribution in [#​1856](dandavison/delta#1856) - [@​lvdh](https://github.com/lvdh) made their first contribution in [#​1864](dandavison/delta#1864) - [@​sharma-shray](https://github.com/sharma-shray) made their first contribution in [#​1892](dandavison/delta#1892) - [@​harmtemolder](https://github.com/harmtemolder) made their first contribution in [#​1896](dandavison/delta#1896) - [@​ernstki](https://github.com/ernstki) made their first contribution in [#​1941](dandavison/delta#1941) - [@​tquin](https://github.com/tquin) made their first contribution in [#​2007](dandavison/delta#2007) - [@​arjunmahishi](https://github.com/arjunmahishi) made their first contribution in [#​2048](dandavison/delta#2048) - [@​charlievieth](https://github.com/charlievieth) made their first contribution in [#​2038](dandavison/delta#2038) - [@​ognevny](https://github.com/ognevny) made their first contribution in [#​2053](dandavison/delta#2053) - [@​musicinmybrain](https://github.com/musicinmybrain) made their first contribution in [#​2063](dandavison/delta#2063) - [@​schpet](https://github.com/schpet) made their first contribution in [#​2061](dandavison/delta#2061) - [@​tsvikas](https://github.com/tsvikas) made their first contribution in [#​2058](dandavison/delta#2058) **Full Changelog**: <dandavison/delta@0.18.2...0.19.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44OS42IiwidXBkYXRlZEluVmVyIjoiNDMuODkuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->


Compared to diff3, zdiff3 minimizes the conflicted region, so fewer lines will show as conflicted. This normally makes merge conflicts easier to resolve. Docs: https://git-scm.com/docs/git-config#Documentation/git-config.txt-mergeconflictStyle .
I also made
conflictStylefollow Git’s casing, as other options are documented like that as well.