Commit graph

47049 commits

Author SHA1 Message Date
Joey Hess
d68fd15e4c
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-16 10:36:19 -04:00
Joey Hess
06a813ad44
set locale encoding after fdTohandle
fdToHandle does not set the usual system locale encoding,
so when the Handle is used for any String IO, it needs to be done
manually for correctness.

I don't know if this fixes any bugs. It might eg, fix a bug with
multicast receive of a file.

Sponsored-by: Leon Schuermann
2025-09-15 21:35:38 -04:00
yarikoptic
3b70bd683a Added a comment 2025-09-16 00:40:22 +00:00
Joey Hess
1e847fd1af
boot libs 2025-09-15 19:59:07 -04:00
Joey Hess
3e9807bc03
work around file-io not setting locale encoding when opening a Handle
Works around this bug https://github.com/haskell/file-io/issues/45

The fix is in Utility.FileIO.CloseOnExec because all use of file-io is
already wrapped through that module. Although perhaps that ought to be
refactored at this point.

I'd hope that file-io will eventually fix this bug, and also provide
CloseOnExec variants of its functions. That would allow depending on the
fixed version, and removing this ugly code.

Note that, functions like readFile that don't care about the encoding
due to reading/writing a ByteString were kept optimally fast by not
setting the encoding. This avoids an IORef read and write per open.

Sponsored-by: Graham Spencer
2025-09-15 19:25:03 -04:00
Joey Hess
0e7d469f89
bug 2025-09-15 18:50:42 -04:00
Joey Hess
c87b1738fb
require_OsPath branch 2025-09-15 16:37:53 -04:00
Joey Hess
e85ca915fb
comment 2025-09-15 16:13:25 -04:00
Joey Hess
6ef3cc834c
update 2025-09-15 14:27:45 -04:00
Joey Hess
7222941aa5
comment 2025-09-15 14:25:08 -04:00
Joey Hess
829223a6e7
small optimisation 2025-09-15 13:49:14 -04:00
Joey Hess
11e7211d7b
drop problem end characters from filename operating on String not RawFilePath
Fix bug that could cause an invalid utf-8 sequence to be used in a
temporary filename when the input filename was valid utf-8.

Sponsored-by: k0ld
2025-09-15 13:42:50 -04:00
Joey Hess
30469503e5
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-15 13:15:41 -04:00
Joey Hess
b10b4c916c
fix mispaste of comment 2025-09-15 13:14:56 -04:00
yarikoptic
707d4e5fac Added a comment 2025-09-15 17:11:51 +00:00
Joey Hess
a9bf5cfcf3
comment 2025-09-15 12:15:51 -04:00
Joey Hess
d46c445e24
reopen 2025-09-15 12:07:29 -04:00
Joey Hess
7069ce6f2a
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-15 12:04:06 -04:00
Joey Hess
91dbcf0b56
fix p2phttp worker thread leak with deleted repository LOCKCONTENT
p2phttp: Fix a hang that could occur when used with --directory, and a
repository in the repository got removed.

It could leak up to -J number of worker threads, but this only affected a
client trying to access the deleted repository.

It may be that this could also affect a non-deleted repository, and also
leak a worker thread, if invalid p2p protocol is sent.
2025-09-15 12:03:44 -04:00
yarikoptic
3209cf25e0 Added a comment 2025-09-11 15:46:53 +00:00
yarikoptic
379b380507 Added a comment 2025-09-11 12:30:50 +00:00
git-annex.branchable.com-2746523870@d0bf050902d9409ff6e93b060e84e482d7e91e7f
84926d1659 2025-09-11 12:25:06 +00:00
git-annex.branchable.com-2746523870@d0bf050902d9409ff6e93b060e84e482d7e91e7f
dd43d49d1e 2025-09-11 12:23:36 +00:00
psxvoid
7ae458f582 Added a comment: git annex bundle - questions 2025-09-11 08:02:08 +00:00
psxvoid
f33a3ea0fc Added a comment: resolved 2025-09-11 05:12:30 +00:00
Joey Hess
38786a4e5e
noCreateProcessWhile to fix close-on-exec races
Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-10 14:29:15 -04:00
Joey Hess
adf1dbb5ca
always import Utility.Process rather than System.Process
This is groundwork for Utility.Process doing some extra locking, for
which it's important that it's always used for process creation.
2025-09-10 13:53:50 -04:00
Joey Hess
3c1975ce7e
windows build fixes 2025-09-10 13:34:17 -04:00
Joey Hess
0fc822f707
Removed support for building with cryptonite, use crypton.
cryptonite is not maintained and has security problems.
Debian stable includes crypton by now.
2025-09-10 13:21:06 -04:00
Joey Hess
4fd71c125e
Improve performance when used with a local git remote that has a large working tree
git write-tree was being run once per file git-annex acts on when eg,
getting files, which is slow when the remote repository has a large
tree.

onLocal calls quiesce after each action, and quiesce closes the keys db
since [[!commit ba7ecbc6a9c]]. Which has a relevant comment about
performance. I have not addressed that, the keys db still gets closed and
reopened after each file.

Turns out that, since git write-tree was run by each call to
reconcileStaged, the .git/annex/keysdb.cache value was never the
same as the git index's inode. Because git write-tree updates the index's
mtime even when no changes have been made.

And so, when the database got closed and reopened, reconcileStaged would
see a changed index, and run git write-tree again. Over and over.

I considered writing the index's new inodecache after write-tree to the
keysdb.cache, but that would be vulnerable to a race, if the index was
changed just after write-tree.

The fix was to stop using keysb.cache at all. When the database is closed
and later reopened by the same process, avoid re-doing reconcileStaged.

Now that .git/annex/keysdb.cache is no longer used. It could be removed,
but the time overhead of removing it would be more than the space overhead
of keeping it. Defferred removal to the v11 upgrade.

Sponsored-by: unqueued
2025-09-10 12:08:11 -04:00
Joey Hess
16c54d458a
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-10 10:22:10 -04:00
Joey Hess
34d5cc055e
bug report 2025-09-10 10:16:52 -04:00
yarikoptic
9b28a6b314 initial report on problem with # in the path 2025-09-09 14:36:29 +00:00
yarikoptic
f5d2707b97 Added a comment 2025-09-09 12:47:26 +00:00
jkrebian
6dac49d3bb 2025-09-09 07:02:04 +00:00
babudarabu@232a9694ce5401143f6210561371f887dd15cd61
ab9bbeabd5 Added a comment 2025-09-08 17:13:02 +00:00
waldi5001
b72c32f60d rename forum/notes_and_enhancements_git_annex_on_android.mdwn to forum/notes_and_enhancements_for_git_annex_on_android.mdwn 2025-09-08 10:00:45 +00:00
waldi5001
1d5545c1a5 2025-09-08 09:55:03 +00:00
waldi5001
f82b71e725 Added a comment 2025-09-08 08:47:56 +00:00
Joey Hess
52303a4cc3
comments 2025-09-06 13:38:17 -04:00
Joey Hess
d1e14a6143
changelog for close-on-exec work 2025-09-05 16:19:50 -04:00
Joey Hess
d838836aca
update 2025-09-05 16:18:07 -04:00
Joey Hess
2b1e9eced2
open feed file with close-on-exec bit set
parseFeedFromFile does not set the bit, so open and read the file
ourselves.

Versioned dependency on utf8-string should not cause any issues,
that version is available in all all versions of debian that package it.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-05 16:02:17 -04:00
Joey Hess
56cd59a9f4
clarify 2025-09-05 15:49:33 -04:00
Joey Hess
314ce317bf
update 2025-09-05 15:48:43 -04:00
Joey Hess
66814d921c
convert withFile and withBinaryFile to close-on-exec safe versions
At this point, every call in git-annex to withFile, openBinaryFile,
withBinaryFile, appendFile, and openTempFile, readFile, and writeFile
have been converted.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-05 15:44:43 -04:00
Joey Hess
6f9a9c81f6
convert all readFile, writeFile, and appendFile to close-on-exec safe versions
Even in the Build system. This allows grepping to make sure that there
are none left un-converted:

git grep "writeFile" |grep -v F\\.| grep -v doc/|grep -v writeFileString | grep -v writeFileProtected |grep -v Utility/FileIO
git grep "readFile" |grep -v F\\.| grep -v doc/|grep -v readFileString |grep -v Utility/FileIO
git grep "appendFile" |grep -v F\\.| grep -v doc/|grep -v appendFileString |grep -v Utility/FileIO

Might be nice to automate that to prevent future mistakes...

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-05 15:44:32 -04:00
Joey Hess
867110e9ee
add readFileString, writeFileString, appendFileString
Exported by Common, so they will be available everywhere.
These are the same as readFile, writeFile, appendFile.
But have two benefits:

* They take OsPath, so using them avoids converting back and forth
  unncessarily.
* They use the close-on-exec flag so can't leak FDs to child processes.
  Unlike the standard Haskell versions which unfortunately have that
  wart currently. (I do hope the standard versions get fixed
  eventually.)

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-05 14:54:36 -04:00
Joey Hess
171b427eb8
update 2025-09-05 14:07:40 -04:00
Joey Hess
9a2013a2e7
update 2025-09-05 14:06:15 -04:00