Commit graph

46125 commits

Author SHA1 Message Date
Joey Hess
60d0dc9c76
convert from readFileStrict
More of these still to convert, but need to be careful of newline
translation.
2025-01-22 14:49:31 -04:00
Joey Hess
c5fe457e01
fix reversion
793ddecd4b made installWrapper not do
newline conversion on windows.
2025-01-22 14:42:27 -04:00
Joey Hess
9b79f0f43d
use file-io for readFile/writeFile/appendFile on ByteStrings
These are all straightforward, and easy small performance wins.

Sponsored-by: Nicholas Golder-Manning
2025-01-22 14:30:25 -04:00
Joey Hess
90cd3aad37
RawFilePath conversion for replaceFile
Sponsored-by: Joshua Antonishen
2025-01-22 13:37:26 -04:00
Joey Hess
af3b9cbd36
simplify replaceFile using relatedTemplate
Now that truncateFilePath and relatedTemplate have both been optimised,
may as well use them in replaceFile, rather than the custom hack it
used.

Removed the windows-specific ifdef as well, because on Windows long
filepaths no longer really a problem, since ghc and git-annex use UNC
converted paths.

replaceFile no longer checks fileNameLengthLimit. That took a syscall,
and since we have an existing file, we know filenames of its length are
supported by the filesystem. Assuming that the withOtherTmp directory is
on the same filesystem as the file replaceFile is being called on, which
I believe it is.

Sponsored-by: Leon Schuermann
2025-01-22 13:25:06 -04:00
Joey Hess
f17ec601c4
optimize truncateFilePath
Often the filepath will be all ascii, or mostly so, and this
optimisation makes a file that has an ascii suffix of sufficient length
be roundtrip converted between String and ByteString only once, rather
than once per character.

Sponsored-by: Graham Spencer
2025-01-22 13:09:15 -04:00
Joey Hess
6211e2af4a
optimize relatedTemplate 2025-01-22 11:51:23 -04:00
Joey Hess
99a4ad708e
break out templateAddedLength 2025-01-22 11:43:45 -04:00
Joey Hess
793ddecd4b
use openTempFile from file-io
And follow-on changes.

Note that relatedTemplate was changed to operate on a RawFilePath, and
so when it counts the length, it is now the number of bytes, not the
number of code points. This will just make it truncate shorter strings
in some cases, the truncation is still unicode aware.

When not building with the OsPath flag, toOsPath . fromRawFilePath and
fromRawFilePath . fromOsPath do extra conversions back and forth between
String and ByteString. That overhead could be avoided, but that's the
non-optimised build mode, so didn't bother.

Sponsored-by: unqueued
2025-01-22 11:41:43 -04:00
Joey Hess
1faa3af9cd
add file-io to build-depends when building with OsPath flag
Partly converted code to use functions from it, though more remain
unconverted. Most of withFile and openFile now use it.
2025-01-21 14:26:04 -04:00
Joey Hess
85efc13e3a
avoid build warning with recent ghc
foldl' is in Prelude now. Explicitly import Data.List still
for older systems and add explict Prelude import to avoid warning.
2025-01-21 12:00:16 -04:00
Joey Hess
71f83bfff7
rename OsString to OsPath 2025-01-21 11:57:44 -04:00
Joey Hess
88b88c9d26
clean up stack.yaml with new versions of dependencies 2025-01-20 19:53:15 -04:00
Joey Hess
c7cca43ab0
RawFilePath conversion for Utility.Directory.Stream 2025-01-20 19:25:52 -04:00
Joey Hess
1ceece3108
RawFilePath conversion of System.Directory
By using System.Directory.OsPath, which takes and returns OsString,
which is a ShortByteString. So, things like dirContents currently have the
overhead of copying that to a ByteString, but that should be less than
the overhead of using Strings which often in turn were converted to
RawFilePaths.

Added Utility.OsString and the OsString build flag. That flag is turned
on in the stack.yaml, and will be turned on automatically by cabal when
built with new enough libraries. The stack.yaml change is a bit ugly,
and that could be reverted for now if it causes any problems.

Note that Utility.OsString.toOsString on windows is avoiding only a
check of encoding that is documented as being unlikely to fail. I don't
think it can fail in git-annex; if it could, git-annex didn't contain
such an encoding check before, so at worst that should be a wash.
2025-01-20 19:17:33 -04:00
Joey Hess
e5be81f8d4
stop exporting Utility.SystemDirectory from Utility.Directory 2025-01-20 19:10:25 -04:00
Joey Hess
8d80b07f5a
update 2025-01-20 14:20:35 -04:00
Joey Hess
fbdf640b09
update 2025-01-20 13:58:14 -04:00
Joey Hess
9e4314de76
relax annex-tracking-branch to allow "/"
Allow setting remote.foo.annex-tracking-branch to a branch name that
contains "/", as long as it's not a remote tracking branch.
2025-01-20 11:31:18 -04:00
Joey Hess
b1c9c9d6e7
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-20 11:12:56 -04:00
Joey Hess
104ca5e09e
Support help.autocorrect settings "never" and "immediate" 2025-01-20 11:01:07 -04:00
Joey Hess
b0ef04f0b7
Support help.autocorrect=prompt 2025-01-20 10:56:12 -04:00
nobodyinperson
6602c1116a Report bug that one can't export synced/ branches 2025-01-20 10:25:51 +00:00
Joey Hess
524298d983
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-17 11:11:55 -04:00
hello@da0030bba070302e85904b4d73db61fb4af7bced
ad974c3bd2 Added a comment: Feature idea 2025-01-17 11:14:55 +00:00
hello@da0030bba070302e85904b4d73db61fb4af7bced
159496a0c6 2025-01-17 11:11:51 +00:00
goglu6
171de7c00e 2025-01-17 06:30:22 +00:00
goglu6
5d370fdfec 2025-01-17 06:29:39 +00:00
goglu6
a1641206de 2025-01-17 06:24:07 +00:00
goglu6
8ec6d7cfdd 2025-01-17 06:23:41 +00:00
goglu6
1d58c62da8 2025-01-17 05:13:55 +00:00
goglu6
92ba4c915d 2025-01-17 05:12:14 +00:00
hello@da0030bba070302e85904b4d73db61fb4af7bced
f47ee1f7c0 Added a comment: Still happening, managed to get a reproduction (maybe ?) 2025-01-16 18:17:52 +00:00
Joey Hess
836f58cbc7
comment 2025-01-15 19:13:15 -04:00
Joey Hess
84cd166805
add news item for git-annex 10.20250115 2025-01-15 12:38:35 -04:00
Joey Hess
7a8bc19228
releasing package git-annex version 10.20250115 2025-01-15 12:38:25 -04:00
Joey Hess
6bad6d4a47
arm autobuild moved to sparrow 2025-01-15 12:18:11 -04:00
Joey Hess
a55e1da1aa
preparing release 2025-01-15 11:39:40 -04:00
Joey Hess
8b6e506759
rsync security fix for bundled builds
I have updated all linux builds.
2025-01-15 11:16:46 -04:00
Joey Hess
bd5d7e936d
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-13 14:24:28 -04:00
Joey Hess
42d55bc57c
pre-init config and hook
Added annex.pre-init-command git config and pre-init-annex hook that is run
before git-annex repository initialization.

This can block initialization. Or it can preform pre-initialization
configuration or tweaking.

I left stdio connected while it's running, so it could also be used for
interactive prompting conceivably, although that would want to use /dev/tty
anyway probably in order to not pollute the stdout of a command when
automatic initialization is done.

Sponsored-by: Dartmouth College's OpenNeuro project
2025-01-13 14:22:49 -04:00
lemondata
09a7f6749a Added a comment 2025-01-13 17:43:25 +00:00
Joey Hess
9e95556d69
comment 2025-01-13 13:32:46 -04:00
Joey Hess
1e8c1dc64e
update 2025-01-13 13:26:36 -04:00
Joey Hess
f3e0216fb0
comment 2025-01-13 13:14:54 -04:00
Joey Hess
ce49caec60
document files 2025-01-13 13:14:12 -04:00
Joey Hess
583e7ccb21
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-13 13:11:49 -04:00
Joey Hess
580c11cf19
todo
kind of a bug, but I'm not sure if it can be fixed
2025-01-13 13:04:38 -04:00
Joey Hess
8d4da46273
update 2025-01-12 12:22:02 -04:00
yarikoptic
7ada233ea6 Added a comment 2025-01-10 20:27:49 +00:00