From abd56fb019283e54370f001732646b267c736fc4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Jul 2020 19:39:05 -0400 Subject: [PATCH] Fix a bug in find --batch in the previous version. --- CHANGELOG | 6 ++++++ Command/Find.hs | 4 +++- .../find_--batch_reports_files_that_have_no_content.mdwn | 5 +++++ .../precache_logs_for_speed_with_cat-file_--buffer.mdwn | 6 +++++- git-annex.cabal | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9f75557995..6b32db0c4c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +git-annex (8.20200720.1) UNRELEASED; urgency=medium + + * Fix a bug in find --batch in the previous version. + + -- Joey Hess Mon, 20 Jul 2020 19:37:40 -0400 + git-annex (8.20200720) upstream; urgency=medium * import: Added --no-content option, which avoids downloading files diff --git a/Command/Find.hs b/Command/Find.hs index 9c1f336283..337ad110fd 100644 --- a/Command/Find.hs +++ b/Command/Find.hs @@ -18,6 +18,7 @@ import Types.Key import Git.FilePath import qualified Utility.Format import Utility.DataUnits +import Annex.Content cmd :: Command cmd = notBareRepo $ withGlobalOptions [annexedMatchingOptions] $ mkCommand $ @@ -70,9 +71,10 @@ seek o = case batchOption o of (withFilesInGitAnnex ww seeker) =<< workTreeItems ww (findThese o) Batch fmt -> batchFilesMatching fmt - (whenAnnexed go . toRawFilePath) + (whenAnnexed gobatch . toRawFilePath) where go = start o + gobatch f k = stopUnless (limited <||> inAnnex k) (go f k) ww = WarnUnmatchLsFiles start :: FindOptions -> RawFilePath -> Key -> CommandStart diff --git a/doc/bugs/find_--batch_reports_files_that_have_no_content.mdwn b/doc/bugs/find_--batch_reports_files_that_have_no_content.mdwn index 8c481401a0..8a56afc0d0 100644 --- a/doc/bugs/find_--batch_reports_files_that_have_no_content.mdwn +++ b/doc/bugs/find_--batch_reports_files_that_have_no_content.mdwn @@ -61,3 +61,8 @@ local repository version: 8 [[!meta author=kyle]] [[!tag projects/datalad]] + +> [[fixed|done]], and audited for any other similar reversions. +> +> Unfortunately did not see this bug before the release, +> so I should make a point release for it. --[[Joey]] diff --git a/doc/todo/precache_logs_for_speed_with_cat-file_--buffer.mdwn b/doc/todo/precache_logs_for_speed_with_cat-file_--buffer.mdwn index 0bae6e00bd..264617877e 100644 --- a/doc/todo/precache_logs_for_speed_with_cat-file_--buffer.mdwn +++ b/doc/todo/precache_logs_for_speed_with_cat-file_--buffer.mdwn @@ -37,8 +37,12 @@ and precache them. > > > Still todo: > > > > > > * move, copy, drop, and mirror were left not using the location log caching yet +> > > * find has a bit of ugliness around batch mode, and this shows it +> > > would be worth making the batch mode take the same AnnexedFileSeeker, +> > > to reunify the batch and non-batch code > > > * get is left with an unncessary inAnnex check so could be sped up -> > > a little bit more +> > > a little bit more. Above improvements to batch mode would allow +> > > fixing this. > > > Another thing that the same cat-file --buffer approach could be used with diff --git a/git-annex.cabal b/git-annex.cabal index 6218627808..e679a347b9 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 8.20200720 +Version: 8.20200720.1 Cabal-Version: >= 1.10 License: AGPL-3 Maintainer: Joey Hess