whereused --historical
Does not check the reflog, but otherwise works. It's possible for it to display something that is not an annexed file, if a non-annexed file somehow ends up containing something that looks like the key's name. This seems very unlikely to happen, and it would add a lot of complexity to detect it and somehow skip over that file, since the git log would need to either be run again, or not limited to 1 result and canceled once enough results have been read. Also, it kind of seems ok, if a file refers to a key, to consider that as a place the key was used, for some definition of used. So, I punted on dealing with that. May revisit later. Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
parent
47d3dccf19
commit
fcd1b93a7d
2 changed files with 73 additions and 4 deletions
|
@ -15,6 +15,7 @@ module Git.DiffTree (
|
|||
diffFiles,
|
||||
diffLog,
|
||||
commitDiff,
|
||||
parseDiffRaw,
|
||||
) where
|
||||
|
||||
import qualified Data.ByteString as B
|
||||
|
@ -116,9 +117,13 @@ parseDiffRaw l = go l
|
|||
go (s:[]) = error $ "diff-tree parse error near \"" ++ decodeBL' s ++ "\""
|
||||
|
||||
-- :<srcmode> SP <dstmode> SP <srcsha> SP <dstsha> SP <status>
|
||||
--
|
||||
-- May be prefixed with a newline, which git log --pretty=format
|
||||
-- adds to the first line of the diff, even with -z.
|
||||
parserDiffRaw :: RawFilePath -> A.Parser DiffTreeItem
|
||||
parserDiffRaw f = DiffTreeItem
|
||||
<$ A8.char ':'
|
||||
<$ A.option '\n' (A8.char '\n')
|
||||
<* A8.char ':'
|
||||
<*> octal
|
||||
<* A8.char ' '
|
||||
<*> octal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue