diff --git a/CHANGELOG b/CHANGELOG index 3202d1afe5..b2ac6a0a44 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ git-annex (10.20250321) UNRELEASED; urgency=medium * Fix build without the assistant. * fsck: Avoid complaining about required content of dead repositories. * drop: Avoid redundant object directory thawing. + * httpalso: Windows url fix. -- Joey Hess Fri, 21 Mar 2025 12:27:11 -0400 diff --git a/Remote/HttpAlso.hs b/Remote/HttpAlso.hs index de0d9e4c09..d6ccf15c13 100644 --- a/Remote/HttpAlso.hs +++ b/Remote/HttpAlso.hs @@ -1,6 +1,6 @@ {- HttpAlso remote (readonly). - - - Copyright 2020-2023 Joey Hess + - Copyright 2020-2025 Joey Hess - - Licensed under the GNU AGPL version 3 or higher. -} @@ -24,6 +24,7 @@ import Utility.Metered import Annex.Verify import qualified Annex.Url as Url import Annex.SpecialRemote.Config +import Git.FilePath import Data.Either import qualified Data.Map as M @@ -228,5 +229,10 @@ supportedLayouts baseurl = ] ] where - mkurl k hasher = baseurl P. fromOsPath (hasher k) P. kf k + mkurl k hasher = baseurl + -- On windows, the hasher uses `\` path separators, + -- but for an url, it needs to use '/'. + -- So, use toInternalGitPath. + P. fromOsPath (toInternalGitPath (hasher k)) + P. kf k kf k = fromOsPath (keyFile k) diff --git a/doc/bugs/httpalso_windows_URL_errors.mdwn b/doc/bugs/httpalso_windows_URL_errors.mdwn index 90b84f1ed0..f847500672 100644 --- a/doc/bugs/httpalso_windows_URL_errors.mdwn +++ b/doc/bugs/httpalso_windows_URL_errors.mdwn @@ -37,3 +37,5 @@ The dataset https://github.com/courtois-neuromod/algonauts_2025.competitors can Yes, our whole data management relies on git-annex and datalad! Thanks for that amazing tool! [[!tag projects/datalad]] + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/httpalso_windows_URL_errors/comment_1_f44b285c7d3b04db73747369793d2ca2._comment b/doc/bugs/httpalso_windows_URL_errors/comment_1_f44b285c7d3b04db73747369793d2ca2._comment new file mode 100644 index 0000000000..335daf778d --- /dev/null +++ b/doc/bugs/httpalso_windows_URL_errors/comment_1_f44b285c7d3b04db73747369793d2ca2._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2025-03-26T15:36:35Z" + content=""" +> `xw%5CXV%5C` should be something like `xw/XV` so some conversion of +> the windows backslash to posix might not be working + +That was a good analysis, thanks! + +I see that Remote.HttpAlso.supportedLayouts uses hashDirLower and +hashDirMixed. Which are implemented using OS-native path separators. +So, on Windows, that does come out with the slash the wrong way around. +I don't think that the actual url-encoding of it is problimatic. + +I've put in a workaround. I have not tested on windows, so please re-open +this bug report if you upgrade and find it still somehow doesn't work. +"""]]