Пока не знаю буду ли дальше развивать, тему назвал с запасом.
В конце концов каждый может доработать под свои нужды.
Code: Select all
Cache = {}
process = (dir)->
f = io.popen ('git -C "%s" ls-files --others --exclude-standard 2>nul')\format dir\match"^\\\\%?\\(.*)\\$"
output = f\read"*all"
f\close!
if #output>0
data = {}
Cache[dir] = data
for line in output\gmatch"[^\n]+"
if subdir = line\match"^(.-)/"
data[subdir] = data[subdir] or "…"
else
data[line] = "-"
ContentColumns
description:"Git: status [untracked]"
id:"7F04C9E3-3327-4FB4-BCA5-ADCF43B3075D"
GetContentFields:(Names)->
for name in *Names
return true if name=="git"
GetContentData:(FullPath,Names)->
if "\\"==FullPath\sub -1,-1 -- assumption! parent (..) expected *before* all other content
process FullPath
return
for i,name in ipairs Names
if name=="git"
dir,filename = FullPath\match"^(.+\\)(.-)$"
cache = Cache[dir]
return cache and [i]:cache[filename]Code: Select all
Column types
<git>,N
Column widths
1,0- Не дёргать
gitв каждой директории, а проверять наличие служебной поддиректории.git(в текущей и выше). - Кэшировать информацию сразу всего репозитория, чтобы не дёргать
gitв каждой поддиректории. - Не дёргать
gitесли информация уже есть в кэше, и дата изменения прежняя.