Joey Hess [Tue, 9 May 2023 20:43:16 +0000 (16:43 -0400)]
importfeed: Support --json and --json-error-messages and --json-progress
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Tue, 9 May 2023 20:22:09 +0000 (16:22 -0400)]
importfeed: Move error to where --json-error-messages can capture it
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Tue, 9 May 2023 19:49:05 +0000 (15:49 -0400)]
importfeed: Support -J (and work toward supporting --json)
Both -J and --json needed importfeed to be refactored to use commandAction.
That was difficult, because of the interrelated nature of downloading feeds
and then downloading files from feeds, both of which needed to use
commandAction. And then checking for problems in feeds has to come after
these actions, which may be run as background jobs.
As for --json support, it's most of the way there, but still has some
warts, so I didn't enable jsonOptions yet. The warts include:
- An initial empty json record is displayed by getCache.
- Input is not populated, should be feed url
- feedProblem at end will not be captured by --json-error-messages
(see FIXME)
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 20:25:40 +0000 (16:25 -0400)]
renameremote: Support --json and --json-error-messages
Seems unlikely to be useful, but it works so
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 20:03:34 +0000 (16:03 -0400)]
factor out maybeAddJSONField
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 19:43:37 +0000 (15:43 -0400)]
reinject: Support --json and --json-error-messages
Also fix support for operating on multiple pairs of files and keys.
Moved notAnnexed to inside starting, so error message will get into the json.
Cannot include the key in the starting as it's not known yet, so instead
add it to the json later.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 19:06:19 +0000 (15:06 -0400)]
reinit: Support --json and --json-error-messages
Basically same concerns as init..
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 18:58:08 +0000 (14:58 -0400)]
init: Support --json and --json-error-messages
Dunno how useful this will be, since about all that's accessible from
the json is whether it succeeded or failed, and the error messages
which were already on stderr.
Note that, when autoenabling a special remote, it would be possible for
one to stop and prompt or output not using Messages and so not output as
part of the json. I don't think that happens, but I'm not 100% sure
something doesn't manage to break it. Of course, the same could be the
case for commands that transfer objects. Using Annex.Init.autoEnableSpecialRemotes
in --json mode would avoid the problem, but I've chosen to wait until I
know it's needed to use it.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 18:39:12 +0000 (14:39 -0400)]
unused: Support --json and --json-error-messages
Generalized AddJSONActionItemField to allow it to add several fields. Not entirely
happy with that, since the names of the fields have to be carefully chosen to
not conflict with other json fields. And fields added that way can't be parsed
back in FromJSON, except for the "fields" field that is special cased for metadata.
Still, I couldn't see another way to do it.
Also, omit file:null from the json output. Which does affect other commands,
eg git-annex whereis --all --json. Hopefully that won't break something that expects
a null file. If it did, that could be reverted, but it would be ugly to have
file:null in the unused --json
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Mon, 8 May 2023 18:35:44 +0000 (14:35 -0400)]
remove spam
Joey Hess [Mon, 8 May 2023 17:43:51 +0000 (13:43 -0400)]
remove spam
Added a comment: The Best solution for missing files
removed
Added a comment: A nice solution
Added a comment: The best option of s3 mac client
Added a comment: The best option of s3 mac client
jstritch [Mon, 8 May 2023 13:52:43 +0000 (13:52 +0000)]
Joey Hess [Sun, 7 May 2023 16:54:29 +0000 (12:54 -0400)]
Joey Hess [Sun, 7 May 2023 16:54:19 +0000 (12:54 -0400)]
update
Joey Hess [Fri, 5 May 2023 19:36:51 +0000 (15:36 -0400)]
oops
Joey Hess [Fri, 5 May 2023 19:29:49 +0000 (15:29 -0400)]
expire, trust et al, dead, describe: Support --json and --json-error-messages
For expire, the normal output is unchanged, but the --json output includes the uuid
in machine parseable form. Which could be very useful for this somewhat obscure
command. That needed ActionItemUUID to be implemented, which seemed like a lot
of work, but then ---
I had been going to skip implementing them for trust, untrust, dead, semitrust,
and describe, but putting the uuid in the json is useful information, it tells
what uuid git-annex picked given the input. It was not hard to support
these once ActionItemUUID was implemented.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Fri, 5 May 2023 18:01:40 +0000 (14:01 -0400)]
addunused, dropunused: Support --json and --json-error-messages
This also changes addunused to display the names of the files that it adds.
That seems like a general usability improvement, and not displaying the input
number does not seem likely to be a problem to a user, since the filename
is based on the key. Displaying the filename was necessary to get it and the key
included in the json.
dropunused does not include the key in the json. It would be possible to
add, but would need more changes. And I doubt that dropunused --json
would be used in a situation where a program cared which keys were
dropped. Note that drop --unused does have the key in its json, so such
a program could just use it. Or could just dropkey --batch with the
specific keys it wants to drop if it cares about specific keys.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Fri, 5 May 2023 17:36:57 +0000 (13:36 -0400)]
comment
nobodyinperson [Fri, 5 May 2023 14:19:42 +0000 (14:19 +0000)]
Added a comment: out of date git-annex
jt [Fri, 5 May 2023 14:04:06 +0000 (14:04 +0000)]
Added a comment: Invalid argument `whereused'
Joey Hess [Thu, 4 May 2023 20:48:51 +0000 (16:48 -0400)]
update
Joey Hess [Thu, 4 May 2023 20:34:35 +0000 (16:34 -0400)]
migrate, undo: Support --json and --json-error-messages
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Thu, 4 May 2023 20:03:54 +0000 (16:03 -0400)]
rekey, setpresentkey: Support --json and --json-error-messages
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Thu, 4 May 2023 18:34:37 +0000 (14:34 -0400)]
update
Joey Hess [Thu, 4 May 2023 18:28:21 +0000 (14:28 -0400)]
fix: Support --json and --json-error-messages
And triaged out some commands that don't need to support these options.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Thu, 4 May 2023 16:36:31 +0000 (12:36 -0400)]
log: Support --json and --json-error-messages
Also in passing the --all display was fixed up to not quote keys like filenames.
Note that the check added to compareChanges was needed to avoid logging when
nothing changed.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Thu, 4 May 2023 15:53:38 +0000 (11:53 -0400)]
remote tailing 's' from log --raw-data
log: When --raw-date is used, display only seconds from the epoch, as
documented, omitting a trailing "s" that was included in the output
before.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Thu, 4 May 2023 15:28:27 +0000 (11:28 -0400)]
rmurl: Support --json and --json-error-messages
The json does not include an url field, but it does have an input field that is
"file url" when using --batch and ["file", "url"] when using the command line.
I chose not to change that because it would complicate batchInput.
An url field could be added if it turns out to be useful.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
yarikoptic [Thu, 4 May 2023 00:10:09 +0000 (00:10 +0000)]
moved log and rmurl to the top as the one we use AFAIK
Joey Hess [Wed, 3 May 2023 19:56:20 +0000 (15:56 -0400)]
unannex: Support --json and --json-error-messages
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
Joey Hess [Wed, 3 May 2023 19:25:17 +0000 (15:25 -0400)]
comment
yarikoptic [Wed, 3 May 2023 19:08:03 +0000 (19:08 +0000)]
plea for --json for unannex and other commands
nobodyinperson [Wed, 3 May 2023 14:23:05 +0000 (14:23 +0000)]
Added a comment: adding all files or only in current directory?
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3 [Wed, 3 May 2023 07:49:19 +0000 (07:49 +0000)]
Added a comment: Groups comprised of archive drives of various size
Joey Hess [Tue, 2 May 2023 17:27:04 +0000 (13:27 -0400)]
forwarded git bug
Joey Hess [Mon, 1 May 2023 21:10:31 +0000 (17:10 -0400)]
comment
Joey Hess [Mon, 1 May 2023 21:08:44 +0000 (17:08 -0400)]
comment
Joey Hess [Mon, 1 May 2023 21:05:51 +0000 (17:05 -0400)]
beat my head against this bug for a couple hours
Joey Hess [Mon, 1 May 2023 17:09:47 +0000 (13:09 -0400)]
comment
Joey Hess [Mon, 1 May 2023 17:00:05 +0000 (13:00 -0400)]
initremote: Avoid creating a remote that is not encrypted when gpg is broken
checksize was applied lazily, so the exception didn't happen until the
remote was set up.
Sponsored-by: k0ld on Patreon
Joey Hess [Mon, 1 May 2023 16:30:25 +0000 (12:30 -0400)]
comment
Joey Hess [Mon, 1 May 2023 16:29:31 +0000 (12:29 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Mon, 1 May 2023 16:25:14 +0000 (12:25 -0400)]
fix reversion in display of fatal exceptions
fdac66ae10a7022326d1470862c93fd191216e61 lost the "git-annex:" prefix,
which broke datalad's parsing of an error message (ugh)
Also, don't use warningIO because it displays a blank line to stdout,
which is also a behavior change from before, and does not seem
necessary.
Sponsored-by: Brock Spratlen on Patreon
tom@b87e4336a0d0785eb7d5853e390835a18797402f [Mon, 1 May 2023 16:10:00 +0000 (16:10 +0000)]
Added a comment
Joey Hess [Mon, 1 May 2023 16:07:20 +0000 (12:07 -0400)]
fixed related issue
Joey Hess [Mon, 1 May 2023 16:05:21 +0000 (12:05 -0400)]
back compat fix for info --json on unknown item
This was changed in
a0e6fa18eb3c16c3c8079bb41c18151e6ea8b554 in a way
that broke datalad, which expected to see a "file" field in the --json.
See https://github.com/datalad/datalad/pull/7372/commits/
45ddd4b12ff637c6c77e982225c0e9d9eb53c1b6
Joey Hess [Mon, 1 May 2023 15:57:49 +0000 (11:57 -0400)]
comment
tom@b87e4336a0d0785eb7d5853e390835a18797402f [Mon, 1 May 2023 12:58:46 +0000 (12:58 +0000)]
Added a comment: output
nobodyinperson [Mon, 1 May 2023 12:26:10 +0000 (12:26 +0000)]
Added a comment
tom@b87e4336a0d0785eb7d5853e390835a18797402f [Mon, 1 May 2023 12:05:34 +0000 (12:05 +0000)]
nobodyinperson [Mon, 1 May 2023 08:50:10 +0000 (08:50 +0000)]
Added a comment: git-annex relaying syncs across remotes
tom@b87e4336a0d0785eb7d5853e390835a18797402f [Mon, 1 May 2023 08:34:46 +0000 (08:34 +0000)]
Added a comment: What is the underlying reason for needing a two-way SSH connection
nobodyinperson [Sat, 29 Apr 2023 14:46:46 +0000 (14:46 +0000)]
Added a comment
tom@b87e4336a0d0785eb7d5853e390835a18797402f [Sat, 29 Apr 2023 14:34:27 +0000 (14:34 +0000)]
nobodyinperson [Fri, 28 Apr 2023 07:56:18 +0000 (07:56 +0000)]
Joey Hess [Thu, 27 Apr 2023 19:57:50 +0000 (15:57 -0400)]
avoid annexFileMode special case
This makes annexFileMode be just an application of setAnnexPerm',
which avoids having 2 functions that do different versions of the same
thing.
Fixes some buggy behavior for some combinations of core.sharedRepository
and umask.
Sponsored-by: Jack Hill on Patreon
Joey Hess [Wed, 26 Apr 2023 21:03:16 +0000 (17:03 -0400)]
Support core.sharedRepository=0xxx at long last
Sponsored-by: Brett Eisenberg on Patreon
Joey Hess [Wed, 26 Apr 2023 20:22:15 +0000 (16:22 -0400)]
fix perms for core.sharedRepository
These two missed setting it.
It rarely matters that the journal gets the right perm. But, when using
annex.alwayscommit=false, someone else may come along later and want
to append to the journal file.
It probably never matters what the sentinal perms are, but for
completeness..
Sponsored-by: Luke Shumaker on Patreon
Joey Hess [Wed, 26 Apr 2023 20:09:49 +0000 (16:09 -0400)]
fix init .git/annex/ perms for core.sharedRepository
init: Bug fix: Create .git/annex/ and .git/annex/fsckdb/ directories with
permissions configured by core.sharedRepository.
The fsckfb being created happens to create .git/annex/ and it was not using
createAnnexDirectory. Probably a reversion partly, but maybe the database
directory was always created not honoring core.sharedRepository?
Sponsored-by: Noam Kremen on Patreon
Joey Hess [Wed, 26 Apr 2023 17:25:29 +0000 (13:25 -0400)]
Warn about unsupported core.sharedRepository=0xxx when set
This spams the user with a lot of messages, but it seems like busywork to
avoid that and only warn once, since this warning will go away when it gets
implemented.
Also fix parsing of the octal value.
Sponsored-by: Kevin Mueller on Patreon
Joey Hess [Wed, 26 Apr 2023 16:53:30 +0000 (12:53 -0400)]
rename errorid to message-id
yarikoptic [Wed, 26 Apr 2023 16:38:27 +0000 (16:38 +0000)]
Added a comment
yarikoptic [Wed, 26 Apr 2023 14:34:32 +0000 (14:34 +0000)]
Added a comment
Joey Hess [Wed, 26 Apr 2023 04:12:38 +0000 (00:12 -0400)]
avoid quoting spaces in git-annex find output to terminal
That's too much quoting, the user expects the filename to be copy and
pasteable. It would be ok to slash-escape space ('\ ')
which is what gnu find does, but it doesn't seem necessary either.
${escaped_file} has always quoted spaces though, so keep on doing it
there.
Sponsored-by: Nicholas Golder-Manning on Patreon
Joey Hess [Tue, 25 Apr 2023 23:36:23 +0000 (19:36 -0400)]
note
Joey Hess [Tue, 25 Apr 2023 23:32:51 +0000 (19:32 -0400)]
close and followup
Joey Hess [Tue, 25 Apr 2023 23:26:20 +0000 (19:26 -0400)]
json object for FileNotFound
When a nonexistant file is passed to a command and --json-error-messages
is enabled, output a JSON object indicating the problem.
(But git ls-files --error-unmatch still displays errors about such files in
some situations.)
I don't like the duplication of the name of the command introduced by this,
but I can't see a great way around it. One way would be to pass the Command
instead.
When json is not enabled, the stderr is unchanged. This is necessary
because some commands like find have custom output. So dislaying
"find foo not found" would be wrong. So had to complicate things with
toplevelFileProblem having different output with and without json.
When not using --json-error-messages but still using --json, it displays
the error to stderr, but does display a json object without the error. It
does have an errorid though. Unsure how useful that behavior is.
Sponsored-by: Dartmouth College's Datalad project
Joey Hess [Tue, 25 Apr 2023 21:37:34 +0000 (17:37 -0400)]
Revert "--json-exceptions"
This reverts commit
a325524454fdc45a61f91844efb3065f6e34b318.
Turns out this was predicated on an incorrect belief that json output
didn't already sometimes lack the "key" field. Since json output already
can when `giveup` was used, it seems unncessary to add a whole new
option for this.
Joey Hess [Tue, 25 Apr 2023 21:08:52 +0000 (17:08 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 25 Apr 2023 21:02:25 +0000 (17:02 -0400)]
--json-exceptions
Added a --json-exceptions option, which makes some exceptions be output in json.
The distinction is that --json-error-messages is for messages relating
to a particular ActionItem, while --json-exceptions is for messages that
are not, eg ones for a file that does not exist.
It's unfortunate that we need two switches with such a fine distinction
between them, but I'm worried about maintaining backwards compatability
in the json output, to avoid breaking anything that parses it, and this was
the way to make sure I didn't.
toplevelWarning is generally used for the latter kind of message. And
the other calls to toplevelWarning could be converted to showException. The
only possible gotcha is that if toplevelWarning is ever called after
starting acting on a file, it will add to the --json-error-messages of the
json displayed for that file and converting to showException would be a
behavior change. That seems unlikely, but I didn't convery everything to
avoid needing to satisfy myself it was not a concern.
Sponsored-by: Dartmouth College's Datalad project
yarikoptic [Tue, 25 Apr 2023 18:45:58 +0000 (18:45 +0000)]
Added a comment
Joey Hess [Tue, 25 Apr 2023 18:35:18 +0000 (14:35 -0400)]
upcase JSON
yarikoptic [Tue, 25 Apr 2023 18:31:20 +0000 (18:31 +0000)]
Added a comment
Joey Hess [Tue, 25 Apr 2023 18:30:27 +0000 (14:30 -0400)]
comment
Joey Hess [Tue, 25 Apr 2023 17:49:19 +0000 (13:49 -0400)]
update
Joey Hess [Tue, 25 Apr 2023 17:19:28 +0000 (13:19 -0400)]
comment
Joey Hess [Tue, 25 Apr 2023 17:18:01 +0000 (13:18 -0400)]
comment
Joey Hess [Tue, 25 Apr 2023 16:15:14 +0000 (12:15 -0400)]
update docs to account for exporttree
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3 [Tue, 25 Apr 2023 05:09:49 +0000 (05:09 +0000)]
Added a comment: File visibility
BillyIII [Mon, 24 Apr 2023 23:22:08 +0000 (23:22 +0000)]
removed
BillyIII [Mon, 24 Apr 2023 23:18:48 +0000 (23:18 +0000)]
Added a comment
yarikoptic [Mon, 24 Apr 2023 21:25:09 +0000 (21:25 +0000)]
Added a comment
Joey Hess [Mon, 24 Apr 2023 20:05:35 +0000 (16:05 -0400)]
comment
yarikoptic [Mon, 24 Apr 2023 19:23:22 +0000 (19:23 +0000)]
Added a comment
Joey Hess [Mon, 24 Apr 2023 15:53:14 +0000 (11:53 -0400)]
comment
nobodyinperson [Mon, 24 Apr 2023 15:07:28 +0000 (15:07 +0000)]
aurtzy [Mon, 24 Apr 2023 03:25:41 +0000 (03:25 +0000)]
aurtzy [Mon, 24 Apr 2023 03:16:12 +0000 (03:16 +0000)]
yarikoptic [Sat, 22 Apr 2023 05:06:01 +0000 (05:06 +0000)]
initial report on bad escaping
Joey Hess [Fri, 21 Apr 2023 16:34:20 +0000 (12:34 -0400)]
close
Added a comment
Joey Hess [Thu, 20 Apr 2023 18:21:22 +0000 (14:21 -0400)]
idea
Joey Hess [Thu, 20 Apr 2023 18:11:04 +0000 (14:11 -0400)]
analysis and followup
DavidD [Thu, 20 Apr 2023 16:08:21 +0000 (16:08 +0000)]
DavidD [Thu, 20 Apr 2023 15:43:30 +0000 (15:43 +0000)]