Commit graph

31135 commits

Author SHA1 Message Date
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
f1516579ce Added a comment 2021-12-09 16:20:48 +00:00
jwodder
4b0af2f27b 2021-12-09 14:13:54 +00:00
alt
7eef6ac703 Added a comment 2021-12-08 20:01:33 +00:00
Joey Hess
4a1758fccf
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-08 15:38:23 -04:00
Joey Hess
b865ae6b38
comment 2021-12-08 15:20:36 -04:00
Joey Hess
4b19626a36
Fix build with ghc 9.0.1
Continuing along the same lines as commit
2739adc258, it seems that
while Remote -> Retriever expands to the same data type this changes
it to, ghc 9.0.1 refuses to consider them equiviant. I guess it has
something to do with the forall?

The rest of the build all succeeds, although the stack build then crashes:
Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.4.0.0/build/git-annex/git-annex ...
Completed 233 action(s).
Prelude.chr: bad argument: 2214592520
This issue seems likely to be about it:
https://github.com/commercialhaskell/stack/pull/5508
I'm building with stack from debian, version 2.3.3, so a newer stack
probably avoids that. Anyway, despite that stack problem,
the git-annex binary is built, and works.

The stack.yaml I used for this build was patched as follows:

diff --git a/stack.yaml b/stack.yaml
index 8dac87c15..62c4b5b9d 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,6 +1,6 @@
 flags:
   git-annex:
-    production: true
+    production: false
     assistant: true
     pairing: true
     torrentparser: true
@@ -14,7 +14,7 @@ flags:
     httpclientrestricted: true
 packages:
 - '.'
-resolver: lts-18.13
+resolver: nightly-2021-09-07
 extra-deps:
 - IfElse-0.85
 - aws-0.22

Sponsored-by: Graham Spencer on Patreon
2021-12-08 15:08:02 -04:00
yarikoptic
d56267f0cc Added a comment 2021-12-08 18:56:51 +00:00
yarikoptic
c5a415191d initial report on crash on readonly non-inited annex 2021-12-08 18:56:14 +00:00
Joey Hess
0139b4fa82
comment 2021-12-08 13:42:36 -04:00
Joey Hess
b060d99fe0
comment 2021-12-08 13:18:13 -04:00
Joey Hess
b8f4f2fb89
comment 2021-12-08 12:47:34 -04:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
d45e4ea685 Added a comment 2021-12-08 16:25:32 +00:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
2eeb379e4d Added a comment 2021-12-08 00:46:40 +00:00
yarikoptic
2719170575 initial todo on more flexible credentials management mechanism 2021-12-07 18:34:58 +00:00
Joey Hess
a7a5915cda
comment 2021-12-07 13:03:45 -04:00
Joey Hess
af236a7c6f
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-07 13:00:47 -04:00
Joey Hess
58460ac3e4
comment 2021-12-07 13:00:28 -04:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
e2c7a130ec 2021-12-07 03:32:41 +00:00
Joey Hess
756768a6a4
fixed 2021-12-06 15:44:14 -04:00
Joey Hess
d4665731d9
remove last trailing unresolved bit
I think the lock file probing stuff is ok as it is for pid locks.
If not, let's wait until we have a test case, it would be easy to subtly
break it.
2021-12-06 15:34:56 -04:00
Joey Hess
a91c4d945e
comment 2021-12-06 15:13:54 -04:00
Joey Hess
7c78fae463
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-06 12:53:43 -04:00
Joey Hess
ae4c56b28a
Revert "fix too early close of shared lock file"
This reverts commit 66b2536ea0.

I misunderstood commit ac56a5c2a0
and caused a FD leak when pid locking is not used.

A LockHandle contains an action that will close the underlying lock
file, and that action is run when it is closed. In the case of a shared
lock, the lock file is opened once for each LockHandle, and only
the one for the LockHandle that is being closed will be closed.
2021-12-06 12:51:28 -04:00
alt
371238eca3 2021-12-06 15:56:56 +00:00
jasonb@ab4484d9961a46440958fa1a528e0fc435599057
a8ff96864e 2021-12-05 20:37:48 +00:00
Joey Hess
00625caf87
update 2021-12-05 08:11:41 -04:00
Joey Hess
490689f122
Merge branch 'master' of ssh://git-annex.branchable.com 2021-12-03 18:42:05 -04:00
Joey Hess
9d3dce94f0
comment 2021-12-03 18:41:34 -04:00
yarikoptic
8a3b6f46c8 Added a comment 2021-12-03 21:41:53 +00:00
Joey Hess
a5fcc03595
comment 2021-12-03 16:40:58 -04:00
Joey Hess
6988c2e740
fix build on windows
broken by ed0afbc36b

Sponsored-by: Dartmouth College's Datalad project
2021-12-03 14:08:12 -04:00
ashton@37fa3fec6d2eef022a3491c85362a34141fbf0db
5d9cc3e5af 2021-12-02 23:36:10 +00:00
yarikoptic
3205686faf Added a comment 2021-12-02 20:42:37 +00:00
yarikoptic
d88a52886d removed 2021-12-02 20:41:37 +00:00
yarikoptic
33c36ef5cb initial follow up on the read-only mode issue 2021-12-02 20:39:39 +00:00
yarikoptic
937b9de516 Added a comment: automate + extend 2021-12-02 20:34:55 +00:00
yarikoptic
9c0f3d1de8 Added a comment 2021-12-02 13:05:55 +00:00
Joey Hess
ed0afbc36b
avoid concurrent threads trying to take pid lock at same time
Seem there are several races that happen when 2 threads run PidLock.tryLock
at the same time. One involves checkSaneLock of the side lock file, which may
be deleted by another process that is dropping the lock, causing checkSaneLock
to fail. And even with the deletion disabled, it can still fail, Probably due
to linkToLock failing when a second thread overwrites the lock file.

The same can happen when 2 processes do, but then one process just fails
to take the lock, which is fine. But with 2 threads, some actions where failing
even though the process as a whole had the pid lock held.

Utility.LockPool.PidLock already maintains a STM lock, and since it uses
LockShared, 2 threads can hold the pidlock at the same time, and when
the first thread drops the lock, it will remain held by the second
thread, and so the pid lock file should not get deleted until the last
thread to hold it drops the lock. Which is the right behavior, and why a
LockShared STM lock is used in the first place.

The problem is that each time it takes the STM lock, it then also calls
PidLock.tryLock. So that was getting called repeatedly and concurrently.

Fixed by noticing when the shared lock is already held, and stop calling
PidLock.tryLock again, just use the pid lock that already exists then.

Also, LockFile.PidLock.tryLock was deleting the pid lock when it failed
to take the lock, which was entirely wrong. It should only drop the side
lock.

Sponsored-by: Dartmouth College's Datalad project
2021-12-01 17:14:39 -04:00
Joey Hess
f50de2455f
retitle 2021-12-01 14:35:31 -04:00
Joey Hess
54a4ca9e3c
comment 2021-12-01 14:10:39 -04:00
Joey Hess
d4e99d902b
analysis 2021-12-01 13:38:47 -04:00
Joey Hess
b7976e08f0
comment 2021-12-01 13:03:05 -04:00
Joey Hess
e11ca04e28
comment 2021-12-01 12:46:07 -04:00
yarikoptic
7ca799efed initial report on needing more thorough retries when downloading from S3 2021-12-01 15:41:13 +00:00
account@dc612ad075297e574ebc3eb9a5b8ab6e753510dc
30c55f8940 Added a comment: Further fix attempts 2021-12-01 03:25:35 +00:00
adina.wagner@2a4cac6443aada2bd2a329b8a33f4a7b87cc8eff
a5b635af20 Added a comment: A few Windows benchmarks 2021-11-29 22:17:39 +00:00
Joey Hess
a6699be79d
catch error statting pid lock file if it somehow does not exist
It ought to exist, since linkToLock has just created it. However,
Lustre seems to have a rather probabilisitic view of the contents of a
directory, so catching the error if it somehow does not exist and
running the same code path that would be ran if linkToLock failed
might avoid this fun Lustre failure.

Sponsored-by: Dartmouth College's Datalad project
2021-11-29 14:53:07 -04:00
Joey Hess
567f63ba47
export: Avoid unncessarily re-exporting non-annexed files that were already exported
Commit b6e4ed9aa7 made non-annexed files
be re-uploaded every time, since they're not tracked in the location log,
and it made it check the location log. Don't do that for non-annexed files.

Sponsored-by: Brock Spratlen on Patreon
2021-11-29 14:02:38 -04:00
Joey Hess
05d79b26d8
clarify 2021-11-29 14:00:32 -04:00
Joey Hess
28cca9b9ff
comment 2021-11-29 13:32:12 -04:00
Joey Hess
357760cacf
comment 2021-11-29 13:16:52 -04:00
Joey Hess
b141b8a009
comment 2021-11-29 13:02:15 -04:00
mih
02e3756bd7 Added a comment: Even more impact on real systems 2021-11-26 14:23:34 +00:00
Atemu
0f48796532 Added a comment 2021-11-25 19:23:46 +00:00
mih
120a94bcb8 Added a comment: More statistics 2021-11-25 13:09:11 +00:00
Rémi
0b2314ffe0 bug on export tree remote. 2021-11-25 10:15:49 +00:00
mih
fe143b2cb9 Added a comment: Translates to Windows! 2021-11-25 07:34:49 +00:00
dev@c1c358f0d3c8563701193b66791eb1bc57a25ac9
5aca043296 2021-11-24 21:01:41 +00:00
yarikoptic
e83c07427a 2021-11-24 14:13:20 +00:00
yarikoptic
574938c234 Added a comment 2021-11-23 23:22:36 +00:00
yarikoptic
65494a9f81 Added a comment 2021-11-23 23:12:47 +00:00
jkniiv
6d59508f02 Added a comment 2021-11-23 21:46:43 +00:00
Joey Hess
95f78cc1ce
add news item for git-annex 8.20211123 2021-11-23 15:20:58 -04:00
Joey Hess
d7dfb99b16
comment 2021-11-23 15:19:11 -04:00
yarikoptic
23ee488980 initial report 2021-11-23 15:41:45 +00:00
yarikoptic
019564c52f initial report on tests exit code 124 2021-11-23 14:40:35 +00:00
m15
2e2d35869c Added a comment: new problem on reinject 2021-11-23 00:53:37 +00:00
Joey Hess
5a7f253974
support git 2.34.0's handling of merge conflict between annexed and non-annexed file
This version of git -- or its new default "ort" resolver -- handles such
a conflict by staging two files, one with the original name and the other
named file~ref. Use unmergedSiblingFile when the latter is detected.

(It doesn't do that when the conflict is between a directory and a file
or symlink though, so see previous commit for how that case is handled.)

The sibling file has to be deleted separately, because cleanConflictCruft
may not delete it -- that only handles files that are annex links,
but the sibling file may be the non-annexed file side of the conflict.

The graftin code had assumed that, when the other side of a conclict
is a symlink, the file in the work tree will contain the non-annexed
content that we want it to contain. But that is not the case with the new
git; the file may be the annex link and needs to be replaced with the
content, while the annex link will be written as a -variant file.

(The weird doesDirectoryExist check in graftin turns out to still be
needed, test suite failed when I tried to remove it.)

Test suite passes with new git with ort resolver default. Have not tried it
with old git or other defaults.

Sponsored-by: Noam Kremen on Patreon
2021-11-22 16:10:24 -04:00
Joey Hess
c49787824c
fix test failure with git version 2.34.0
The new "ort" resolver uses different filenames than what the test suite
accepted when resolving a conflict between a directory an an annexed
file. Make the test looser in what it accepts, so it will work with old
and new git.

Other tests still look for "conflictor.variant" as a prefix,
because when eg resolving a conflicted merge of 2 annexed files,
the filename is not changed by the ort resolver, and I didn't want to
unncessarily loosen the test.

Also I'm not entirely happy with the filenames used by the ort resolver,
see comment.

There's still another test failure caused by that resolver that is not
fixed yet.
2021-11-22 13:30:03 -04:00
kyle
e2da89ba49 Added a comment: re: git 2.34: some conflict resolution unit tests fail 2021-11-21 21:41:36 +00:00
jkniiv
a0e9a059ab issue, presumably git 2.34 new merge strategy to blame 2021-11-21 18:49:02 +00:00
Joey Hess
0f9e5ada82
idea 2021-11-21 11:19:47 -04:00
yarikoptic
e1f38b9dd7 Added a comment 2021-11-19 17:44:22 +00:00
Joey Hess
623a775609
fix cat-file leak in get with -J
Bugfix: When -J was enabled, getting files leaked a ever-growing number of
git cat-file processes.

(Since commit dd39e9e255)

The leak happened when mergeState called stopNonConcurrentSafeCoProcesses.
While stopNonConcurrentSafeCoProcesses usually manages to stop everything,
there was a race condition where cat-file processes were leaked. Because
catFileStop modifies Annex.catfilehandles in a non-concurrency safe way,
and could clobber modifications made in between. Which should have been ok,
since originally catFileStop was only used at shutdown.

Note the comment on catFileStop saying it should only be used when nothing
else is using the handles. It would be possible to make catFileStop
race-safe, but it should just not be used in a situation where a race is
possible. So I didn't bother.

Instead, the fix is just not to stop any processes in mergeState. Because
in order for mergeState to be called, dupState must have been run, and it
enables concurrency mode, stops any non-concurrent processes, and so all
processes that are running are concurrency safea. So there is no need to
stop them when merging state. Indeed, stopping them would be extra work,
even if there was not this bug.

Sponsored-by: Dartmouth College's Datalad project
2021-11-19 12:51:08 -04:00
Joey Hess
2d3e8718e6
reproduced 2021-11-19 12:05:19 -04:00
Joey Hess
15d617f7e1
have setConcurrency stop any running git coprocesses
When non-concurrent git coprocesses have been started, setConcurrency
used to not stop them, and so could leak processes when enabling
concurrency, eg when forkState is called.

I do not think that ever actually happened, given where setConcurrency
is called. And it probably would only leak one of each process, since it
never downgrades from concurrent to non-concurrent.
2021-11-19 12:00:39 -04:00
Joey Hess
261947683b
comment 2021-11-19 10:23:27 -04:00
Joey Hess
1e1da11ea1
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-19 09:20:07 -04:00
Joey Hess
7d89a8846e
tag forumbug 2021-11-19 09:19:56 -04:00
yarikoptic
9513b37803 Added a comment: bisection 2021-11-18 02:29:01 +00:00
yarikoptic
3191ea44ef Added a comment: god bless search 2021-11-17 21:03:29 +00:00
Joey Hess
7521f63665
add news item for git-annex 8.20211117 2021-11-17 12:21:07 -04:00
Joey Hess
674d6703ad
collapse lists of done items by default
Copying how the datalad page does it. This avoids me missing the header
and thinking these are still open.
2021-11-16 12:38:41 -04:00
Joey Hess
7e19fcc93b
tag moreinfo 2021-11-16 12:35:02 -04:00
Joey Hess
c9d598ced7
comment 2021-11-16 12:33:36 -04:00
Joey Hess
58c9372053
close 2021-11-15 15:46:16 -04:00
Joey Hess
70d99328be
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-15 15:35:04 -04:00
Joey Hess
2bd778a46e
importfeed: Fix a crash when used in a non-unicode locale
See comment for analysis.

At first I thought I'd need to convert all T.unpack in git-annex, but
luckily not -- so long as the Text is read from a file, the filesystem
encoding is applied and T.unpack is fine. It's only when using Feed
that the filesystem encoding is not applied.

While this fixes the crash, it does result in some mojibake, eg:
itemid=http://www.manager-tools.com/2014/01/choosing-a-company-work-chapter-7-���-questions/

Have not tracked that down, but it must be unrelated, because
I've verified that it roundtrips when using encodeUf8:

joey@darkstar:~/src/git-annex>LANG=C ghci  Utility/FileSystemEncoding.hs
ghci> useFileSystemEncoding
ghci> Just f <- Text.Feed.Import.parseFeedFromFile "/home/joey/tmp/career_tools_podcasts.xml"
ghci> Just (_, x) = Text.Feed.Query.getItemId (Text.Feed.Query.feedItems f !! 0)
ghci> decodeBS (Data.Text.Encoding.encodeUtf8 x)
"http://www.manager-tools.com/2014/01/choosing-a-company-work-chapter-7-\56546\56448\56467-questions/"
ghci> writeFile "foo" $ decodeBS (Data.Text.Encoding.encodeUtf8 x)
Writes a file containing the ENDASH character.

Sponsored-by: Jochen Bartl on Patreon
2021-11-15 15:04:21 -04:00
Lukey
b4052cb765 Added a comment 2021-11-14 20:11:35 +00:00
contact@ee563aaec1e9de7a4e8d748992963dba79178e9c
db4ae6c697 Added a comment 2021-11-14 18:41:18 +00:00
contact@ee563aaec1e9de7a4e8d748992963dba79178e9c
0e3fb1c2db Added a comment 2021-11-14 18:37:05 +00:00
contact@ee563aaec1e9de7a4e8d748992963dba79178e9c
0c4a40d59f Added a comment 2021-11-14 18:35:45 +00:00
contact@ee563aaec1e9de7a4e8d748992963dba79178e9c
6f07a82f9c 2021-11-14 18:33:52 +00:00
Joey Hess
b12f7f84f7
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-13 09:09:45 -04:00
rklett
5b6e096f12 2021-11-13 03:59:47 +00:00
Joey Hess
258647ce7d
improve docs
I saw a user open a forum post that looked like they had read this man
page, but were unaware of git-annex unlock, and were looking for its
functionality. They later deleted the post, probably when they found
git-annex unlock. Looking at this man page, it was a bit unclear about
the motivation for the command.

Yes, I'm warching... ;-)
2021-11-12 14:08:36 -04:00
Joey Hess
2248b35fb8
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-12 13:29:22 -04:00
Joey Hess
51b73ea1fc
migrate: New --remove-size option
While intended for converting URL keys added by addurl --fast to be
as if added by addurl --relaxed, it can also be used to remove size
from other types of keys. Although that is not likely to be useful
for checksummed keys, I suppose it could be used for WORM or other
non-checksum keys.

Specifying the --remove-size option does not prevent other migrations
from taking effect if there's a key upgrade to perform, or if the
backend has changed. So --backend=URL needs to be used to prevent
migrating an URL key to the default backend.

Note that it's not possible to use git-annex migrate to convert from a
non-URL key to an URL key, as URL keys cannot be generated, except by
addurl. So while this can get the same effect as --relaxed would have
when addurl --fast was used, when --fast was not used, it won't work, or
if --backend=URL is not used will remove the size but not prevent
checksum verification, which is not useful. Due to this complexity, I
decided not to mention it in the git-annex addurl man page.

Sponsored-by: Jochen Bartl on Patreon
2021-11-12 13:28:28 -04:00
iimog@2c22a44141070c04b943932b697818a686859677
71f87dabd2 Added a comment: It works 2021-11-12 08:14:33 +00:00
Joey Hess
f3326b8b5a
git-lfs gitlab interoperability fix
git-lfs: Fix interoperability with gitlab's implementation of the git-lfs
protocol, which requests Content-Encoding chunked.

Sponsored-by: Dartmouth College's Datalad project
2021-11-10 13:51:11 -04:00
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
Joey Hess
886d60dabe
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-09 15:53:13 -04:00
Joey Hess
9121154a75
new todo 2021-11-09 15:52:17 -04:00
Ilya_Shlyakhter
61a6bdc386 Added a comment: clarification re: smudge filter and annex.supportunlocked 2021-11-09 18:28:10 +00:00
iimog@2c22a44141070c04b943932b697818a686859677
173d8d0e51 2021-11-09 15:30:42 +00:00
jkniiv
a741d3308f Added a comment 2021-11-09 08:48:33 +00:00
fireboy
95c37fb262 removed 2021-11-09 04:47:41 +00:00
fireboy
6682b04a27 2021-11-09 01:48:01 +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
Joey Hess
020148bd06
comment 2021-11-08 16:23:05 -04:00
Joey Hess
f410f9d7ca
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-08 16:20:57 -04:00
Joey Hess
7e3180226d
devblog 2021-11-08 16:20:43 -04:00
Joey Hess
a0758bdd10
dynamically disable filter-process in restagePointerFile when it would be slower
Based on my earlier benchmark, I have a rough cost model for how
expensive it is for git-annex smudge to be run on a file, vs
how expensive it is for a gigabyte of a file's content to be read and
piped through to filter-process.

So, using that cost model, it can decide if using filter-process will
be more or less expensive than running the smudge filter on the files to
be restaged.

It turned out to be *really* annoying to temporarily disable
filter-process. I did find a way, but urk, this is horrible. Notice
that, if it's interrupted with it disabled, it will remain disabled
until the next time restagePointerFile runs. Which could be some time
later. If the user runs `git add` or `git checkout` on a lot of small
files before that, they will see slower than expected performance.

(This commit also deletes where I wrote down the benchmark results
earlier.)

Sponsored-by: Noam Kremen on Patreon
2021-11-08 16:20:34 -04:00
Lukey
f32cb96a34 Added a comment 2021-11-08 19:38:35 +00:00
Ilya_Shlyakhter
54b82e4fef Added a comment 2021-11-08 16:34:30 +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
054c803f8d
benchmarking of filter-process vs smudge/clean
No firm conclusions yet, but it's doing better than I would have
expected.

Sponsored-by: Graham Spencer on Patreon
2021-11-05 13:37:53 -04:00
Joey Hess
099e8fe061
close 2021-11-05 12:46:56 -04:00
Joey Hess
7551c7ab54
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-05 12:46:14 -04:00
Joey Hess
cdf7639954
update 2021-11-05 11:00:45 -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
afca7d66f6
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-04 15:24:46 -04:00
Joey Hess
b25a138e22
update for git-annex filter-process 2021-11-04 15:15:26 -04:00
Joey Hess
8dd91be867
mention filter-process as v9 material 2021-11-04 15:05:24 -04:00
Joey Hess
d392d8dec8
update with actual command to run 2021-11-04 15:03:51 -04:00
Joey Hess
916c5a7619
Merge branch 'master' into long-running-smudge 2021-11-04 15:03:28 -04:00
Joey Hess
68257e9076
add git-annex filter-process
filter-process: New command that can make git add/checkout faster when
there are a lot of unlocked annexed files or non-annexed files, but that
also makes git add of large annexed files slower.

Use it by running: git
config filter.annex.process 'git-annex filter-process'

Fully tested and working, but I have not benchmarked it at all.
And, incremental hashing is not done when git add uses it, so extra work is
done in that case.

Sponsored-by: Mark Reidenbach on Patreon
2021-11-04 15:02:36 -04:00
CandyAngel
06f7ad2045 removed 2021-11-04 16:06:17 +00:00
CandyAngel
4515eb2a58 Added a comment 2021-11-04 16:04:07 +00:00
Joey Hess
e0b4a66a54
Merge branch 'master' of ssh://git-annex.branchable.com 2021-11-03 16:06:49 -04:00
Joey Hess
efe0554f22
devblog 2021-11-03 16:06:32 -04:00
Joey Hess
bf1408f7bf
long-running-smudge branch started 2021-11-03 15:44:05 -04:00
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