move `.memoize()` to a method of ExecGitFn
grouping line filtering and trimming into a common type.