function tryCopyFromParents(newLines, annotations) local pat = "^ *([^ ]+) +(%d+) +(%d+)" pid2ann = {} for i=1, #newLines do if annotations[i] ~= nil and annotations[i] ~= '' then local _, _, user, pid, ppid = newLines[i]:find(pat) if pid then pid2ann[pid] = annotations[i] --print("pid2ann", pid, annotations[i]) end end end for i=1, #newLines do if annotations[i] == nil or annotations[i] == '' then local _, _, user, pid, ppid = newLines[i]:find(pat) if ppid then annotations[i] = pid2ann[ppid] end end end end