The difference between the original commit and the cherry-picked commit including the conflict resolution can be displayed with:
commit=7b8e5c99a4a40ae788ad29e36b0d714f529b12eb
picked_from=$(git show --no-patch --pretty=%b $commit |
perl -ne 'print if(s/.*cherry picked from commit (\w+).*/$1/)')
diff -u --ignore-matching-lines '^[^+-]' \
<(git show $picked_from) <(git show $commit)
The SHA of the original commit is extracted from the cherry picked commit message. The diff compares the lines removed and lines added (i.e. only those starting with + or -). It gets rid of the noise introduced by the hunks boundaries starting with @@ or the commit message body that are not significant. It will display something like:
--- /dev/fd/63 2015-02-13 13:27:08.612683558 +0100
+++ /dev/fd/62 2015-02-13 13:27:08.616683527 +0100
@@ -62,13 +57,24 @@
}
diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h
-index 0113662..282cbeb 100644
+index 3b2e6e6..0a633a5 100644
--- a/src/crush/CrushWrapper.h
+++ b/src/crush/CrushWrapper.h
-@@ -874,6 +874,25 @@ public:
- return false;
+@@ -863,6 +863,36 @@ public:
+ if (!crush) return -1;
+ return crush_find_rule(crush, ruleset, type, size);
}
-
++
++ bool ruleset_exists(int const ruleset) const {
++ for (size_t i = 0; i < crush->max_rules; ++i) {
++ if (crush->rules[i]->mask.ruleset == ruleset) {
++ return true;
++ }
++ }
++
++ return false;
++ }
++
+ /**
+ * Return the lowest numbered ruleset of type `type`
+ *