Commit graph

10978 commits

Author SHA1 Message Date
Joey Hess
dee462f536
tag as datalad 2021-11-09 16:06:41 -04:00
Joey Hess
3bdac41090
comment 2021-11-09 16:04:54 -04:00
iimog@2c22a44141070c04b943932b697818a686859677
173d8d0e51 2021-11-09 15:30:42 +00:00
Joey Hess
9d3ce224e3
uninit edge cases
* uninit: Avoid error message when no commits have been made to the
  repository yet.
* uninit: Avoid error message when there is no git-annex branch.

Sponsored-by: Svenne Krap on Patreon
2021-11-08 16:47:00 -04:00
Joey Hess
9cb02ca29e
comment 2021-11-08 16:28:43 -04:00
Lukey
f32cb96a34 Added a comment 2021-11-08 19:38:35 +00:00
xeruf
d632c781c2 Suggest description 2021-11-07 20:50:03 +00:00
xeruf
fdd3321e81 2021-11-07 19:25:09 +00:00
Joey Hess
099e8fe061
close 2021-11-05 12:46:56 -04:00
jkniiv
d5a06d51c3 Added a comment 2021-11-05 10:25:32 +00:00
jkniiv
beabf83ffb restated: plenty of unit tests fail both under Windows and Ubuntu 18.04 2021-11-05 06:02:29 +00:00
jkniiv
2407f35eb8 plenty of unit tests fail on Windows 2021-11-05 03:34:16 +00:00
Joey Hess
ac05422703
comment 2021-11-02 15:24:22 -04:00
Joey Hess
be690a0717
comment 2021-11-02 15:16:15 -04:00
Joey Hess
38ba8cca1b
investigation results
Also, close dup bug.
2021-11-02 15:06:20 -04:00
Joey Hess
438e5b56aa
tighter --json parsing for metadata
metadata --batch --json: Reject input whose "fields" does not consist of
arrays of strings. Such invalid input used to be silently ignored.

Used to be that parseJSON for a JSONActionItem ran parseJSON separately
for the itemAdded, and if that failed, did not propagate the error. That
allowed different items with differently named fields to be parsed.
But it was actually only used to parse "fields" for metadata, so that
flexability is not needed.

The fix is just to parse "fields" as-is. AddJSONActionItemFields is needed
only because of the wonky way Command.MetaData adds onto the started json
object.

Note that this line got a dummy type signature added,
just because the type checker needs it to be some type.
itemFields = Nothing :: Maybe Bool
Since it's Nothing, it doesn't really matter what type it is,
and the value gets turned into json and is then thrown away.

Sponsored-by: Kevin Mueller on Patreon
2021-11-01 14:42:37 -04:00
Joey Hess
80f1354685
metadata --batch: Avoid crashing when a non-annexed file is input
Turns out that CommandStart actions do not have their exceptions caught,
which is why the giveup was causing a crash. Mostly these actions
do not do very much work on their own, but it does seem possible there
are other commands whose CommandStart also throws an exception.

So, my first attempt at a fix was to catch those exceptions. But,
--json-error-messages then causes a difficulty, because in order to output
a json error message, an action needs to have been started; that sets up
the json object that the error message will be included in a field of.

While it would be possible to output an object with just an error field,
this would be json output of a format that the user has no reason to
expect, that happens only in an exceptional circumstance. That is something
I have always wanted to avoid with the json output; while git-annex man
pages don't document what the json looks like, the output has always
been made to be self-describing. Eg, it includes "error-messages":[]
even when there's no errors.

With that ruled out, it doesn't seem a good idea to catch CommandStart
exceptions and display the error to stderr when --json-error-messages
is set. And so I don't know if it makes sense to catch exceptions from that
at all. Maybe I'd have a different opinion if --json-error-messages did not
exist though.

So instead, output a blank line like other batch commands do.
This also leaves open the possibility of implementing support for matching
object with metadata --json, which would also want to output a blank line
when the input didn't match.

Sponsored-by: Dartmouth College's DANDI project
2021-11-01 13:40:43 -04:00
Joey Hess
eb95ed4863
fix addurl concurrency issue
addurl: Support adding the same url to multiple files at the same time when
using -J with --batch --with-files.

Implementation was easier than expected, was able to reuse OnlyActionOn.

While it will download the url's content multiple times, that seems like
the best thing to do; see my comment for why.

Sponsored-by: Dartmouth College's DANDI project
2021-10-27 16:15:41 -04:00
Joey Hess
55bfa414b3
move transfer already in progress message to warning
This makes it be displayed in the error-messages field with
--json-error-messages. And with --quiet, it will let it be displayed,
which makes sense because it's telling the user why what they requested
to do has failed to happen.
2021-10-27 14:46:21 -04:00
Joey Hess
1d0c07a3af
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-27 14:40:41 -04:00
Joey Hess
c1229f959a
comment 2021-10-27 14:40:02 -04:00
jwodder
93cbdf18fe Added a comment 2021-10-27 18:19:23 +00:00
jwodder
2a70a051b0 Added a comment 2021-10-27 18:16:44 +00:00
Joey Hess
82e3eb5af3
comment 2021-10-27 13:55:36 -04:00
Joey Hess
8f3bbaf30f
comment 2021-10-27 12:56:09 -04:00
jwodder
24d6906d3e 2021-10-27 16:08:30 +00:00
jkniiv
77803642bb Added a comment 2021-10-26 23:55:13 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
c4c01719b9 2021-10-26 22:37:52 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
a50bd7b2b9 Added a comment 2021-10-26 20:13:19 +00:00
Joey Hess
b2c48fb86b
Fix using lookupkey inside a subdirectory
Caused by dirContains ".." "foo" being incorrectly False.

Also added a test of dirContains, which includes all the previous bug fixes
I could find and some obvious cases.

Reversion in version 8.20211011

Sponsored-by: Brett Eisenberg on Patreon
2021-10-26 15:00:45 -04:00
Joey Hess
91eb393df4
comment 2021-10-26 14:25:28 -04:00
Joey Hess
5a9e6b1fd4
when private journal file exists, still read from git-annex branch
Fix bug that caused stale git-annex branch information to read when
annex.private or remote.name.annex-private is set.

The private journal file should not prevent reading more current
information from the git-annex branch, but used to.

Note that, overBranchFileContents has to do additional work now, when
there's a private journal file, it reads from the branch redundantly
and more slowly.

Sponsored-by: Jack Hill on Patreon
2021-10-26 13:43:50 -04:00
Lukey
0a04986ac8 Added a comment 2021-10-25 10:25:05 +00:00
Lukey
9f1bf48696 2021-10-25 10:16:35 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
b2c797e35b Added a comment 2021-10-24 21:23:56 +00:00
jwodder
be3cf1115e 2021-10-24 19:21:54 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
201ac941a7 2021-10-21 21:24:24 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
f9e09277c5 2021-10-21 17:17:42 +00:00
git-annex.visiteur@e9d364191d2ffc1b163c8d9e4c57dbadf58aad8e
efaa1fe94a Added a comment 2021-10-21 08:24:55 +00:00
jwodder
471464e4a0 2021-10-21 04:54:26 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
f8faeabb70 Added a comment 2021-10-21 02:09:02 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
ae80b1214c Added a comment 2021-10-21 02:06:50 +00:00
jwodder
c6d1c7d209 2021-10-21 01:35:48 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
67baa63e5b Added a comment 2021-10-20 22:54:39 +00:00
Joey Hess
6bed8ccbd1
comment 2021-10-20 15:25:35 -04:00
git-annex.visiteur@e9d364191d2ffc1b163c8d9e4c57dbadf58aad8e
16b08ffcd9 Added a comment: Same problem with git-annex 8.20210223 2021-10-20 19:09:29 +00:00
Joey Hess
cb9c54ab25
comment 2021-10-20 13:57:44 -04:00
Joey Hess
dfe5a98286
update 2021-10-20 13:48:37 -04:00
Joey Hess
2801528eb2
oops, I misread, still happens for adjusted branches 2021-10-20 13:45:56 -04:00
Joey Hess
3f3a2d290f
linked bugs 2021-10-20 13:39:13 -04:00
Joey Hess
fe734210eb
comment 2021-10-20 13:24:46 -04:00
Joey Hess
95032bfae7
update per other comment 2021-10-20 13:12:16 -04:00
Joey Hess
77c0892e27
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-20 13:07:09 -04:00
Joey Hess
7b48ce60ef
comment 2021-10-20 13:06:51 -04:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
2ae821e458 Added a comment 2021-10-20 14:42:33 +00:00
gitannexuser2021
cf08ac583a Added a comment: Still seeing the issue. 2021-10-19 22:37:45 +00:00
Joey Hess
f4bdecc4ec
improve sqlite MultiWriter handling of read after write
This removes a messy caveat that was easy to forget and caused at least one
bug. The price paid is that, after a write to a MultiWriter db, it has to
close the db connection that it had been using to read, and open a new
connection. So it might be a little bit slower. But, writes are usually
batched together, so there's often only a single write, and so there should
not be much of a slowdown. Notice that SingleWriter already closed the db
connection after a write, so paid the same overhead.

This is the second try at fixing a bug: git-annex get when run as the first
git-annex command in a new repo did not populate all unlocked files.
(Reversion in version 8.20210621)

Sponsored-by: Boyd Stephen Smith Jr. on Patreon
2021-10-19 15:13:29 -04:00
Joey Hess
c49b7c976d
reopen 2021-10-19 13:16:29 -04:00
Joey Hess
0f38ad9a69
close keys db to possibly work around WSL1 issue 2021-10-19 13:07:49 -04:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
6d53f52092 Added a comment 2021-10-17 01:14:18 +00:00
Joey Hess
29d687dce9
When retrival from a chunked remote fails, display the error that occurred when downloading the chunk
Rather than the error that occurred when trying to download the unchunked
content, which is less likely to actually be stored in the remote.

Sponsored-by: Boyd Stephen Smith Jr. on Patreon
2021-10-14 12:45:05 -04:00
Joey Hess
3b5ac2d0d1
close per comment 2021-10-12 13:42:55 -04:00
Joey Hess
b117f9338d
open todo 2021-10-12 13:42:08 -04:00
Joey Hess
c2a44eab50
move gpg tmp home to system temp dir
test: Put gpg temp home directory in system temp directory, not filesystem
being tested.

Since I've found indications gpg can fail talking to the agent when the
socket ends up on eg, fat. And to hopefully fix this bug report I've
followed up on.

The main risk in using the system temp dir is that TMPDIR could be set to a
long directory path, which is too long to put a unix socket in. To
partially amelorate that risk, it uses either an absolute or a relative
path, whichever is shorter. (Hopefully gpg will not convert it to a longer
form of the path..)

If the user sets TMPDIR to something so long a path to it +
"S.gpg-agent" is too long, I suppose that's their issue to deal with.

Sponsored-by: Dartmouth College's Datalad project
2021-10-12 13:29:56 -04:00
Joey Hess
1b79f2404d
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-08 13:27:23 -04:00
Joey Hess
022bb6174c
Merge branch 'borgchunks' 2021-10-08 13:26:45 -04:00
Joey Hess
69f8e6c7c0
ImportableContentsChunkable
This improves the borg special remote memory usage, by
letting it only load one archive's worth of filenames into memory at a
time, and building up a larger tree out of the chunks.

When a borg repository has many archives, git-annex could easily OOM
before. Now, it will use only memory proportional to the number of
annexed keys in an archive.

Minor implementation wart: Each new chunk re-opens the content
identifier database, and also a new vector clock is used for each chunk.
This is a minor innefficiency only; the use of continuations makes
it hard to avoid, although putting the database handle into a Reader
monad would be one way to fix it.

It may later be possible to extend the ImportableContentsChunkable
interface to remotes that are not third-party populated. However, that
would perhaps need an interface that does not use continuations.

The ImportableContentsChunkable interface currently does not allow
populating the top of the tree with anything other than subtrees. It
would be easy to extend it to allow putting files in that tree, but borg
doesn't need that so I left it out for now.

Sponsored-by: Noam Kremen on Patreon
2021-10-08 13:15:22 -04:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
392a886263 Added a comment 2021-10-07 06:21:25 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
50c2bd49e5 Added a comment 2021-10-06 21:10:34 +00:00
Joey Hess
e9b0cf08eb
branch 2021-10-06 17:08:57 -04:00
Joey Hess
153f3600fb
progress in my head 2021-10-06 14:45:12 -04:00
Joey Hess
68b4fc6018
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-05 20:28:26 -04:00
Joey Hess
19e78816f0
convert Key to ShortByteString
This adds the overhead of a copy when serializing and deserializing keys.
I have not benchmarked much, but runtimes seem barely changed at all by that.

When a lot of keys are in memory, it improves memory use.

And, it prevents keys sometimes getting PINNED in memory and failing to GC,
which is a problem ByteString has sometimes. In particular, git-annex sync
from a borg special remote had that problem and this improved its memory
use by a large amount.

Sponsored-by: Shae Erisson on Patreon
2021-10-05 20:20:08 -04:00
Joey Hess
012b71e471
comment and correct incorrect info in previous comment 2021-10-05 19:05:20 -04:00
tomdhunt
a40f70b388 Added a comment 2021-10-05 22:07:45 +00:00
tomdhunt
3718dc0fbe Added a comment 2021-10-05 21:30:03 +00:00
Joey Hess
250c031d06
comment 2021-10-05 17:20:32 -04:00
Joey Hess
1d23d8463a
update 2021-10-05 16:51:54 -04:00
Joey Hess
fac1954b60
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-05 16:33:44 -04:00
Joey Hess
c69a5af531
comment 2021-10-05 16:32:10 -04:00
tomdhunt
f72ac0249a Added a comment 2021-10-05 19:08:23 +00:00
Joey Hess
45dfddd33f
convert ExportLocation to ShortByteString to avoid PINNED memory fragmentation
This adds the overhead of a copy whenever converting to/from ExportLocation and
ImportLocation.

borg: Some improvements to memory use when importing a lot of archives.
(It's still pretty bad.)

Sponsored-by: Mark Reidenbach on Patreon
2021-10-05 14:51:55 -04:00
Joey Hess
8b4f331b09
update 2021-10-05 13:24:31 -04:00
Joey Hess
368ceb93fe
comment 2021-10-05 13:11:20 -04:00
Joey Hess
a8ceb2b64e
promote comment to bug 2021-10-05 11:55:33 -04:00
jkniiv
0d664d0d33 Added a comment 2021-10-02 19:58:17 +00:00
Joey Hess
b9a1cc512d
avoid uncessary call to inAnnex
sync --content: Avoid a redundant checksum of a file that was
incrementally verified, when used on NTFS and perhaps other filesystems.

When sync has just gotten the content, it does not need to check inAnnex a
second time. On NTFS, for some reason the write of the inode cache after
it gets the content is not immediately able to be read, and with an
empty/non-matching inode cache due to that stale data, inAnnex falls back
to hashing the whole object to determine if it's present.

Sponsored-by: Brock Spratlen on Patreon
2021-10-01 12:02:35 -04:00
Joey Hess
17a31f8e1b
analysis 2021-10-01 11:49:12 -04:00
Joey Hess
42c6bc6c3e
Merge branch 'master' of ssh://git-annex.branchable.com 2021-09-30 15:20:59 -04:00
Joey Hess
620685c73c
started analysis 2021-09-30 15:20:44 -04:00
jkniiv
a57c4f4482 Added a comment: Email resent from my personal domain jibun.eu 2021-09-30 18:22:44 +00:00
Joey Hess
8f3f25337a
comment 2021-09-30 12:52:02 -04:00
jkniiv
e01676a25c Added a comment 2021-09-29 04:38:08 +00:00
Joey Hess
07e160e589
comment 2021-09-28 17:58:10 -04:00
Joey Hess
2d154bfa54
comment 2021-09-28 16:33:21 -04:00
adina.wagner@2a4cac6443aada2bd2a329b8a33f4a7b87cc8eff
3ee5df48a5 Added a comment 2021-09-28 19:19:20 +00:00
Joey Hess
5802edb16c
comment 2021-09-28 14:14:37 -04:00
Joey Hess
6c7c568a27
response 2021-09-28 14:09:56 -04:00
Joey Hess
d322de3cc7
Merge branch 'master' of ssh://git-annex.branchable.com 2021-09-28 14:00:44 -04:00
Joey Hess
824b147286
followup 2021-09-28 14:00:10 -04:00