From 9547f2ebd6d02a1647636f04ff5c034eab690674 Mon Sep 17 00:00:00 2001 From: luciusf Date: Thu, 30 Jan 2025 19:17:58 +0000 Subject: [PATCH 1/9] Added a comment --- .../comment_2_1f74b0795eaba331f96f736d58536653._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/bugs/rsyncurl_without___34____58____34___creates_local_folder_as_remote/comment_2_1f74b0795eaba331f96f736d58536653._comment diff --git a/doc/bugs/rsyncurl_without___34____58____34___creates_local_folder_as_remote/comment_2_1f74b0795eaba331f96f736d58536653._comment b/doc/bugs/rsyncurl_without___34____58____34___creates_local_folder_as_remote/comment_2_1f74b0795eaba331f96f736d58536653._comment new file mode 100644 index 0000000000..2f79d18637 --- /dev/null +++ b/doc/bugs/rsyncurl_without___34____58____34___creates_local_folder_as_remote/comment_2_1f74b0795eaba331f96f736d58536653._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="luciusf" + avatar="http://cdn.libravatar.org/avatar/b86fbf4daa865feb784bdc638e2236be" + subject="comment 2" + date="2025-01-30T19:17:58Z" + content=""" +Thank you for your reply. And I see what you mean, although personally it still feels more that a bug than a feature. Trying to be a good internet citizen I exhausted every documentation I could find about it, and it still took me way too long to figure out something that simple. Maybe the manpage could reflect this bit of information in more detail - let's see if I can figure out, how to contribute patches ... +"""]] From 0ef29fde153e4c16d720bfff62ec7e1f35679993 Mon Sep 17 00:00:00 2001 From: jnkl Date: Thu, 30 Jan 2025 19:59:09 +0000 Subject: [PATCH 2/9] Added a comment --- .../comment_2_c443d997a053927e77ce2607695e7311._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/__34__--fast__34___option_for_git_annex_get__63__/comment_2_c443d997a053927e77ce2607695e7311._comment diff --git a/doc/forum/__34__--fast__34___option_for_git_annex_get__63__/comment_2_c443d997a053927e77ce2607695e7311._comment b/doc/forum/__34__--fast__34___option_for_git_annex_get__63__/comment_2_c443d997a053927e77ce2607695e7311._comment new file mode 100644 index 0000000000..76a749dbfe --- /dev/null +++ b/doc/forum/__34__--fast__34___option_for_git_annex_get__63__/comment_2_c443d997a053927e77ce2607695e7311._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="jnkl" + avatar="http://cdn.libravatar.org/avatar/2ab576f3bf2e0d96b1ee935bb7f33dbe" + subject="comment 2" + date="2025-01-30T19:59:09Z" + content=""" +Thank you. The bash-tab-completion in Debian stable suggested it. +"""]] From 4bf2e2c6967f9fdd9581046d85edd68b715c7391 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 16:31:49 -0400 Subject: [PATCH 3/9] try fixing windows test suite Test suite is failing in windows in conflict resolution tests, where the automatic conflict resolution adds in a .variant file. On windows, those files are somehow missing. I don't understand why, and the test failures only happen on appveyor and not in a local windows VM. So, since replaceFile was recently changed to remove a windows specific ifdef, put it back, to see if that is somehow causing these failures. --- Annex/ReplaceFile.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 5cb46b17dd..3af555d39d 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -5,6 +5,8 @@ - Licensed under the GNU AGPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Annex.ReplaceFile ( replaceGitAnnexDirFile, replaceGitDirFile, @@ -57,7 +59,11 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do +#ifndef mingw32_HOST_OS let basetmp = relatedTemplate' (P.takeFileName file) +#else + let basetmp = toRawFilePath "t" +#endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp r <- action tmpfile From 773115fd5f9334855b138323b74ca572695208a0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 16:51:42 -0400 Subject: [PATCH 4/9] fix truncateFilePath edge case on windows If the filepath starts with something that is not valid utf-8, it would have returned "". And if the filepath was all non-valid utf-8, it would also return "". --- Utility/FileSystemEncoding.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Utility/FileSystemEncoding.hs b/Utility/FileSystemEncoding.hs index b4497f30af..cf9355ccd5 100644 --- a/Utility/FileSystemEncoding.hs +++ b/Utility/FileSystemEncoding.hs @@ -157,10 +157,13 @@ truncateFilePath n = toRawFilePath . reverse . go [] n go coll cnt bs | cnt <= 0 = coll | otherwise = case S8.decode bs of - Just (c, x) | c /= S8.replacement_char -> - let x' = fromIntegral x - in if cnt - x' < 0 - then coll - else go (c:coll) (cnt - x') (S8.drop 1 bs) + Just (c, x) + | c /= S8.replacement_char -> + let x' = fromIntegral x + in if cnt - x' < 0 + then coll + else go (c:coll) (cnt - x') (S8.drop 1 bs) + | otherwise -> + go ('_':coll) (cnt - 1) (S8.drop 1 bs) _ -> coll #endif From 0d4abbcb92ff40e90cbc44f3d1a42243bdbae2ba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 17:06:22 -0400 Subject: [PATCH 5/9] try truncateFilePath on windows again after fix in commit 773115fd5f9334855b138323b74ca572695208a0 maybe it will work now and not break test suite? --- Annex/ReplaceFile.hs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 3af555d39d..5cb46b17dd 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -5,8 +5,6 @@ - Licensed under the GNU AGPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Annex.ReplaceFile ( replaceGitAnnexDirFile, replaceGitDirFile, @@ -59,11 +57,7 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do -#ifndef mingw32_HOST_OS let basetmp = relatedTemplate' (P.takeFileName file) -#else - let basetmp = toRawFilePath "t" -#endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp r <- action tmpfile From 8678588e6a0b3daa3136ff26bcfb2da309731429 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 17:43:38 -0400 Subject: [PATCH 6/9] Revert "try truncateFilePath on windows again" This reverts commit 0d4abbcb92ff40e90cbc44f3d1a42243bdbae2ba. Test suite was failing again with that. --- Annex/ReplaceFile.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 5cb46b17dd..3af555d39d 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -5,6 +5,8 @@ - Licensed under the GNU AGPL version 3 or higher. -} +{-# LANGUAGE CPP #-} + module Annex.ReplaceFile ( replaceGitAnnexDirFile, replaceGitDirFile, @@ -57,7 +59,11 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do +#ifndef mingw32_HOST_OS let basetmp = relatedTemplate' (P.takeFileName file) +#else + let basetmp = toRawFilePath "t" +#endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp r <- action tmpfile From 76bfdf6a0348211ecfe934c93f6a1f08bd537660 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 17:45:34 -0400 Subject: [PATCH 7/9] add windows debug --- Annex/ReplaceFile.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 3af555d39d..7c42532acb 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -63,6 +63,7 @@ replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir let basetmp = relatedTemplate' (P.takeFileName file) #else let basetmp = toRawFilePath "t" + liftIO $ hPutStrLn stderr $ show ("replaceFile debug", file, P.takeFileName file, relatedTemplate' (P.takeFileName file)) #endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp From 29e6b98f8c3be8c474643eeb4ca773b4457fc0b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 19:03:36 -0400 Subject: [PATCH 8/9] Revert "add windows debug" This reverts commit 76bfdf6a0348211ecfe934c93f6a1f08bd537660. --- Annex/ReplaceFile.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 7c42532acb..3af555d39d 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -63,7 +63,6 @@ replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir let basetmp = relatedTemplate' (P.takeFileName file) #else let basetmp = toRawFilePath "t" - liftIO $ hPutStrLn stderr $ show ("replaceFile debug", file, P.takeFileName file, relatedTemplate' (P.takeFileName file)) #endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp From 0c0f4a20f4c1fbf43283018eafabb3e11af7e7d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jan 2025 19:06:06 -0400 Subject: [PATCH 9/9] move windows test suite workaround to relatedTemplate --- Annex/ReplaceFile.hs | 6 ------ Utility/Tmp.hs | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Annex/ReplaceFile.hs b/Annex/ReplaceFile.hs index 3af555d39d..5cb46b17dd 100644 --- a/Annex/ReplaceFile.hs +++ b/Annex/ReplaceFile.hs @@ -5,8 +5,6 @@ - Licensed under the GNU AGPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Annex.ReplaceFile ( replaceGitAnnexDirFile, replaceGitDirFile, @@ -59,11 +57,7 @@ replaceFile createdirectory file action = replaceFile' createdirectory file (con replaceFile' :: (RawFilePath -> Annex ()) -> RawFilePath -> (a -> Bool) -> (RawFilePath -> Annex a) -> Annex a replaceFile' createdirectory file checkres action = withOtherTmp $ \othertmpdir -> do -#ifndef mingw32_HOST_OS let basetmp = relatedTemplate' (P.takeFileName file) -#else - let basetmp = toRawFilePath "t" -#endif withTmpDirIn (fromRawFilePath othertmpdir) (toOsPath basetmp) $ \tmpdir -> do let tmpfile = toRawFilePath tmpdir P. basetmp r <- action tmpfile diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs index 8e0ca10755..3f01a01919 100644 --- a/Utility/Tmp.hs +++ b/Utility/Tmp.hs @@ -6,6 +6,7 @@ -} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.Tmp ( @@ -111,6 +112,7 @@ relatedTemplate :: RawFilePath -> Template relatedTemplate = toOsPath . relatedTemplate' relatedTemplate' :: RawFilePath -> RawFilePath +#ifndef mingw32_HOST_OS relatedTemplate' f | len > templateAddedLength = {- Some filesystems like FAT have issues with filenames @@ -122,6 +124,11 @@ relatedTemplate' f where len = B.length f dot = fromIntegral (ord '.') +#else +-- Avoids a test suite failure on windows, reason unknown, but +-- best to keep paths short on windows anyway. +relatedTemplate' _ = "t" +#endif {- When a Template is used to create a temporary file, some random bytes - are appended to it. This is how many such bytes can be added, maximum.