tools/git/for-all-touched-files.py
def FilenamesFromGit(branch_name, extensions):
  """Provides a list of all new and modified files listed by [git diff
  branch_name] where branch_name can be blank to get a diff of the
  workspace.

  Excludes deleted files.

  If extensions is not an empty list, include only files with one of
  the extensions on the list.
  """
  lines = GitShell('git diff --stat=600,500 %s' % branch_name)
  filenames = []
  for line in lines:
    line = line.lstrip()
    # Avoid summary line, and files that have been deleted (no plus).
    if line.find('|') != -1 and line.find('+') != -1:
      filename = line.split()[0]
      if filename:
        filename = filename.rstrip()
        ext = filename.rsplit('.')[-1]
        if not extensions or ext in extensions:
          filenames.append(filename)
  return filenames
Provides a list of all new and modified files listed by [git diff
  branch_name] where branch_name can be blank to get a diff of the
  workspace.

  Excludes deleted files.

  If extensions is not an empty list, include only files with one of
  the extensions on the list.
  
Provides a list of all new and modified files listed by [git diff
branch_name] where branch_name can be blank to get a diff of the
workspace.

Excludes deleted files.

If extensions is not an empty list, include only files with one of
the extensions on the list.
Provides a list of all new and modified files listed by [ git diff branch_name ] where branch_name can be blank to get a diff of the workspace . Excludes deleted files . If extensions is not an empty list include only files with one of the extensions on the list .
def FilenamesFromGit(branch_name, extensions):
  lines = GitShell('git diff --stat=600,500 %s' % branch_name)
  filenames = []
  for line in lines:
    line = line.lstrip()
    if line.find('|') != -1 and line.find('+') != -1:
      filename = line.split()[0]
      if filename:
        filename = filename.rstrip()
        ext = filename.rsplit('.')[-1]
        if not extensions or ext in extensions:
          filenames.append(filename)
  return filenames
def FilenamesFromGit ( branch_name , extensions ) : lines = GitShell ( 'git diff --stat=600,500 %s' % branch_name ) filenames = [ ] for line in lines : line = line . lstrip ( ) if line . find ( '|' ) != - 1 and line . find ( '+' ) != - 1 : filename = line . split ( ) [ 0 ] if filename : filename = filename . rstrip ( ) ext = filename . rsplit ( '.' ) [ - 1 ] if not extensions or ext in extensions : filenames . append ( filename ) return filenames
Provides a list of all new and modified files listed by [git diff
branch_name] where branch_name can be blank to get a diff of the
workspace.
Provides a list of all new and modified files listed by [ git diff branch_name ] where branch_name can be blank to get a diff of the workspace .
"""Provides a list of all new and modified files listed by [git diff
  branch_name] where branch_name can be blank to get a diff of the
  workspace.

  Excludes deleted files.

  If extensions is not an empty list, include only files with one of
  the extensions on the list.
  """ # Avoid summary line, and files that have been deleted (no plus).
branch_name
extensions