* [gentoo-commits] portage r12359 - main/trunk/bin
@ 2008-12-28 20:29 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-12-28 20:29 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2008-12-28 20:29:22 +0000 (Sun, 28 Dec 2008)
New Revision: 12359
Modified:
main/trunk/bin/repoman
Log:
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.
Modified: main/trunk/bin/repoman
===================================================================
--- main/trunk/bin/repoman 2008-12-28 01:14:37 UTC (rev 12358)
+++ main/trunk/bin/repoman 2008-12-28 20:29:22 UTC (rev 12359)
@@ -746,11 +746,16 @@
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]
mynew = ["./" + elem[:-1] for elem in mynew]
@@ -1742,15 +1747,21 @@
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]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-12-28 20:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-28 20:29 [gentoo-commits] portage r12359 - main/trunk/bin Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox