So I have been coming into this git log error several times now.
I wrote this simple java code to illustrate it. I commit my progress (writing it gradually) and then run git log -p --decorate
class Mega {
private int alpha = 0;
private int beta = 1;
private int omega = 5;
public returnAlpha(){
return this.alpha;
}
public returnBeta(){
return this.beta;
}
public returnOmega(){
return this.omega;
}
}
This is the git log:
commit 2dcc5243a943a7e1a3344479bfb6a21474c6c024 (HEAD, master)
Date: Sat Mar 23 17:26:24 2013 -0700
stage 2
diff --git a/untitled.java b/untitled.java
index 821a19e..b2ba345 100644
--- a/untitled.java
+++ b/untitled.java
**@@ -10,4 +10,8 @@ class Mega {**
public returnBeta(){
return this.beta;
}
+
+ public returnOmega(){
+ return this.omega;
+ }
}
\ No newline at end of file
commit 43fadfc5ec827cf24667494e350ca9bcda21ffd3
Date: Sat Mar 23 17:26:01 2013 -0700
stage 2
diff --git a/untitled.java b/untitled.java
index e5c38d9..821a19e 100644
--- a/untitled.java
+++ b/untitled.java
**@@ -6,4 +6,8 @@ class Mega {**
public returnAlpha(){
return this.alpha;
}
+
+ public returnBeta(){
+ return this.beta;
+ }
}
\ No newline at end of file
commit 46d27d8485cb296798e5490803b1b7a04313793f
Date: Sat Mar 23 17:25:24 2013 -0700
stage 1
diff --git a/untitled.java b/untitled.java
index 332a406..e5c38d9 100644
--- a/untitled.java
+++ b/untitled.java
@@ -1,5 +1,9 @@
class Mega {
- int alpha = 0;
- int beta = 1;
- int omega = 5;
+ private int alpha = 0;
+ private int beta = 1;
+ private int omega = 5;
+
+ public returnAlpha(){
+ return this.alpha;
+ }
}
\ No newline at end of file
commit bb18a576d44b492e50906d3eac495956590ff263
Date: Sat Mar 23 17:24:22 2013 -0700
stage 0
diff --git a/untitled.java b/untitled.java
index e69de29..332a406 100644
--- a/untitled.java
+++ b/untitled.java
@@ -0,0 +1,5 @@
+class Mega {
+ int alpha = 0;
+ int beta = 1;
+ int omega = 5;
+}
\ No newline at end of file
commit d630ed1f1edff608488938ec3ea748a2d5a7bab1
Date: Sat Mar 23 17:23:39 2013 -0700
java added
diff --git a/untitled.java b/untitled.java
new file mode 100644
index 0000000..e69de29
I need to fix this log mistake because I am automatically (with a script) parsing the log and I need it to remain consistent.
Furthermore as the amount of commits increases there are other inconsistencies such as random spaces and sometimes the line after the @ is actually part of the diff (unlike the cases of this example).