def files_changed ( ) : with chdir ( get_root ( ) ) : result = run_command ( 'git diff --name-only master...' , capture = 'out' ) changed_files = result . stdout . splitlines ( ) # Remove empty lines return [ f for f in changed_files if f ]
get a list of all files changed by git in python
Return the list of file changed in the current branch compared to master
def files_changed():
    """
    Return the list of file changed in the current branch compared to `master`
    """
    with chdir(get_root()):
        result = run_command('git diff --name-only master...', capture='out')
    changed_files = result.stdout.splitlines()

    # Remove empty lines
    return [f for f in changed_files if f]