Re: [PATCH 0/3] Teach Git about the patience diff algorithm
- From
Clemens Buchacher <drizzd@aon.at>
- Date
- Jan 2, 2009, 10:58 UTC
- Message-ID
- <20090102105856.GB14691@localhost>
- In-Reply-To
- <20090102105537.GA14691@localhost>
Only two choices, and I still get it wrong. The diffs should be labeled the other way around, of course.
*** git diff --patience ******************** git diff ********************
#include <stdio.h> | #include <stdio.h>
|
+int fib(int n) |-// Frobs foo heartily
+{ |-int frobnitz(int foo)
+ if(n > 2) |+int fib(int n)
+ { | {
+ return fib(n-1) + fib(n-2); |- int i;
+ } |- for(i = 0; i < 10; i++)
+ return 1; |+ if(n > 2)
+} | {
+ |- printf("Your answer is: ");
// Frobs foo heartily |- printf("%d\n", foo);
int frobnitz(int foo) |+ return fib(n-1) + fib(n-2);
{ | }
int i; |+ return 1;
for(i = 0; i < 10; i++) | }
{ |
- printf("Your answer is: "); |-int fact(int n)
printf("%d\n", foo); |+// Frobs foo heartily
} |+int frobnitz(int foo)
} | {
|- if(n > 1)
-int fact(int n) |+ int i;
-{ |+ for(i = 0; i < 10; i++)
- if(n > 1) | {
- { |- return fact(n-1) * n;
- return fact(n-1) * n; |+ printf("%d\n", foo);
- } | }
- return 1; |- return 1;
-} | }
- |
int main(int argc, char **argv) | int main(int argc, char **argv)
{ | {
- frobnitz(fact(10)); |- frobnitz(fact(10));
+ frobnitz(fib(10)); |+ frobnitz(fib(10));
} | }