Commit graph

43516 commits

Author SHA1 Message Date
yarikoptic
5a24daf500 Added a comment 2023-04-26 14:34:32 +00:00
Joey Hess
4d6c918eff
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
2023-04-26 00:18:30 -04:00
Joey Hess
4358545a3e
note 2023-04-25 19:36:23 -04:00
Joey Hess
96cb6d2157
close and followup 2023-04-25 19:32:51 -04:00
Joey Hess
be36e208c2
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
2023-04-25 19:26:20 -04:00
Joey Hess
91ba0cc7fd
Revert "--json-exceptions"
This reverts commit a325524454.

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.
2023-04-25 17:37:34 -04:00
Joey Hess
7c514d717b
Merge branch 'master' of ssh://git-annex.branchable.com 2023-04-25 17:08:52 -04:00
Joey Hess
a325524454
--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
2023-04-25 17:05:33 -04:00
yarikoptic
38e9b0989e Added a comment 2023-04-25 18:45:58 +00:00
Joey Hess
a474c9c63b
upcase JSON 2023-04-25 14:35:18 -04:00
yarikoptic
def90e6fb0 Added a comment 2023-04-25 18:31:20 +00:00
Joey Hess
6b77c02be9
comment 2023-04-25 14:30:27 -04:00
Joey Hess
97d10f2f44
update 2023-04-25 13:49:19 -04:00
Joey Hess
cd05cfc035
comment 2023-04-25 13:19:28 -04:00
Joey Hess
26953ad3a6
comment 2023-04-25 13:18:01 -04:00
Joey Hess
00b29d17ad
update docs to account for exporttree 2023-04-25 12:15:14 -04:00
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3
722bb79dbf Added a comment: File visibility 2023-04-25 05:09:49 +00:00
BillyIII
38825e089d removed 2023-04-24 23:22:08 +00:00
BillyIII
c62ca36bf5 Added a comment 2023-04-24 23:18:48 +00:00
yarikoptic
5bc8052d9c Added a comment 2023-04-24 21:25:09 +00:00
Joey Hess
a127949e65
comment 2023-04-24 16:05:35 -04:00
yarikoptic
57ad9d8da4 Added a comment 2023-04-24 19:23:22 +00:00
Joey Hess
b002199366
comment 2023-04-24 11:53:14 -04:00
nobodyinperson
6b58846d93 2023-04-24 15:07:28 +00:00
aurtzy
51df5cb26e 2023-04-24 03:25:41 +00:00
aurtzy
c70677e31d 2023-04-24 03:16:12 +00:00
yarikoptic
589abdeb5c initial report on bad escaping 2023-04-22 05:06:01 +00:00
Joey Hess
3545c9f2c1
close 2023-04-21 12:34:20 -04:00
adina.wagner@2a4cac6443aada2bd2a329b8a33f4a7b87cc8eff
a32b0b8659 Added a comment 2023-04-21 07:08:35 +00:00
Joey Hess
e856ae0f35
idea 2023-04-20 14:21:22 -04:00
Joey Hess
2752360708
analysis and followup 2023-04-20 14:11:04 -04:00
DavidD
2de88e299f 2023-04-20 16:08:21 +00:00
DavidD
728a9ce995 2023-04-20 15:43:30 +00:00
DavidD
430bf010ad 2023-04-20 15:37:46 +00:00
Joey Hess
d11b3bc1af
Honor --force option when operating on a local git remote
Propagate Annex.force into the remote's Annex state.

Fixes this problem:

joey@darkstar:~/tmp/xxxx>git-annex copy mmm --to origin --force
copy mmm (to origin...)
  not enough free space, need 908.72 MB more (use --force to override this check or adjust annex.diskreserve)

  failed to send content to remote
failed

Does beg the question if anything else should be propagated.
Some things like Annex.forcenumcopies certianly not; using --numcopies
overrides the number of copies the current repo wants, not all of them.

Sponsored-by: Graham Spencer on Patreon
2023-04-19 12:53:58 -04:00
Joey Hess
a3f433eac8
improve error message when commitDb' fails due to disk full or IO error
There's still a 60 second delay in this situation because it retries,
in case the failure was due to something recoverable like another
process.

Sponsored-by: unqueued on Patreon
2023-04-19 12:43:30 -04:00
Joey Hess
31e4b6dee1
catch chdir exception in --autostop
assistant --autostop: Avoid crashing when ~/.config/git-annex/autostart
lists a directory that it cannot chdir to.

Sponsored-by: k0ld on Patreon
2023-04-19 12:42:02 -04:00
Joey Hess
d223fa3b0a
response 2023-04-19 12:26:20 -04:00
Joey Hess
cf85d54a2f
comment and improve docs 2023-04-19 12:20:26 -04:00
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3
43271632af Added a comment: Sync to remote master? 2023-04-19 08:40:41 +00:00
kirrik96@419b50c9fb455c2f172184be932c5df3635a3cf4
3d1d77a1bb 2023-04-18 21:12:21 +00:00
Joey Hess
9155ed1072
configremote
New command, currently limited to changing autoenable= setting of a special remote.

It will probably never be used for more than that given the limitations on
it.

Sponsored-by: Brock Spratlen on Patreon
2023-04-18 15:30:49 -04:00
Joey Hess
8728695b9c
support enableremote of git repo changing eg autoenable=
enableremote: Support enableremote of a git remote (that was previously set
up with initremote) when additional parameters such as autoenable= are
passed.

The enableremote special case for regular git repos is intended to handle
ones that don't have a UUID probed, and the user wants git-annex to
re-probe. So, that special case is still needed. But, in that special
case, the user is not passing any extra parameters. So, when there are
parameters, instead run the special remote setup code. That requires there
to be a uuid known already, and it allows changing things like autoenable=

Remote.Git.enableRemote changed to be a no-op if a git remote with the name
already exists. Which it generally will in this case.

Sponsored-by: Jack Hill on Patreon
2023-04-18 14:00:24 -04:00
Joey Hess
3a402a907f
comment 2023-04-18 13:09:24 -04:00
nobodyinperson
b32ca4180d 2023-04-18 07:55:46 +00:00
mih
377679babc Added a comment: Confirm 2023-04-18 07:54:46 +00:00
Joey Hess
f02d3336b6
comment 2023-04-17 14:09:06 -04:00
Joey Hess
7702165d6a
response 2023-04-17 14:03:02 -04:00
Joey Hess
d727907795
comment 2023-04-17 13:48:23 -04:00
Joey Hess
fdd1f177b0
response 2023-04-17 13:39:34 -04:00