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/a53094c1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a53094c1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a53094c1 Branch: refs/heads/2.6.x-fixes Commit: a53094c161ecddf4486a266779069442e337f9e5 Parents: 3dd82ca Author: Daniel Kulp <[email protected]> Authored: Thu Mar 20 15:40:06 2014 -0400 Committer: Daniel Kulp <[email protected]> Committed: Thu Mar 20 16:46:17 2014 -0400 ---------------------------------------------------------------------- bin/DoMerges.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a53094c1/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) {
