Created
November 4, 2012 03:06
-
-
Save narusemotoki/4009939 to your computer and use it in GitHub Desktop.
Gitでコンフリクトしたファイルのファイル名のみを出力します
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import popen2 | |
import re | |
def extractBothModifiedFileName(): | |
r, w, e = popen2.popen3('git status') | |
for line in r: | |
if not line.find('both modified:') is -1: | |
yield re.split('[\t ]*', line.strip())[-1] | |
r.close() | |
w.close() | |
e.close() | |
if __name__ == '__main__': | |
print(' '.join(extractBothModifiedFileName())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment