Commit graph

43458 commits

Author SHA1 Message Date
Joey Hess
a861d56428
httpalso: Support being used with special remotes that use chunking.
Sponsored-by: k0ld on Patreon
2023-06-20 13:35:28 -04:00
Joey Hess
958c2fa6d2
Improve resuming interrupted download when using yt-dlp or youtube-dl
Fixes a failure like this:

curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.

That happens because the whole web page has already been downloaded
previously, and kept, so now addurl tries to download it, and curl asks the
server to resume from the last byte. And youtube.com can't, for whatever
stupid reason.

So, delete the temp file after determining that youtube-dl can be used.
2023-06-19 15:01:47 -04:00
Joey Hess
a36a81dea3
Improve resuming interrupted download when using yt-dlp
Sometimes resuming an interrupted download will fail to resume and download
more files with different names. That resulted in the workdir having
multiple files at the end, which causes git-annex to give up because it
does not know what was downloaded.

To fix this, use a yt-dlp feature, which appends to a file the name of each
file after it's finished downloading it. So the presence of other cruft in
the workdir will not confuse git-annex.
2023-06-19 14:39:08 -04:00
Joey Hess
90d410b382
comment 2023-06-19 13:49:12 -04:00
Joey Hess
217a6abb19
assistant: Fix a crash when a small file is deleted immediately after being created
git add will fail if the file got deleted in the meantime. And since it was
queued, there was a window until the queue flushed where a deletion of the
file would cause a crash.

Instead, reuse Command.Add.addFile, which sha1 hashes the file itself
immediately, and then queues the index update. Ignore exceptions that will
happen if the file got deleted already.

Sponsored-by: k0ld on Patreon
2023-06-19 12:44:56 -04:00
Joey Hess
553962eb47
link comment to todo 2023-06-19 11:42:45 -04:00
Joey Hess
1f09b709fc
skip sending individual files to export remotes
That will fail, and it already exports whole trees.
f6dd34ca81 made it sync content with
import remotes, and if an import remote is also an export remote, that
caused this new failure mode.

Sponsored-by: Brock Spratlen on Patreon
2023-06-19 11:24:32 -04:00
Lukey
4a42e7d11e removed 2023-06-16 20:04:05 +00:00
Lukey
aaa4ba0261 removed 2023-06-16 19:59:28 +00:00
Lukey
3b4254153b removed 2023-06-16 19:59:09 +00:00
Joey Hess
12fa697ca5
Merge branch 'master' of ssh://git-annex.branchable.com 2023-06-15 10:08:16 -04:00
Joey Hess
114a2d7504
Fix display when run with -J1
Commit b6642dde8a broke it by enabling
non-concurrent display mode while leaving concurrency set in the config
and having already started concurrency earlier.

(I don't actually know if that commit was a good idea.)

Sponsored-By: Brett Eisenberg on Patreon
2023-06-15 10:07:54 -04:00
Joey Hess
772d7fa82d
bug 2023-06-15 09:39:56 -04:00
stephenriley
4fdc2113d5 Added a comment 2023-06-15 02:57:35 +00:00
stephenriley
393441a561 Added a comment 2023-06-15 02:57:26 +00:00
aurtzy
bb982a6c19 Added a comment 2023-06-15 01:56:43 +00:00
Joey Hess
839fce9549
comment 2023-06-14 19:53:55 -04:00
Joey Hess
40b6155b7d
idea 2023-06-14 19:40:42 -04:00
jacksondm33@cf6e91518a0fa6a05945d5d4e03ae770f6383615
276c964a9f 2023-06-14 22:06:10 +00:00
strmd
80106ad534 Added a comment 2023-06-14 10:42:41 +00:00
nobodyinperson
dd0ae66282 Added a comment 2023-06-13 06:42:49 +00:00
tomdhunt
645f5dce2d Added a comment: Differing reliability among remotes 2023-06-12 22:58:42 +00:00
nobodyinperson
73d400fe83 Added a comment 2023-06-12 21:12:29 +00:00
Joey Hess
6f0783d7a0
close bug report and improve docs that led to it being filed 2023-06-12 16:30:21 -04:00
Joey Hess
64738ea157
config: Added the --show-origin and --for-file options
* config: Added the --show-origin and --for-file options.
* config: Support annex.numcopies and annex.mincopies.

There is a little bit of redundancy here with other code elsewhere that
combines the various configs and selects which to use. But really only
for the special case of annex.numcopies, which is a git config that does
not override the annex branch setting and for annex.mincopies, which does
not have a git config but does have gitattributes settings as well as the
annex branch setting.

That seems small enough, and unlikely enough to grow into a mess that it was
worth supporting annex.numcopies and annex.mincopies in git-annex config
--show-origin. Because these settings are a prime thing that someone might
get confused about and want to know where they were configured.

And, it followed that git-annex config might as well support those two
for --set and --get as well. While this is redundant with the speclialized
commands, it's only a little code and it makes it more consistent.

Note that --set does not have as nice output as numcopies/mincopies
commands in some special cases like setting to 0 or a negative number.
It does avoid setting to a bad value thanks to the smart
constructors (eg configuredNumCopies).

As for other git-annex branch configurations that are not set by git-annex
config, things like trust and wanted that are specific to a repository
don't map to a git config name, so don't really fit into git-annex config.
And they are only configured in the git-annex branch with no local override
(at least so far), so --show-origin would not be useful for them.

Sponsored-by: Dartmouth College's DANDI project
2023-06-12 16:24:31 -04:00
Joey Hess
ae98fb1b31
move unspecifiedAttr check to checkAttr
It just so happens that everywhere that checks attrs other than
annex.largefiles parses the value further, and failed to parse
unspecifiedAttr in a way that behaved the same as if nothing was set. So
this is not a bug fix or behavior change. What it does so is prevent
future uses of checkAttr from needing to remember to handle checking for
this edge case.

Sponsored-by: Dartmouth College's DANDI project
2023-06-12 14:37:42 -04:00
Joey Hess
38153ad340
assistant: Add dotfiles to git by default, unless annex.dotfiles is configured
Tthe same as git-annex add does.

Sponsored-by: Luke Shumaker on Patreon
2023-06-12 13:25:04 -04:00
Joey Hess
357291c13c
comment 2023-06-12 13:06:04 -04:00
Joey Hess
6b5af6a7f3
close weirdly time warped bug report 2023-06-12 12:51:50 -04:00
nobodyinperson
757ab21682 2023-06-12 13:56:48 +00:00
jgoerzen
56d6b622d7 Added a comment 2023-06-11 02:18:23 +00:00
jacksondm33@cf6e91518a0fa6a05945d5d4e03ae770f6383615
37a9982d86 2023-06-10 16:03:12 +00:00
nobodyinperson
68d5976225 Added a comment 2023-06-10 06:06:59 +00:00
Joey Hess
3911e1061c
Merge branch 'master' of ssh://git-annex.branchable.com 2023-06-09 16:14:25 -04:00
Joey Hess
c33c226abd
fixed 2023-06-09 16:13:52 -04:00
Joey Hess
a0ab425c95
add ContentIndentifiersCidRemoteKeyIndex
Optimise database to further speed up importing large trees from special
remotes.

See comment for details of why the other index didn't help cid queries.

It would probably be better to manually create an index on only cid, rather
than adding a second uniqueness constraint that is a larger index. But
persitent does not support creating indexes, and an attempt to manually add
it to the migration failed.

Sponsored-by: Nicholas Golder-Manning on Patreon
2023-06-09 15:12:33 -04:00
yarikoptic
97646765e2 initial todo/question for easing 2023-06-09 18:47:23 +00:00
Jack
dbeedc1fed rename forum/set_only_keep_current_version_in_repo.mdwn to forum/only_keep_current_version_of_files_in_repo.mdwn 2023-06-08 22:45:06 +00:00
Jack
b231083a37 2023-06-08 22:44:37 +00:00
Jack
e6b9d2a430 2023-06-08 22:42:59 +00:00
Joey Hess
532b227086
update exportdb tree in getImportableContents
This avoids bottlenecking on git check-ignore in a particular situation.
Also, there may have been a correctness issue with it not having updated it.
When the exportdb is already up-to-date, this is not expensive. And the
exportdb is updated elsewhere, so usually it is up-to-date.

Sponsored-by: Joshua Antonishen on Patreon
2023-06-08 18:36:24 -04:00
Joey Hess
5934e7d402
Merge branch 'master' of ssh://git-annex.branchable.com 2023-06-08 16:54:05 -04:00
Joey Hess
6821ba8dab
sync: use log to track adjusted branch needs updating
Speeds up sync in an adjusted branch by avoiding re-adjusting the branch
unncessarily, particularly when it is adjusted with --hide-missing or
--unlock-present.

When there are a lot of files, that was the majority of the time of a
--no-content sync.

Uses a log file, which is updated when content presence changes. This
adds a little bit of overhead to every file get/drop when on such an
adjusted branch. The overhead is minimal for get of any size of file,
but might be noticable for drop in some cases. It seems like a reasonable
trade-off. It would be possible to update the log file only at the end, but
then it would not happen if the command is interrupted.

When not in an adjusted branch, there should be no additional overhead.
(getCurrentBranch is an MVar read, and it avoids the MVar read of
getGitConfig.)

Note that this does not deal with situations such as:
git checkout master, git-annex get, git checkout adjusted branch,
git-annex sync. The sync won't know that the adjusted branch needs to be
updated. Dealing with that would add overhead to operation in non-adjusted
branches, which I don't like. Also, there are other situations like having
two adjusted branches that both need to be updated like this, and switching
between them and sync not updating.

This does mean a behavior change to sync, since it did previously deal
with those situations. But, the documentation did not say that it did.
The man pages only talk about sync updating the adjusted branch after
it transfers content.

I did consider making sync keep track of content it transferred (and
dropped) and only update the adjusted branch then, not to catch up to other
changes made previously. That would perform better. But it seemed rather
hard to implement, and also it would have problems with races with a
concurrent get/drop, which this implementation avoids.

And it seemed pretty likely someone had gotten used to get/drop followed by
sync updating the branch. It seems much less likely someone is switching
branches, doing get/drop, and then switching back and expecting sync to update
the branch.

Re-running git-annex adjust still does a full re-adjusting of the branch,
for anyone who needs that.

Sponsored-by: Leon Schuermann on Patreon
2023-06-08 14:35:41 -04:00
Joey Hess
637f19bebb
fix adjusted branch update breakage
Introduced recently in commit 64fc34b3da.

adjustBranch changes the sha that is recorded for the current branch
(eg the adjusted branch). So, have to get the original sha before
calling it.

Sponsored-by: Jack Hill on Patreon
2023-06-08 13:33:58 -04:00
yarikoptic
96a6946a14 stalling report 2023-06-08 15:46:29 +00:00
Joey Hess
7888702955
update 2023-06-07 11:32:53 -04:00
Joey Hess
3e3d225ca0
Merge branch 'master' of ssh://git-annex.branchable.com 2023-06-07 11:16:39 -04:00
Joey Hess
64fc34b3da
narrow window where HEAD is detached
Updating an adjusted branch can take a while when there are a lot of
files. HEAD was detached at the start, so if eg git-annex sync was
interrupted at the wrong point, there was a possibly wide window where
it would leave the repo with HEAD detached.

There's still a window, just much narrower. I don't know if it's
possible to close the window entirely. While git can clearly update
the currently checked out branch in eg git merge, it doesn't seem to
provide another way to do it.

Sponsored-by: Graham Spencer on Patreon
2023-06-07 11:10:54 -04:00
nobodyinperson
2fe032c4ee Added a comment 2023-06-07 04:49:04 +00:00
Joey Hess
5bc37c2de2
comment 2023-06-06 15:17:09 -04:00