From e64e9d5faea858ae9c8c5e374a900bd2a658ebd3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 May 2025 14:31:47 -0400 Subject: [PATCH] whereused: Fix bug that could find matches from grafts in remote git-annex branches git log with --remotes= needs the preceeding --exclude=*/git-annex in order to not look at git-annex branches of remotes. Sponsored-by: mycroft --- CHANGELOG | 2 ++ Command/WhereUsed.hs | 2 +- ..._b574973835ee61fa8711831e38b77ad2._comment | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/whereused_--key_forcing_--historical._exportree__63__/comment_2_b574973835ee61fa8711831e38b77ad2._comment diff --git a/CHANGELOG b/CHANGELOG index f0eeb7b610..f96e750319 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ git-annex (10.20250417) UNRELEASED; urgency=medium accessed via ssh. * map: Avoid looping forever with mutually recursive paths between repositories accessed via ssh. + * whereused: Fix bug that could find matches from grafts + in remote git-annex branches. -- Joey Hess Tue, 22 Apr 2025 14:33:26 -0400 diff --git a/Command/WhereUsed.hs b/Command/WhereUsed.hs index 1a7e7033d8..28ae74585b 100644 --- a/Command/WhereUsed.hs +++ b/Command/WhereUsed.hs @@ -89,7 +89,7 @@ findHistorical key = do [ Param ("--exclude=*/" ++ fromRef (Annex.Branch.name)) , Param "--glob=*" -- Also search remote branches - , Param ("--exclude=" ++ fromRef (Annex.Branch.name)) + , Param ("--exclude=*/" ++ fromRef (Annex.Branch.name)) , Param "--remotes=*" -- And search tags. , Param "--tags=*" diff --git a/doc/bugs/whereused_--key_forcing_--historical._exportree__63__/comment_2_b574973835ee61fa8711831e38b77ad2._comment b/doc/bugs/whereused_--key_forcing_--historical._exportree__63__/comment_2_b574973835ee61fa8711831e38b77ad2._comment new file mode 100644 index 0000000000..4a2fb4ff32 --- /dev/null +++ b/doc/bugs/whereused_--key_forcing_--historical._exportree__63__/comment_2_b574973835ee61fa8711831e38b77ad2._comment @@ -0,0 +1,27 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2025-05-05T18:12:16Z" + content=""" +I was able to reproduce the "origin/git-annex~12:export.tree" part of this +and have fixed that, so it won't show that git-annex branch location, +which is part of git-annex's internal bookkeeping and not something useful +for the command to display. + +As to why it is not finding your file, what you show is not necessarily a +bug. If the file `2010-08-21/042.JPG` is not staged in git, it won't be +shown by `git-annex whereused` when run without --historical. It's easy +enough to get into such a situation, for example you could have run a +series of commands like this: + + git-annex add 042.JPG + mv 042.JPG 2010-08-21/042.JPG + git commit -a -m foo + +If the file is in fact staged in git and whereused doesn't list it, +my next guess would be that somehow it's not getting added to the +associated files database, which is what whereused looks at. +You can check for that with this command: + + sqlite3 .git/annex/keysdb/db 'select * from associated;'| grep SHA256E-s1000013--e435522a9059bcb086b6db5fa5f05a06913266772a7931eefae2b8f7647f5f14.JPG +"""]]