aboutsummaryrefslogtreecommitdiff
path: root/Command/Unused.hs
Commit message (Collapse)AuthorAge
* showStart variant for when there's no worktree fileGravatar Joey Hess2017-11-28
| | | | | | | | | | | | Clean up some uses of showStart with "" for the file, or in some cases, a non-filename description string. That would generate bad json, although none of the commands doing that supported --json. Using "" for the file resulted in output like "foo rest"; now the extra space is eliminated. This commit was sponsored by Fernando Jimenez on Patreon.
* unused: When large files are checked right into git, avoid buffering their ↵Gravatar Joey Hess2017-01-31
| | | | | | | | | contents in memory. This makes it a little bit slower since it has to check file size, but worth it to fix a potential memory use problem. This commit was sponsored by Fernando Jimenez on Patreon.
* Some optimisations to string splitting code.Gravatar Joey Hess2017-01-31
| | | | | | | | | | | | | | | | | | | Turns out that Data.List.Utils.split is slow and makes a lot of allocations. Here's a much simpler single character splitter that behaves the same (even in wacky corner cases) while running in half the time and 75% the allocations. As well as being an optimisation, this helps move toward eliminating use of missingh. (Data.List.Split.splitOn is nearly as slow as Data.List.Utils.split and allocates even more.) I have not benchmarked the effect on git-annex, but would not be surprised to see some parsing of eg, large streams from git commands run twice as fast, and possibly in less memory. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
* Avoid backtraces on expected failures when built with ghc 8; only use ↵Gravatar Joey Hess2016-11-15
| | | | | | | | | | | | | backtraces for unexpected errors. ghc 8 added backtraces on uncaught errors. This is great, but git-annex was using error in many places for a error message targeted at the user, in some known problem case. A backtrace only confuses such a message, so omit it. Notably, commands like git annex drop that failed due to eg, numcopies, used to use error, so had a backtrace. This commit was sponsored by Ethan Aubin.
* refactor isBareRepoGravatar Joey Hess2016-06-02
|
* Correct git-annex info to include unlocked files in v6 repository.Gravatar Joey Hess2016-03-14
| | | | | | | | | | | An unlocked present file does not have a pointer file in the worktree, so info skipped counting it. It may be that unused was also affected by the problem, but it seemed not to be in my tests. I think because of the use of the associatedFilesFilter. This fix slows down both info and unused a little bit, since they have to query the contents of files from git, but only when handling unlocked files.
* remove 163 lines of code without changing anything except importsGravatar Joey Hess2016-01-20
|
* unused: deal with v6 unlocked file that is implicitly ingested by git diff etcGravatar Joey Hess2016-01-06
|
* cleanupGravatar Joey Hess2016-01-06
|
* optimiseGravatar Joey Hess2016-01-06
| | | | | | | | | | | | d1ce927d95fe7c331cbff3317797a60aa288738b put a cat-file into the fast bloomfilter generation path. Instead, add another bloom filter which diffs from the work tree to the index. Also, pull the sha of the changed object out of the diffs, and cat that object directly, rather than indirecting through the filename. Finally, removed some hacks that are unncessary thanks to the worktree to index diff.
* fix parsing of v6 unlocked fileGravatar Joey Hess2016-01-06
| | | | The newline broke this ad-hoc parser; use the normal one.
* unused: Bug fix when a new file was added to the annex, and then removed ↵Gravatar Joey Hess2016-01-06
| | | | | | | | (but not git rmed). git still has the add staged in this case, so the content should not be unused and was wrongly treated as such. So, we need to look at both the file on disk to see if it's a annex link, and the file in the index too. lookupFile doesn't look in the index if the file is not present on disk.
* reorgGravatar Joey Hess2015-12-15
|
* Command/Unused.hs: Change --unused-refspec back to --used-refspecGravatar Øyvind A. Holm2015-09-09
| | | | | | Fix typo in commit aa96e9c ("convert Unused, and remove some dead code for old style option parsing", 2015-07-10), the "git-annex unused --used-refspec" option was incorrectly changed to --unused-refspec.
* convert Unused, and remove some dead code for old style option parsingGravatar Joey Hess2015-07-10
|
* convert version command, and make --raw work when not in a git repoGravatar Joey Hess2015-07-10
|
* wipGravatar Joey Hess2015-07-09
| | | | | | | Current status: * building again, but several commands are commented out * still need to implement global options, file matching options, etc
* convert all commands to work with optparse-applicativeGravatar Joey Hess2015-07-08
| | | | Still no options though.
* started converting to use optparse-applicativeGravatar Joey Hess2015-07-08
| | | | | | | | | | | | This is a work in progress. It compiles and is able to do basic command dispatch, including git autocorrection, while using optparse-applicative for the core commandline parsing. * Many commands are temporarily disabled before conversion. * Options are not wired in yet. * cmdnorepo actions don't work yet. Also, removed the [Command] list, which was only used in one place.
* Only look at reflogs for relevant branches, not for git-annex branchesGravatar Joey Hess2015-07-07
| | | | This speeds it up quite a bit.. May still be too slow in large repos.
* update commentGravatar Joey Hess2015-07-07
|
* unused: --used-refspec can now be configured to look at refs in the reflog. ↵Gravatar Joey Hess2015-07-07
| | | | | | This provides a way to not consider old versions of files to be unused after they have reached a specified age, when the old refs in the reflog expire. May be slow.
* instance Hashable Key for bloomfilterGravatar Joey Hess2015-06-16
|
* Increased the default annex.bloomaccuracy from 1000 to 10000000Gravatar Joey Hess2015-06-16
| | | | | | | | | | | | | | | | | | | This makes git annex unused use around 48 mb more memory than it did before, but the massive increase in accuracy makes this worthwhile for all but the smallest systems. Also, I want to use the bloom filter for sync --all --content, to avoid dropping files that the preferred content doesn't want, and 1/1000 false positives would be far too many in that use case, even if it were acceptable for unused. Actual memory use numbers: 1000: 21.06user 3.42system 0:26.40elapsed 92%CPU (0avgtext+0avgdata 501552maxresident)k 1000000: 21.41user 3.55system 0:26.84elapsed 93%CPU (0avgtext+0avgdata 549496maxresident)k 10000000: 21.84user 3.52system 0:27.89elapsed 90%CPU (0avgtext+0avgdata 549920maxresident)k Based on these numbers, 10 million seemed a better pick than 1 million.
* get --incomplete: New option to resume any interrupted downloads.Gravatar Joey Hess2015-06-02
|
* add annex.used-refspecGravatar Joey Hess2015-05-14
|
* unused: Add --used option, which can specify a set of refs to consider used, ↵Gravatar Joey Hess2015-05-14
| | | | rather than the default of considering all refs used.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* doh't use "def" for command definitions, it conflicts with Data.Default.defGravatar Joey Hess2014-10-14
|
* Rather than crashing when there's a problem with the requested bloomfilter ↵Gravatar Joey Hess2014-09-12
| | | | capacity/accuracy, fall back to a reasonable default bloom filter size.
* Support building with bloomfilter 2.0.0.Gravatar Joey Hess2014-07-07
|
* unused: Avoid checking view branches for unused files.Gravatar Joey Hess2014-06-04
| | | | | | | | | | This avoids a potential slowdown when using lots of views. I think that it makes sense for unused to ignore (local) view branches, since these are by definition supposed to be views of an existing branch, so looking at the branch should be sufficient (and if the view is out of date and has files that have since been deleted from the branch, the user's intent is not to preserve those from unused reaping).
* replace (Key, Backend) with KeyGravatar Joey Hess2014-04-17
| | | | | | | | | | Only fsck and reinject and the test suite used the Backend, and they can look it up as needed from the Key. This simplifies the code and also speeds it up. There is a small behavior change here. Before, all commands would warn when acting on an annexed file with an unknown backend. Now, only fsck and reinject show that warning.
* Windows: Fix some filename encoding bugs.Gravatar Joey Hess2014-03-19
| | | | | | http://git-annex.branchable.com/bugs/Unicode_file_names_ignored_on_Windows/ Not a complete fix yet.
* Fix direct mode getKeysPresent false positive & also sped up direct mode ↵Gravatar Joey Hess2014-03-07
| | | | | | | | | unused and unannex unused: In direct mode, files that are deleted from the work tree are no longer incorrectly detected as unused. Direct mode `git annex info` slows down a bit due to more stringent checking, but not by a lot.
* Put non-object tmp files in .git/annex/misctmp, leaving .git/annex/tmp for ↵Gravatar Joey Hess2014-02-26
| | | | | | | | | | | | | | | | | | | | only partially transferred objects. This allows eg, putting .git/annex/tmp on a ram disk, if the disk IO of temp object files is too annoying (and if you don't want to keep partially transferred objects across reboots). .git/annex/misctmp must be on the same filesystem as the git work tree, since files are moved to there in a way that will not work cross-device, as well as symlinked into there. I first wanted to put the tmp objects in .git/annex/objects/tmp, but that would pose transition problems on upgrade when partially transferred objects existed. git annex info does not currently show the size of .git/annex/misctemp, since it should stay small. It would also be ok to make something clean it out, periodically.
* remove Read instance for RefGravatar Joey Hess2014-02-19
| | | | | | | | Removed instance, got it all to build using fromRef. (With a few things that really need to show something using a ref for debugging stubbed out.) Then added back Read instance, and made Logs.View use it for serialization. This changes the view log format.
* reorganize some files and importsGravatar Joey Hess2014-01-26
|
* add timestamps to unused log filesGravatar Joey Hess2014-01-22
| | | | | | | | | | This will be used in expiring old unused objects. The timestamp is when it was first noticed it was unused. Backwards compatability: It supports reading old format unused log files. The old version of git-annex will ignore lines in log files written by the new version, so the worst interop problem would be git annex dropunused not knowing some numbers that git-annex unused reported.
* fix inversion of control in CommandSeek (no behavior changes)Gravatar Joey Hess2014-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been disliking how the command seek actions were written for some time, with their inversion of control and ugly workarounds. The last straw to fix it was sync --content, which didn't fit the Annex [CommandStart] interface well at all. I have not yet made it take advantage of the changed interface though. The crucial change, and probably why I didn't do it this way from the beginning, is to make each CommandStart action be run with exceptions caught, and if it fails, increment a failure counter in annex state. So I finally remove the very first code I wrote for git-annex, which was before I had exception handling in the Annex monad, and so ran outside that monad, passing state explicitly as it ran each CommandStart action. This was a real slog from 1 to 5 am. Test suite passes. Memory usage is lower than before, sometimes by a couple of megabytes, and remains constant, even when running in a large repo, and even when repeatedly failing and incrementing the error counter. So no accidental laziness space leaks. Wall clock speed is identical, even in large repos. This commit was sponsored by an anonymous bitcoiner.
* avoid trying to find minimum element of empty mapGravatar Joey Hess2014-01-18
|
* dropunused, addunused: Allow "all" instead of a range to act on all unused data.Gravatar Joey Hess2013-11-18
|
* update for DiffTree type changeGravatar Joey Hess2013-10-17
| | | | Experimentally, using the raw TopFilePath was right here.
* queue downloads of keys that fsck finds with bad contentGravatar Joey Hess2013-10-10
|
* remove *>=> and >=*> ; use <$$> insteadGravatar Joey Hess2013-09-27
| | | | | | | | I forgot I had <$$> hidden away in Utility.Applicative. It allows doing the same kind of currying as does >=*> and I found using it made the code more readable for me. (*>=> was not used)
* Unused: bugfixGravatar guilhem2013-08-26
| | | | Detect staged files that are not in the working tree.
* fix reversion in unusedGravatar Joey Hess2013-08-26
| | | | | | The reversion was that, if a file was git rm'd, but still in branches, it would not be seen as used. Looking at both the added and the removed (or changed) files from the diff-index is a cheap way to fix that.
* whitespaceGravatar Joey Hess2013-08-25
|
* unnecessary do blockGravatar Joey Hess2013-08-25
|
* Speed up the 'unused' command.Gravatar guilhem2013-08-25
| | | | | | | | | | | Instead of populating the second-level Bloom filter with every key referenced in every Git reference, consider only those which differ from what's referenced in the index. Incidentaly, unlike with its old behavior, staged modifications/deletion/... will now be detected by 'unused'. Credits to joeyh for the algorithm. :-)