diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-12 08:01:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-12 08:01:04 +0000 |
commit | 0b2c54b5bdef47a9a6f2dee8654f4984ed8cb874 (patch) | |
tree | 4d5c9bdf8bd0fcb55c2de1025165b6f9d09c38cc /bin/repoman | |
parent | b6df7e70b104c69f844dd5a9e26f4f3e604d1ac4 (diff) | |
download | portage-0b2c54b5bdef47a9a6f2dee8654f4984ed8cb874.tar.gz portage-0b2c54b5bdef47a9a6f2dee8654f4984ed8cb874.tar.bz2 portage-0b2c54b5bdef47a9a6f2dee8654f4984ed8cb874.zip |
Bug #252727 - Use `git diff-index --name-only --diff-filter=M HEAD` instead
of `git ls-files -m --with-tree=HEAD` since the latter doesn't behave
like we want for files that have been added to the index. Also, use `git
diff-index` instead of `git diff` since the latter is considered a high-level
"porcelain" command which means that it's interface may not be reliable.
(trunk r12359)
svn path=/main/branches/2.1.6/; revision=12430
Diffstat (limited to 'bin/repoman')
-rwxr-xr-x | bin/repoman | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/bin/repoman b/bin/repoman index d99be1ab4..8eff9c077 100755 --- a/bin/repoman +++ b/bin/repoman @@ -746,10 +746,15 @@ if vcs == "svn": mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ] mynew = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ] elif vcs == "git": - mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines() - mychanged = [ "./" + elem[:-1] for elem in mychanged ] - mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines() strip_levels = repolevel - 1 + + mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines() + if strip_levels: + mychanged = [elem[repo_subdir_len:] for elem in mychanged \ + if elem[:repo_subdir_len] == repo_subdir] + mychanged = ["./" + elem[:-1] for elem in mychanged] + + mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines() if strip_levels: mynew = [elem[repo_subdir_len:] for elem in mynew \ if elem[:repo_subdir_len] == repo_subdir] @@ -1742,15 +1747,21 @@ else: for prop in props if " - " in prop) elif vcs == "git": - mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines() - mychanged = [ "./" + elem[:-1] for elem in mychanged ] - mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines() strip_levels = repolevel - 1 + + mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines() + if strip_levels: + mychanged = [elem[repo_subdir_len:] for elem in mychanged \ + if elem[:repo_subdir_len] == repo_subdir] + mychanged = ["./" + elem[:-1] for elem in mychanged] + + mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines() if strip_levels: mynew = [elem[repo_subdir_len:] for elem in mynew \ if elem[:repo_subdir_len] == repo_subdir] mynew = ["./" + elem[:-1] for elem in mynew] - myremoved = os.popen("git diff --cached --name-only --diff-filter=D").readlines() + + myremoved = os.popen("git diff-index --name-only --diff-filter=D HEAD").readlines() if strip_levels: myremoved = [elem[repo_subdir_len:] for elem in myremoved \ if elem[:repo_subdir_len] == repo_subdir] |