more thoughts
This commit is contained in:
parent
558520d27a
commit
fc7fe2b19d
2 changed files with 44 additions and 11 deletions
|
@ -0,0 +1,32 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 3"""
|
||||
date="2018-10-17T15:50:46Z"
|
||||
content="""
|
||||
This will need some state maintained, to allow efficiently querying for
|
||||
worktree files that have gained/lost content since the last sync.
|
||||
|
||||
At least need to maintain a map of all keys that were gained/lost since
|
||||
last time.
|
||||
|
||||
It would be easy to loop through `git ls-tree` of the master branch,
|
||||
look up all the keys with `git cat-file`, and find in the map.
|
||||
But slow...
|
||||
|
||||
Better would be to maintain an additional map from filename to key.
|
||||
|
||||
The keys database already maintains a map from key to worktree file
|
||||
(and back), but only in v6 mode, and only for unlocked files.
|
||||
Not useful for this.
|
||||
|
||||
This would need anything that changes annex pointers
|
||||
(fix/unlock/lock/pre-commit) to update the map. Would also need to make
|
||||
sure that it gets updated with any changes to the checked out branch
|
||||
made by git commit or git-annex sync. Doable, but complicated.
|
||||
|
||||
Or, the map could be of the sha1s of the annex pointers, then loop
|
||||
through `git ls-files --stage` and look up the sha1s in the map
|
||||
would not be too slow. On my laptop, with 85000 files in the tree,
|
||||
that command takes 0.13s. Still needs to update the map whenever
|
||||
annex pointers are changed though.
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue