File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,29 @@ Install the dependencies with the provided script::
328328
329329 ./scripts/msys2-install-deps
330330
331+ .. _msys2_path_translation :
332+
333+ MSYS2 Path Translation
334+ ++++++++++++++++++++++
335+
336+ When running Borg within an MSYS2 (including Git Bash) environment, the shell
337+ automatically translates POSIX-style paths (like ``/tmp `` or ``/c/Users ``) to
338+ Windows paths (like ``C:\msys64\tmp `` or ``C:\Users ``) before they reach the
339+ Borg process.
340+
341+ This behavior can result in absolute Windows paths being stored in your backups,
342+ which may not be what you intended if you use POSIX paths for portability.
343+
344+ To disable this automatic translation for Borg, you can use environment variables
345+ to exclude everything from conversion. Similarly, MSYS2 also translates
346+ environment variables that look like paths. To disable this generally for Borg,
347+ set both variables::
348+
349+ export MSYS2_ARG_CONV_EXCL="*"
350+ export MSYS2_ENV_CONV_EXCL="*"
351+
352+ For more details, see the `MSYS2 documentation on filesystem paths <https://www.msys2.org/docs/filesystem-paths/ >`__.
353+
331354Windows 10's Linux Subsystem
332355++++++++++++++++++++++++++++
333356
Original file line number Diff line number Diff line change @@ -455,7 +455,14 @@ def parse_args(self, args=None):
455455 return args
456456
457457 def prerun_checks (self , logger , is_serve ):
458-
458+ if not is_serve :
459+ if sys .platform == "win32" and "MSYSTEM" in os .environ :
460+ if "MSYS2_ARG_CONV_EXCL" not in os .environ or "MSYS2_ENV_CONV_EXCL" not in os .environ :
461+ logger .warning (
462+ "MSYS2 path translation is active. This can cause POSIX paths to be mangled into "
463+ "Windows paths in archives. Consider setting MSYS2_ARG_CONV_EXCL='*' and "
464+ "MSYS2_ENV_CONV_EXCL='*'. See https://www.msys2.org/docs/filesystem-paths/ for details."
465+ )
459466 selftest (logger )
460467
461468 def _setup_implied_logging (self , args ):
You can’t perform that action at this time.
0 commit comments