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)]
DavidD [Thu, 20 Apr 2023 15:37:46 +0000 (15:37 +0000)]
Joey Hess [Wed, 19 Apr 2023 16:53:58 +0000 (12:53 -0400)]
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
Joey Hess [Wed, 19 Apr 2023 16:43:30 +0000 (12:43 -0400)]
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
Joey Hess [Wed, 19 Apr 2023 16:42:02 +0000 (12:42 -0400)]
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
Joey Hess [Wed, 19 Apr 2023 16:26:20 +0000 (12:26 -0400)]
response
Joey Hess [Wed, 19 Apr 2023 16:20:26 +0000 (12:20 -0400)]
comment and improve docs
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3 [Wed, 19 Apr 2023 08:40:41 +0000 (08:40 +0000)]
Added a comment: Sync to remote master?
Joey Hess [Tue, 18 Apr 2023 19:30:49 +0000 (15:30 -0400)]
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
Joey Hess [Tue, 18 Apr 2023 18:00:02 +0000 (14:00 -0400)]
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
Joey Hess [Tue, 18 Apr 2023 17:09:24 +0000 (13:09 -0400)]
comment
nobodyinperson [Tue, 18 Apr 2023 07:55:46 +0000 (07:55 +0000)]
mih [Tue, 18 Apr 2023 07:54:46 +0000 (07:54 +0000)]
Added a comment: Confirm
Joey Hess [Mon, 17 Apr 2023 18:09:06 +0000 (14:09 -0400)]
comment
Joey Hess [Mon, 17 Apr 2023 18:03:02 +0000 (14:03 -0400)]
response
Joey Hess [Mon, 17 Apr 2023 17:48:23 +0000 (13:48 -0400)]
comment
Joey Hess [Mon, 17 Apr 2023 17:39:34 +0000 (13:39 -0400)]
response
Joey Hess [Mon, 17 Apr 2023 17:35:23 +0000 (13:35 -0400)]
already fixed
Joey Hess [Mon, 17 Apr 2023 17:32:50 +0000 (13:32 -0400)]
response
DavidD [Mon, 17 Apr 2023 15:27:49 +0000 (15:27 +0000)]
Added a comment
yarikoptic [Mon, 17 Apr 2023 13:01:03 +0000 (13:01 +0000)]
Added a comment
dud225@35a1ee469f82f3a7eb1f2dce4ad453f5e47bdfd3 [Mon, 17 Apr 2023 10:12:58 +0000 (10:12 +0000)]
Added a comment: Groups comprised of archive drives of various size
nobodyinperson [Mon, 17 Apr 2023 01:43:36 +0000 (01:43 +0000)]
Added a comment: Too old?
adpce [Sun, 16 Apr 2023 19:58:22 +0000 (19:58 +0000)]
git annex forget bug
nobodyinperson [Sun, 16 Apr 2023 17:49:51 +0000 (17:49 +0000)]
Added a comment
DavidD [Sat, 15 Apr 2023 22:16:11 +0000 (22:16 +0000)]
Added a comment
mih [Fri, 14 Apr 2023 06:55:18 +0000 (06:55 +0000)]
Initial report
Joey Hess [Wed, 12 Apr 2023 23:33:19 +0000 (19:33 -0400)]
fix windows build
Joey Hess [Wed, 12 Apr 2023 23:19:22 +0000 (19:19 -0400)]
add ScopedTypeVariables
Joey Hess [Wed, 12 Apr 2023 21:18:29 +0000 (17:18 -0400)]
rename Git.Filename to Git.Quote
Joey Hess [Wed, 12 Apr 2023 21:18:05 +0000 (17:18 -0400)]
close ancient moreinfo bug
Joey Hess [Wed, 12 Apr 2023 21:04:57 +0000 (17:04 -0400)]
avoid displaying ExitCode exceptions
Don't need to be sanitized and displaying them messes up actually
exiting with the right exit code! And broke the test suite.
Sponsored-by: Brett Eisenberg on Patreon
Joey Hess [Wed, 12 Apr 2023 20:48:18 +0000 (16:48 -0400)]
remove unused imports
Joey Hess [Wed, 12 Apr 2023 19:18:04 +0000 (15:18 -0400)]
whereused: Fix display of branch:file when run in a subdirectory
The file needs to be relative to the top of the repository
in that case, but it was relative to the subdir.
Sponsored-by: Luke Shumaker on Patreon
Joey Hess [Wed, 12 Apr 2023 19:11:44 +0000 (15:11 -0400)]
improve display of relative path to file
When in a subdirectory, and the file is too, it used to display eg
../subdir/thefile and now will display thefile.
Joey Hess [Wed, 12 Apr 2023 19:03:01 +0000 (15:03 -0400)]
devblog
Joey Hess [Wed, 12 Apr 2023 18:31:56 +0000 (14:31 -0400)]
fix build
Joey Hess [Wed, 12 Apr 2023 18:21:53 +0000 (14:21 -0400)]
sanitize control characters in main thread fatal exceptions
Sponsored-by: Noam Kremen on Patreon
Joey Hess [Wed, 12 Apr 2023 18:18:29 +0000 (14:18 -0400)]
fix build
Joey Hess [Wed, 12 Apr 2023 18:03:44 +0000 (14:03 -0400)]
safe output to terminal for calckey inprogress and lookupkey
These are quite low-level, but still there is no point in displaying
escape sequences that have been embedded in a key to the terminal.
I think these are the only remaining commands that didn't use safe
output, except for cases where git-annex is speaking a protocol to
itself.
Sponsored-by: Kevin Mueller on Patreon
Joey Hess [Wed, 12 Apr 2023 17:48:21 +0000 (13:48 -0400)]
fix mojibake reversion in display of utf8
When displaying a ByteString like "💕", safeOutput operates on
individual bytes like "\240\159\146\149" and isControl '\146' = True,
so it got truncated to just "\240".
So, only treat the low control characters, and DEL, as control
characters.
Also split Utility.Terminal out of Utility.SafeOutput. The latter needs
win32, but Utility.SafeOutput is used by Control.Exception, which is
used by Setup.
Sponsored-by: Nicholas Golder-Manning on Patreon
Joey Hess [Wed, 12 Apr 2023 16:33:17 +0000 (12:33 -0400)]
init: Avoid autoenabling special remotes that have control characters in their names
I'm on the fence about this. Notice that pulling from a git remote can
pull branches that have escape sequences in their names. Git will
display those as-is. Arguably git should try harder to avoid that.
But, names of remotes are usually up to the local user, and autoenable
changes that, and so it makes sense that git chooses to display control
characters in names of remotes, and so autoenable needs to guard against
it.
Sponsored-by: Graham Spencer on Patreon
Joey Hess [Wed, 12 Apr 2023 16:31:16 +0000 (12:31 -0400)]
allow tab in controlCharacterInFilePath
Seems unlikely to have a tab in a path, but it's not a control character
that needs to be prevented either.
Left \n \r \v and \a as other non-threatening control characters
that are still obnoxious to have in a filepath because of how it causes
issues with display and/or with shell scripting.
Joey Hess [Wed, 12 Apr 2023 16:29:56 +0000 (12:29 -0400)]
fix reversion in warning newline
indent removes any trailing newline, so put the trailing newline after
calling indent.
Sponsored-by: unqueued on Patreon
Joey Hess [Tue, 11 Apr 2023 20:31:42 +0000 (16:31 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 11 Apr 2023 20:31:31 +0000 (16:31 -0400)]
update
Joey Hess [Tue, 11 Apr 2023 19:38:47 +0000 (15:38 -0400)]
newline and tab are safe control characters
Oops, let's let git-annex display those! Lol
Joey Hess [Tue, 11 Apr 2023 19:29:04 +0000 (15:29 -0400)]
IsString StringContainingQuotedPath optimisation
This causes an encodeBS thunk, and the first evaluation of the string
forces it. From then on, further uses operate on a ByteString. This
avoids converting repeatedly.
Joey Hess [Tue, 11 Apr 2023 18:57:09 +0000 (14:57 -0400)]
find, findkeys, examinekey: escape output to terminal when --format is not used
Note that filenames are not quoted, only escaped. This is to match the
output of --format with escaping.
Sponsored-by: Lawrence Brogan on Patreon
Joey Hess [Tue, 11 Apr 2023 18:27:22 +0000 (14:27 -0400)]
filter out control characters and quote filenames
Searched for uses of putStr and hPutStr and changed appropriate ones to filter
out control characters and quote filenames.
This notably does not make find and findkeys quote filenames in their default
output. Because they should only do that when stdout is non a pipe.
A few commands like calckey and lookupkey seem too low-level to make sense to filter
output, so skipped those.
Also when relaying output from other commands that is not progress output,
have git-annex filter out control characters.
Sponsored-by: k0ld on Patreon
xloem [Tue, 11 Apr 2023 18:07:04 +0000 (18:07 +0000)]
Added a comment
Joey Hess [Tue, 11 Apr 2023 18:06:46 +0000 (14:06 -0400)]
mention control characters
xloem [Tue, 11 Apr 2023 18:03:26 +0000 (18:03 +0000)]
Added a comment
Joey Hess [Tue, 11 Apr 2023 17:18:31 +0000 (13:18 -0400)]
clean up cabal.project.local~*
Make whenever cabal configure is run with new cabal, and I don't need
100 copies of that to be backed up.
Joey Hess [Mon, 10 Apr 2023 21:03:41 +0000 (17:03 -0400)]
filter out control characters in all other Messages
This does, as a side effect, make long notes in json output not
be indented. The indentation is only needed to offset them
underneath the display of the file they apply to, so that's ok.
Sponsored-by: Brock Spratlen on Patreon
Joey Hess [Mon, 10 Apr 2023 20:07:54 +0000 (16:07 -0400)]
eliminate showStart showStartOther
These were not handling control characters and are redundant.
Sponsored-by: Jack Hill on Patreon
Joey Hess [Mon, 10 Apr 2023 18:47:32 +0000 (14:47 -0400)]
filter out control characters in warning messages
Converted warning and similar to use StringContainingQuotedPath. Most
warnings are static strings, some do refer to filepaths that need to be
quoted, and others don't need quoting.
Note that, since quote filters out control characters of even
UnquotedString, this makes all warnings safe, even when an attacker
sneaks in a control character in some other way.
When json is being output, no quoting is done, since json gets its own
quoting.
This does, as a side effect, make warning messages in json output not
be indented. The indentation is only needed to offset warning messages
underneath the display of the file they apply to, so that's ok.
Sponsored-by: Brett Eisenberg on Patreon
Joey Hess [Mon, 10 Apr 2023 18:43:17 +0000 (14:43 -0400)]
use safeOutput when quoting UnquotedString
UnquotedString does not need to be quoted, but still it's possible
it contains something attacker-controlled, which could have an
escape sequence or control character in it. This is a convenient
place to filter out such things, since quoting alrready handles
those in filenames.
Sponsored-by: Luke Shumaker on Patreon