You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2014/03/20 20:41:32 UTC
[3/3] git commit: Do a better job of trying to detect if a given
commit has already been committed on the branch
Do a better job of trying to detect if a given commit has already been committed on the branch
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b0e1987c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b0e1987c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b0e1987c
Branch: refs/heads/2.7.x-fixes
Commit: b0e1987c5043c9b6efbe3a4cf7c1d763b1d87181
Parents: b4a8355
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 20 15:40:06 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 20 15:41:01 2014 -0400
----------------------------------------------------------------------
bin/DoMerges.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/b0e1987c/bin/DoMerges.java
----------------------------------------------------------------------
diff --git a/bin/DoMerges.java b/bin/DoMerges.java
index 9109be4..603d3c7 100644
--- a/bin/DoMerges.java
+++ b/bin/DoMerges.java
@@ -580,16 +580,25 @@ public class DoMerges {
private static boolean compareLogs(String[] f, String[] logLines) throws IOException {
ArrayList<String> onBranch = new ArrayList<String>(f.length);
for (String s : f) {
+ if (s.trim().startsWith("Conflicts:")) {
+ break;
+ }
if (s.trim().length() > 0
&& s.charAt(0) == ' '
&& !s.contains("git-svn-id")) {
onBranch.add(s.trim());
}
}
+ List<String> ll = new ArrayList<String>();
for (String s : logLines) {
- onBranch.remove(s.trim());
+ if (s.trim().length() > 0
+ && !onBranch.remove(s.trim())
+ && !s.startsWith("Author: ")
+ && !s.startsWith("Date: ")) {
+ ll.add(s);
+ }
}
- if (onBranch.isEmpty()) {
+ if (ll.isEmpty()) {
//everything in the source log is in a log on this branch, let's prompt to record the merge
System.out.println("Found possible commit already on branch:");
for (String s : f) {