From 919e6584360d1c4c6b48dcfef972d31805905991 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 2 Apr 2025 06:13:28 -0400 Subject: [PATCH] fix(magit): magit-uniquify-buffer-names = nil This prevents naming collisions between projects that resolve to the same name (e.g. foo/bar/src and baz/foo/src both resolve to the same project name: "src"), causing Magit to destructively reuse magit bufffers across projects (which is especially disruptive if you use workspaces and are using magit in both, in unrelated projects that happen to have the same name). --- modules/tools/magit/config.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 4e9d7e5da..8430124db 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -36,7 +36,17 @@ Only has an effect in GUI Emacs.") magit-save-repository-buffers nil ;; Don't display parent/related refs in commit buffers; they are rarely ;; helpful and only add to runtime costs. - magit-revision-insert-related-refs nil) + magit-revision-insert-related-refs nil + ;; If two projects have the same project name (e.g. A/src and B/src will + ;; both resolve to the name "src"), Magit will treat them as the same + ;; project and destructively hijack each other's magit buffers. This is + ;; especially problematic if you use workspaces and have magit open in + ;; each, and the two projects happen to have the same name! By unsetting + ;; `magit-uniquify-buffer-names', magit uses the project's full path as + ;; its name, preventing such naming collisions. + magit-uniquify-buffer-names nil) + + ;; Turn ref links into clickable buttons. (add-hook 'magit-process-mode-hook #'goto-address-mode) ;; Since the project likely now contains new files, best we undo the