code: func newLogScanner(dir LogDiffDirection, r io.Reader) *logScanner {
  	return &logScanner{
  		s:                   bufio.NewScanner(r),
  		dir:                 dir,
  		pointerData:         &bytes.Buffer{},
  		currentFileIncluded: true,
  
  		// no need to compile these regexes on every `git-lfs` call, just ones that
  		// use the scanner.
  		commitHeaderRegex:    regexp.MustCompile(`^lfs-commit-sha: ([A-Fa-f0-9]{40})(?: ([A-Fa-f0-9]{40}))*`),
  		fileHeaderRegex:      regexp.MustCompile(`diff --git a\/(.+?)\s+b\/(.+)`),
  		fileMergeHeaderRegex: regexp.MustCompile(`diff --cc (.+)`),
  		pointerDataRegex:     regexp.MustCompile(`^([\+\- ])(version https://git-lfs|oid sha256|size|ext-).*$`),
  	}
  }
docs: // dir: whether to include results from + or - diffs
  // r: a stream of output from git log with at least logLfsSearchArgs specified