aboutsummaryrefslogtreecommitdiff
path: root/Annex
Commit message (Collapse)AuthorAge
* Better ssh connection warmup when using -J for concurrency.Gravatar Joey Hess2018-03-07
| | | | | | Avoids ugly messages when forced ssh command is not git-annex-shell. This commit was sponsored by Ole-Morten Duesund on Patreon.
* make sure that lockContentShared is always paired with an inAnnex checkGravatar Joey Hess2018-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lockContentShared had a screwy caveat that it didn't verify that the content was present when locking it, but in the most common case, eg indirect mode, it failed to lock when the content is not present. That led to a few callers forgetting to check inAnnex when using it, but the potential data loss was unlikely to be noticed because it only affected direct mode I think. Fix data loss bug when the local repository uses direct mode, and a locally modified file is dropped from a remote repsitory. The bug caused the modified file to be counted as a copy of the original file. (This is not a severe bug because in such a situation, dropping from the remote and then modifying the file is allowed and has the same end result.) And, in content locking over tor, when the remote repository is in direct mode, it neglected to check that the content was actually present when locking it. This could cause git annex drop to remove the only copy of a file when it thought the tor remote had a copy. So, make lockContentShared do its own inAnnex check. This could perhaps be optimised for direct mode, to avoid the check then, since locking the content necessarily verifies it exists there, but I have not bothered with that. This commit was sponsored by Jeff Goeke-Smith on Patreon.
* annex.merge-annex-branchesGravatar Joey Hess2018-02-22
| | | | | | | | | | | | | | Added annex.merge-annex-branches config setting which can be used to disable automatic merge of git-annex branches. I wonder if git-annex merge/sync/assistant should disable this setting? Not sure yet, so have not done so. May be that users will not set it in git config, but pass it via -c to commands that need it. Checking the config setting adds a very small overhead, but it's only checked once per command so should be insignificant. This commit was supported by the NSF-funded DataLad project.
* Remove temporary code added in 6.20160619 to prime the mergedrefs log.Gravatar Joey Hess2018-02-22
| | | | | | Repositories that are upgraded from before that version to this one will not break, but will just not see the benefit of the mergedrefs log speeding things up, until one new ref gets merged in.
* Improve startup time for commands that do not operate on remotesGravatar Joey Hess2018-01-09
| | | | | | | | | | | | | | And for tab completion, by not unnessessarily statting paths to remotes, which used to cause eg, spin-up of removable drives. Got rid of the remotes member of Git.Repo. This was a bit painful. Remote.Git modifies the list of remotes as it reads their configs, so still need a persistent list of remotes. So, put it in as Annex.gitremotes. It's only populated by getGitRemotes, so commands like examinekey that don't care about remotes won't do so. This commit was sponsored by Jake Vosloo on Patreon.
* more core.sharedRepository perm fixesGravatar Joey Hess2018-01-04
| | | | | | | Fix more places where files in .git/annex/ were written with modes that did not take the core.sharedRepository config into account. This commit was sponsored by Jeff Goeke-Smith on Patreon.
* Fix several places where files in .git/annex/ were written with modes that ↵Gravatar Joey Hess2018-01-02
| | | | | | | | | | did not take the core.sharedRepository config into account. git grep writeFile finds some more that might also be problems, but for now I've concentrated on .git/annex/ log files. There are certianly cases where writeFile is not a problem too. This commit was sponsored by mo on Patreon.
* finally really add back custom-setup stanzaGravatar Joey Hess2017-12-31
| | | | | | | | | | | | Fourth or fifth try at this and finally found a way to make it work. Absurd amount of busy-work forced on me by change in cabal's behavior. Split up Utility modules that need posix stuff out of ones used by Setup. Various other hacks around inability for Setup to use anything that ifdefs a use of unix. Probably lost a full day of my life to this. This is how build systems make their users hate them. Just saying.
* addurl: Fix encoding of filename queried from youtube-dl when in --fast mode.Gravatar Joey Hess2017-12-31
| | | | | | | | And also now in non-fast mode, since it was just changed to query for the filename separately. And avoid processTranscript which mixed up stdout and stderr and could have led to weirdness if there were warnings that didn't get suppressed.
* repeated addurl behavior reversion fixGravatar Joey Hess2017-12-31
| | | | | | | | addurl: When the file youtube-dl will download is already an annexed file, don't download it again and fail to overwrite it, instead just do nothing, like it used to when quvi was used. This commit was sponsored by Anthony DeRobertis on Patreon.
* Revert "git-annex.cabal: Add back custom-setup stanza, so cabal new-build ↵Gravatar Joey Hess2017-12-31
| | | | | | | | | | | works." This reverts commit c7c745d28868c8cd646d3e31dd8ba6a0b763f611. No, still doesn't work when built with cabal. It did with stack; stack must somehow make the unix package implicitly available. With cabal, System.Posix.Process and System.Posix.Env are both missing.
* git-annex.cabal: Add back custom-setup stanza, so cabal new-build works.Gravatar Joey Hess2017-12-31
| | | | | | | | Seems I had all the work in past commits to make this build, at least on linux. I'm actually surprised it does, without a unix dep, Utility.Env still builds ok somehow despite using System.Posix.Env. This commit was sponsored by Fernando Jimenez on Patreon.
* remove ifdef for older base than git-annex.cabal allowsGravatar Joey Hess2017-12-14
|
* fold Build/SysConfig.hs into BuildInfo via includeGravatar Joey Hess2017-12-14
| | | | | | | | | | | This avoids warnings from stack about the module not being listed in the cabal file. So, the generated file is also renamed to Build/SysConfig. Note that the setup program seems to be cached despite these changes; I had to cabal clean to get cabal to update it so that Build/SysConfig was written. This commit was sponsored by Jochen Bartl on Patreon.
* reorgGravatar Joey Hess2017-12-14
|
* .noannex fileGravatar Joey Hess2017-12-13
| | | | | | | | | | | | | A top-level .noannex file will prevent git-annex init from being used in a repository. This is useful for repositories that have a policy reason not to use git-annex. The content of the file will be displayed to the user who tries to run git-annex init. This also affects git annex reinit and initialization via the webapp. It does not affect automatic inits, when there's a sibling git-annex branch already. This commit was supported by the NSF-funded DataLad project.
* avoid trying youtube-dl for ftp and file url schemesGravatar Joey Hess2017-12-11
| | | | This commit was sponsored by John Peloquin on Patreon.
* fix regression in addurl --fast caused by youtube-dl supportGravatar Joey Hess2017-12-08
| | | | | | | | | | | | | Similar to 9ec6bdfb526fa6b75a264b6417b24aa7f01adc25 but another code path. As well as using youtube-dl unecessarily, it used the filename it comes up with, which while nice for youtube videos, is not right for other files. This means more work is done for urls that youtube-dl does support, but is probably more efficient for other urls, since it only downloads the first chunk of content, while youtube-dl probably downloads more. This commit was supported by the NSF-funded DataLad project.
* fix regression in addurl --file caused by youtube-dl supportGravatar Joey Hess2017-12-06
| | | | | | | | | | | | | | | | | | Now youtubeDlCheck downloads the beginning of the url's content and checks if it's html, only when it is does it pass it off the youtube-dl to check if it supports it. This means more work is done for urls that youtube-dl does support, but is probably more efficient for other urls, since it only downloads the first chunk of content, while youtube-dl probably downloads more. As well as the reported bug, this also fixes behavior when an url was added with youtube-dl, but the url content has now changed from a html page to something else. Remote.Web.checkKey used to wrongly succeed in that situation, since youtube-dl said sure it can download that something else. This commit was supported by the NSF-funded DataLad project.
* avoid build warning when built w/o dbusGravatar Joey Hess2017-12-06
|
* more lambda-case conversionGravatar Joey Hess2017-12-05
|
* fix windows buildGravatar Joey Hess2017-12-05
|
* honor annex.diskreserve when running youtube-dlGravatar Joey Hess2017-11-30
| | | | This commit was sponsored by André Pereira on Patreon.
* check youtube-dl for --fast and --relaxed when adding new fileGravatar Joey Hess2017-11-30
| | | | | | The filename comes from youtube-dl also. This commit was sponsored by Denis Dzyubenko on Patreon.
* rethought --relaxed changeGravatar Joey Hess2017-11-30
| | | | | | | | | Better to make it not be surprising and slow, than surprising and fast. --raw can be used when it needs to be really fast. Implemented adding a youtube-dl supported url to an existing file. This commit was sponsored by andrea rota.
* avoid warning when youtube-dl is not installedGravatar Joey Hess2017-11-30
| | | | | If a user does not have it installed, don't warn on every imported item about it.
* fix buildGravatar Joey Hess2017-11-30
|
* pass git config options to youtube-dl --simulateGravatar Joey Hess2017-11-29
| | | | | | Decided not to --ignore-config by default. It the user has something in their youtube-dl config files that breaks git-annex they can configure it to use that option.
* convert importfeed to youtube-dlGravatar Joey Hess2017-11-29
| | | | | | | | | | | | | | | | | | | | | | | | Fully working, including --fast/--relaxed. Note that, while git-annex addurl --relaxed is not going to check youtube-dl, I kept git annex importfeed --relaxed checking it. Thinking is that, let's not break people's importfeed cron jobs, and importfeed does not typically have to check a large number of new items, so it's ok if it's a little bit slower when used with youtube playlist feeds. importfeed's behavior is also improved (?) when a feed has links in it to non-media files. Before, those were skipped. Now, the content of the link is downloaded. This had to be done, because trying to use youtube-dl is slow, and if those were skipped, it would have to check every time importfeed was run. While this behavior change may not be desirable for some feeds, that intersperse links to web pages with enclosures, it will be desirable for other feeds, that have non-enclosure directy links to media files. Remove old quvi modules. This commit was sponsored by Øyvind Andersen Holm.
* youtube-dl workingGravatar Joey Hess2017-11-29
| | | | | | | | | Including resuming and cleanup of incomplete downloads. Still todo: --fast, --relaxed, importfeed, disk reserve checking, quvi code cleanup. This commit was sponsored by Anthony DeRobertis on Patreon.
* add gitAnnexTmpWorkDir and withTmpWorkDirGravatar Joey Hess2017-11-29
| | | | | | | | | Needed to run youtube-dl in, but could also be useful for other stuff. The tricky part of this was making the workdir be cleaned up whenever the tmp object file is cleaned up. This commit was sponsored by Ole-Morten Duesund on Patreon.
* generalize notifyTransferGravatar Joey Hess2017-11-28
| | | | support not only AssociatedFile but also URLString
* typoGravatar Joey Hess2017-11-16
|
* enable LambdaCase and convert around 10% of places that could use itGravatar Joey Hess2017-11-15
| | | | | | | | | | | Needs ghc 7.6.1, so minimum base version increased slightly. All builds are well above this version of ghc, and debian oldstable is as well. Code that could use lambdacase can be found by running: git grep -B 1 'case ' | less and searching in less for "<-" This commit was sponsored by andrea rota.
* still can't express custom-setup depsGravatar Joey Hess2017-11-14
| | | | | | | | They need unix on non-windows, for Utility.Env, which Build.Configure uses, but cabal can't express that in a custom-setup stanza. To avoid this problem, Utility.Env would need to be moved into unix-compat..
* split out setEnv to avoid adding depGravatar Joey Hess2017-11-14
| | | | | | | | | | | Windows needs the setenv package in custom-setup, but I don't want to pull it in on unix, which would probably break some builds and need more work. Instead, split out setEnv to a separate module. Quite likely, unix-compat will get a portable environment layer, and then both modules can be removed from here. This commit was sponsored by Øyvind Andersen Holm.
* use unix-compat 0.5 on windowsGravatar Joey Hess2017-11-14
| | | | Re-applying ac57659e61f9743aebd35258e89752ced0040f9f
* Revert "use unix-compat 0.5 on windows"Gravatar Joey Hess2017-11-09
| | | | | | This reverts commit ac57659e61f9743aebd35258e89752ced0040f9f. Too early for this; needs newer Win32 version. Le sigh.
* use unix-compat 0.5 on windowsGravatar Joey Hess2017-11-09
| | | | | | | | | | | That version has my patches for the problems that Utility.PosixFiles was working around, so am able to get rid of that module now. This will later allow bringing back the custom-setup stanza in the cabal file. It will need to depend on unix-compat 0.5 on all OS's, which I'm not ready to do yet. This commit was sponsored by Nick Daly on Patreon.
* Fix exporting of non-annexed files to external special remotes.Gravatar Joey Hess2017-10-30
| | | | | | | | | | | | Actual problem is the keyName was set to "Ref \"sha\"", which led to this follow-on failure since it contained a space. The bad data would also get into the export database when exporting to a non-external special remote. Looking briefly at that, I don't think the bad data will lead to anything more than a re-upload of the file content now that the problem has been fixed. This commit was sponsored by Peter Hogg on Patreon.
* Add day to metadata when annex.genmetadata is enabled.Gravatar Joey Hess2017-10-25
| | | | Thanks, Sean T Parsons
* windows build fixGravatar Joey Hess2017-10-24
|
* better dup key with -J fixGravatar Joey Hess2017-10-17
| | | | | | | | | | | | | | | This avoids all the complication about redundant work discussed in the previous try at fixing this. At the expense of needing each command that could have the problem to be patched to simply wrap the action in onlyActionOn once the key is known. But there do not seem to be many such commands. onlyActionOn' should not be used with a CommandStart (or CommandPerform), although the types do allow it. onlyActionOn handles running the whole CommandStart chain. I couldn't immediately see a way to avoid mistken use of onlyActionOn'. This commit was supported by the NSF-funded DataLad project.
* Improve behavior when -J transfers multiple files that point to the same keyGravatar Joey Hess2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a false start, I found a fairly non-intrusive way to deal with it. Although it only handles transfers -- there may be issues with eg concurrent dropping of the same key, or other operations. There is no added overhead when -J is not used, other than an added inAnnex check. When -J is used, it has to maintain and check a small Set, which should be negligible overhead. It could output some message saying that the transfer is being done by another thread. Or it could even display the same progress info for both files that are being downloaded since they have the same content. But I opted to keep it simple, since this is rather an edge case, so it just doesn't say anything about the transfer of the file until the other thread finishes. Since the deferred transfer action still runs, actions that do more than transfer content will still get a chance to do their other work. (An example of something that needs to do such other work is P2P.Annex, where the download always needs to receive the content from the peer.) And, if the first thread fails to complete a transfer, the second thread can resume it. But, this unfortunately means that there's a risk of redundant work being done to transfer a key that just got transferred. That's not ideal, but should never cause breakage; the same thing can occur when running two separate git-annex processes. The get/move/copy/mirror --from commands had extra inAnnex checks added, inside the download actions. Without those checks, the first thread downloaded the content, and then the second thread woke up and downloaded the same content redundantly. move/copy/mirror --to is left doing redundant uploads for now. It would need a second checkPresent of the remote inside the upload to avoid them, which would be expensive. A better way to avoid redundant work needs to be found.. This commit was supported by the NSF-funded DataLad project.
* add: Replace work tree file atomically.Gravatar Joey Hess2017-10-16
| | | | | | | Before, there was a window where interrupting an add could result in the file being moved into the annex, with no symlink yet created. This commit was supported by the NSF-funded DataLad project.
* fix process and FD leakGravatar Joey Hess2017-09-29
| | | | | | | | | | | | | Fix process and file descriptor leak that was exposed when git-annex was built with ghc 8.2.1. Apparently ghc has changed its behavior of GC of open file handles that are pipes to running processes. That broke git-annex test on OSX due to running out of FDs. Audited for all uses of Annex.new and made stopCoProcesses be called once it's done with the state. Fixed several places that might have leaked in other situations than running the test suite. This commit was sponsored by Ewen McNeill.
* test: Fix reversion that made it only run inside a git repository.Gravatar Joey Hess2017-09-29
| | | | | | | | Using annexeval to run probeCrippledFileSystem' caused Git.CurrentRepo.get to be run. Fixed easily since probeCrippledFileSystem' had no need to use the Annex monad. This commit was sponsored by Ethan Aubin.
* sync: Added --cleanup, which removes local and remote synced/ branches.Gravatar Joey Hess2017-09-28
| | | | | | | Also deletes any tagged pushes that the assistant might have done, since those would also prevent resetting a branch back. This commit was sponsored by andrea rota.
* Warn when metadata is inherited from a previous version of a fileGravatar Joey Hess2017-09-28
| | | | | | to avoid the user being surprised in cases where that behavior is not desired or expected This commit was supported by the NSF-funded DataLad project.
* fix build with old ghcGravatar Joey Hess2017-09-25
|