Commit graph

40888 commits

Author SHA1 Message Date
bjornw
c853992e2f 2021-11-02 23:12:33 +00:00
bjornw
d8b5c8479f 2021-11-02 23:10:14 +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
70c06b4434
comment 2021-11-01 13:42:48 -04:00
Joey Hess
77b932b0f1
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-01 13:41:19 -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
Lukey
8c180cf55b Added a comment 2021-10-30 16:45:52 +00:00
erewhon
00bb88fcb6 2021-10-30 03:00:05 +00:00
jenkin.schibel@286264d9ceb79998aecff0d5d1a4ffe34f8b8421
069b3715d1 2021-10-29 18:24:15 +00:00
Joey Hess
2981b0fbc9
add news item for git-annex 8.20211028 2021-10-28 12:01:31 -04:00
Joey Hess
c260833a6b
releasing package git-annex version 8.20211028 2021-10-28 12:00:56 -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
a3cdff3fd5
add a comment about checkSaneLock
See commit 8c2dd7d8ee for original
introduction of it, but needing to spelunk that far back to understand
the code is not good.
2021-10-27 14:55:30 -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
Joey Hess
4efa4fdd12
comment 2021-10-27 14:18:19 -04:00
Joey Hess
669037862a
avoid redundant freezeContent call
This opens the potential for the object file to be in place but
git-annex is interrupted before it can freeze it. git-annex fsck already
fixes that situation, which can also occur when lockContentForRemoval
thaws content.

Also improve comment to not be Windows-specific.
2021-10-27 14:18:10 -04:00
jwodder
2a70a051b0 Added a comment 2021-10-27 18:16:44 +00:00
Reiko Asakura
0db7297f00
Call freezeContent after move into annex
This change better supports Windows ACL management using
annex.freezecontent-command and annex.thawcontent-command and matches
the behaviour of adding an unlocked file.

By calling freezeContent after the file has moved into the annex,
the file's delete permission can be denied. If the file's delete
permission is denied before moving into the annex, the file cannot
be moved or deleted. If the file's delete permission is not denied after
moving into the annex, it will likely inherit a grant for the delete
permission which allows it to be deleted irrespective of the permissions
of the parent directory.
2021-10-27 14:05:57 -04: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
Joey Hess
0756625e1b
update, bugfix also fixed git-annex info 2021-10-27 12:22:02 -04:00
Joey Hess
43c598d41a
comment 2021-10-27 12:21:43 -04:00
jwodder
24d6906d3e 2021-10-27 16:08:30 +00:00
mich_hein@7649a6a913fc77618845b4f94a5ae54fa432708a
f78761929c 2021-10-27 13:28:56 +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
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
10582d1fe3 Updated patch 2021-10-26 19:55:58 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
d607446043 Added a comment 2021-10-26 19:54:53 +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
3aaf6ade30
review 2021-10-26 14:08:56 -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
Joey Hess
c5bf4d3504
Merge branch 'master' of ssh://git-annex.branchable.com 2021-10-26 12:11:40 -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
pat
cc877dfe45 Added a comment 2021-10-24 22:42: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
63313e0b40 2021-10-24 19:12:23 +00:00
jkniiv
4471aae22f still think we should highlight this as new info 2021-10-24 15:10:13 +00:00
username
6f3cadcbda Added a comment 2021-10-23 15:53:57 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
42eaa6f8c9 Moved WSL1 guide to a tips page 2021-10-22 22:14:40 +00:00
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476
ebe022e9cf 2021-10-22 22:13:46 +00:00