diff --git a/git-restore-mtime b/git-restore-mtime index fbc05d9..7bbd375 100755 --- a/git-restore-mtime +++ b/git-restore-mtime @@ -74,6 +74,14 @@ parser.add_argument('--merge', '-m', 'sometimes substantially. By default merge logs are only ' 'used for files missing from regular commit logs.') +parser.add_argument('--first-parent', + action="store_true", + help='pass --first-parent to git whatchanged to hide the ' + 'second parent from the merge commit logs. Only has any ' + 'effect if --merge is also specified or --skip-missing ' + 'is not specified and there were files not found in regular ' + 'commit logs.') + parser.add_argument('--skip-missing', '-s', action="store_false", default=True, dest='missing', help='do not try to find missing files. If some files were ' @@ -252,6 +260,7 @@ def parselog(merge=False, filterlist=[]): gitobj = subprocess.Popen(gitcmd + shlex.split('whatchanged --pretty={}'.format(args.timeformat)) + (['-m'] if merge else []) + + (['--first-parent'] if args.first_parent else []) + ['--'] + filterlist, stdout=subprocess.PIPE) for line in gitobj.stdout: