All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH b4] Create temporary directory in current working directory
@ 2025-06-13 19:04 Dave Marquardt
  2025-06-18 13:54 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Marquardt @ 2025-06-13 19:04 UTC (permalink / raw)
  To: Kernel.org Tools; +Cc: Konstantin Ryabitsev, Dave Marquardt



---
In edit_with_editor, create temporary directory in current working
directory. This avoids issues with Emacs and Magit, which insists
COMMIT_EDITMSG must be in the repo's directory tree.

Signed-off-by: Dave Marquardt <davemarq@linux.ibm.com>
---
 src/b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index 0a7daec..79d695a 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -4423,7 +4423,7 @@ def edit_in_editor(bdata: bytes, filehint: str = 'COMMIT_EDITMSG') -> bytes:
     editor = corecfg.get('editor')
     logger.debug('editor=%s', editor)
     # Use filehint name in hopes that editors autoload necessary highlight rules
-    with tempfile.TemporaryDirectory(prefix='b4-editor') as temp_dir:
+    with tempfile.TemporaryDirectory(prefix='b4-editor', dir=Path.cwd()) as temp_dir:
         temp_fpath = os.path.join(temp_dir, filehint)
         with open(temp_fpath, 'xb') as edit_file:
             edit_file.write(bdata)

---
base-commit: 220ba25f86b6f295eab8b4e9e67b624e460f0126
change-id: 20250613-fix-magit-edit-491efacc71a9

Best regards,
--  
Dave Marquardt <davemarq@linux.ibm.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 19:04 [PATCH b4] Create temporary directory in current working directory Dave Marquardt
2025-06-18 13:54 ` Konstantin Ryabitsev
2025-06-18 15:02   ` Dave Marquardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.