Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

EOL stuff #21

Merged
merged 2 commits into from

2 participants

@davidanthoff

This does two things:

  • It adds .gitattributes so that text files are always stored LF in the rep, regardless of user settings
  • It fixes five files that had bin stored CRLF by previous commits in the rep

Hope this addresses #20.

davidanthoff added some commits
@davidanthoff davidanthoff Add .gitattributes file to handle eol conversions 74744dc
@davidanthoff davidanthoff Convert eof of 5 *.cs files from CRLF to LF in rep
Generally all text files in the repo are normalized to LF line ending. The
five files in this commit had CRLF in the repo, which they should not.
This must have happened when someone commited them with autocrlf=false
while .gitattributes was not yet present. This commit only fixes the eof
of these five files in the repo, so that from now on all files in the repo
have LF line ending again.
bbe9bfc
@Haacked Haacked merged commit b545374 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2012
  1. @davidanthoff
  2. @davidanthoff

    Convert eof of 5 *.cs files from CRLF to LF in rep

    davidanthoff authored
    Generally all text files in the repo are normalized to LF line ending. The
    five files in this commit had CRLF in the repo, which they should not.
    This must have happened when someone commited them with autocrlf=false
    while .gitattributes was not yet present. This commit only fixes the eof
    of these five files in the repo, so that from now on all files in the repo
    have LF line ending again.
This page is out of date. Refresh to see the latest.
View
20 .gitattributes
@@ -0,0 +1,20 @@
+* text=auto
+
+# These files are text and should be normalized (convert crlf => lf)
+*.cs text diff=csharp
+*.xaml text
+*.csproj text
+*.sln text
+*.tt text
+*.ps1 text
+*.cmd text
+*.msbuild text
+*.md text
+*.txt text
+*.xml text
+
+# Images should be treated as binary
+# (binary is a macro for -text -diff)
+*.png binary
+*.jepg binary
+*.dll binary
View
136 SeeGitApp/Models/CommitEdge.cs
@@ -1,73 +1,73 @@
-using System;
-using System.Diagnostics;
-using QuickGraph;
-
-namespace SeeGit
-{
- [DebuggerDisplay("{Source.Sha}..{Target.Sha}")]
- public class CommitEdge : Edge<CommitVertex>, IEquatable<CommitEdge>
- {
- private string _id;
-
- public CommitEdge(CommitVertex child, CommitVertex parent)
- : base(child, parent)
- {
- }
-
- public string Id
- {
- get
- {
- if(_id == null)
- {
- if(Source != null)
- {
- _id = Source.Sha;
- }
- _id += "..";
- if(Target != null)
- {
- _id += Target.Sha;
- }
- }
- return _id;
- }
- }
-
- public override bool Equals(object obj)
- {
- return this.Equals(obj as CommitEdge);
- }
-
- public bool Equals(CommitEdge other)
- {
- if(ReferenceEquals(null, other))
- return false;
- if(ReferenceEquals(this, other))
- return true;
- return Source == other.Source && Target == other.Target;
- }
-
- public override int GetHashCode()
- {
- unchecked
- {
- int result = (Target != null ? Target.GetHashCode() : 0);
- result = (result * 397) ^ (Source != null ? Source.GetHashCode() : 0);
- return result;
- }
- }
-
+using System;
+using System.Diagnostics;
+using QuickGraph;
+
+namespace SeeGit
+{
+ [DebuggerDisplay("{Source.Sha}..{Target.Sha}")]
+ public class CommitEdge : Edge<CommitVertex>, IEquatable<CommitEdge>
+ {
+ private string _id;
+
+ public CommitEdge(CommitVertex child, CommitVertex parent)
+ : base(child, parent)
+ {
+ }
+
+ public string Id
+ {
+ get
+ {
+ if(_id == null)
+ {
+ if(Source != null)
+ {
+ _id = Source.Sha;
+ }
+ _id += "..";
+ if(Target != null)
+ {
+ _id += Target.Sha;
+ }
+ }
+ return _id;
+ }
+ }
+
+ public override bool Equals(object obj)
+ {
+ return this.Equals(obj as CommitEdge);
+ }
+
+ public bool Equals(CommitEdge other)
+ {
+ if(ReferenceEquals(null, other))
+ return false;
+ if(ReferenceEquals(this, other))
+ return true;
+ return Source == other.Source && Target == other.Target;
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int result = (Target != null ? Target.GetHashCode() : 0);
+ result = (result * 397) ^ (Source != null ? Source.GetHashCode() : 0);
+ return result;
+ }
+ }
+
public static bool operator ==(CommitEdge edge, CommitEdge other)
- {
+ {
if(ReferenceEquals(edge, null)) return ReferenceEquals(other, null);
return edge.Equals(other);
- }
-
- public static bool operator !=(CommitEdge edge, CommitEdge other)
- {
- return !(edge == other);
- }
- }
+ }
+
+ public static bool operator !=(CommitEdge edge, CommitEdge other)
+ {
+ return !(edge == other);
+ }
+ }
}
View
186 SeeGitApp/Models/CommitVertex.cs
@@ -1,94 +1,94 @@
-using System;
-using System.Diagnostics;
-using SeeGit.Models;
-
-namespace SeeGit
-{
- [DebuggerDisplay("{Sha}: {Message}")]
- public class CommitVertex : GitObject<CommitVertex>, IEquatable<CommitVertex>
- {
- public CommitVertex(string sha, string message)
- {
- Sha = sha;
- Message = message;
- Branches = new BranchCollection();
- Branches.CollectionChanged += (o, e) => RaisePropertyChanged(() => HasBranches);
- }
-
- public string Sha
- {
- get;
- private set;
- }
-
- public string ShortSha
- {
- get
- {
- return Sha.AtMost(8);
- }
- }
-
- public string Message
- {
- get;
- private set;
- }
- public string Description
- {
- get;
- set;
- }
-
- public BranchCollection Branches
- {
- get;
- private set;
- }
-
- public bool HasBranches
- {
- get
- {
- return Branches.Count > 0;
- }
- }
-
- public override bool Equals(CommitVertex other)
- {
- if(ReferenceEquals(null, other))
- return false;
- if(ReferenceEquals(this, other))
- return true;
- return Equals(other.Sha, Sha);
- }
-
- public override string ToString()
- {
- return string.Format("{0}: {1}", ShortSha, Message);
- }
-
- public override int GetHashCode()
- {
- unchecked
- {
- int result = (Sha != null ? Sha.GetHashCode() : 0);
- result = (result * 397) ^ (Message != null ? Message.GetHashCode() : 0);
- result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0);
- return result;
- }
- }
-
- public static bool operator ==(CommitVertex commit, CommitVertex other)
- {
- if(ReferenceEquals(commit, null)) return ReferenceEquals(other, null);
-
- return commit.Equals(other);
- }
-
- public static bool operator !=(CommitVertex commit, CommitVertex other)
- {
- return !(commit == other);
- }
- }
+using System;
+using System.Diagnostics;
+using SeeGit.Models;
+
+namespace SeeGit
+{
+ [DebuggerDisplay("{Sha}: {Message}")]
+ public class CommitVertex : GitObject<CommitVertex>, IEquatable<CommitVertex>
+ {
+ public CommitVertex(string sha, string message)
+ {
+ Sha = sha;
+ Message = message;
+ Branches = new BranchCollection();
+ Branches.CollectionChanged += (o, e) => RaisePropertyChanged(() => HasBranches);
+ }
+
+ public string Sha
+ {
+ get;
+ private set;
+ }
+
+ public string ShortSha
+ {
+ get
+ {
+ return Sha.AtMost(8);
+ }
+ }
+
+ public string Message
+ {
+ get;
+ private set;
+ }
+ public string Description
+ {
+ get;
+ set;
+ }
+
+ public BranchCollection Branches
+ {
+ get;
+ private set;
+ }
+
+ public bool HasBranches
+ {
+ get
+ {
+ return Branches.Count > 0;
+ }
+ }
+
+ public override bool Equals(CommitVertex other)
+ {
+ if(ReferenceEquals(null, other))
+ return false;
+ if(ReferenceEquals(this, other))
+ return true;
+ return Equals(other.Sha, Sha);
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0}: {1}", ShortSha, Message);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int result = (Sha != null ? Sha.GetHashCode() : 0);
+ result = (result * 397) ^ (Message != null ? Message.GetHashCode() : 0);
+ result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0);
+ return result;
+ }
+ }
+
+ public static bool operator ==(CommitVertex commit, CommitVertex other)
+ {
+ if(ReferenceEquals(commit, null)) return ReferenceEquals(other, null);
+
+ return commit.Equals(other);
+ }
+
+ public static bool operator !=(CommitVertex commit, CommitVertex other)
+ {
+ return !(commit == other);
+ }
+ }
}
View
4 SeeGitApp/Models/GitObject.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
namespace SeeGit
{
@@ -8,7 +8,7 @@ public abstract class GitObject<T> : NotifyPropertyChanged
public override bool Equals(object obj)
{
- if (!(obj is T)) return false;
+ if (!(obj is T)) return false;
return Equals((T)obj);
}
View
28 UnitTests/Models/CommitEdgeTests.cs
@@ -15,7 +15,7 @@ public void ReturnsTrueIfSourceAndTargetAreSame()
var other = new CommitEdge(new CommitVertex("sha-child", "another child commit"),
new CommitVertex("sha-parent", "another parent commit"));
- Assert.True(edge.Equals(other));
+ Assert.True(edge.Equals(other));
Assert.True(object.Equals(edge, other));
}
@@ -27,7 +27,7 @@ public void ReturnsFalseIfSourceAndTargetAreSame()
var other = new CommitEdge(new CommitVertex("sha-child", "another child commit"),
new CommitVertex("sha-parent", "another parent commit"));
- Assert.False(edge.Equals(other));
+ Assert.False(edge.Equals(other));
Assert.False(object.Equals(edge, other));
}
@@ -37,7 +37,7 @@ public void ReturnsFalseWhenComparedToNull()
var edge = new CommitEdge(new CommitVertex("sha1-child", "child commit"),
new CommitVertex("sha-parent", "parent commit"));
- Assert.False(edge.Equals(null));
+ Assert.False(edge.Equals(null));
Assert.False(object.Equals(edge, null));
}
}
@@ -75,17 +75,17 @@ public void ReturnsFalseWhenComparedToNull()
Assert.False(edge == null);
Assert.True(edge != null);
- }
-
- [Fact]
- public void ReturnsFalseWhenNullAndComparedToNonNull()
- {
- CommitEdge edge = null;
- var other = new CommitEdge(new CommitVertex("sha-child", "child commit"),
- new CommitVertex("sha-parent", "parent commit"));
-
- Assert.False(edge == other);
- Assert.True(edge != other);
+ }
+
+ [Fact]
+ public void ReturnsFalseWhenNullAndComparedToNonNull()
+ {
+ CommitEdge edge = null;
+ var other = new CommitEdge(new CommitVertex("sha-child", "child commit"),
+ new CommitVertex("sha-parent", "parent commit"));
+
+ Assert.False(edge == other);
+ Assert.True(edge != other);
}
}
}
View
30 UnitTests/Models/CommitVertexTests.cs
@@ -1,6 +1,6 @@
using SeeGit;
-using Xunit;
-
+using Xunit;
+
namespace UnitTests.Models
{
public class CommitVertexTests
@@ -26,7 +26,7 @@ public void ReturnsTrueIfShasAreSame()
var commit = new CommitVertex("sha", "whatever");
var other = new CommitVertex("sha", "doesn't matter");
- Assert.True(commit.Equals(other));
+ Assert.True(commit.Equals(other));
Assert.True(object.Equals(commit, other));
}
@@ -36,16 +36,16 @@ public void ReturnsFalseIfShasAreDifferent()
var commit = new CommitVertex("sha1", "whatever");
var other = new CommitVertex("sha2", "doesn't matter");
- Assert.False(commit.Equals(other));
+ Assert.False(commit.Equals(other));
Assert.False(object.Equals(commit, other));
}
[Fact]
public void ReturnsFalseWhenComparedToNull()
- {
- var commit = new CommitVertex("sha", "message");
- CommitVertex other = null;
-
+ {
+ var commit = new CommitVertex("sha", "message");
+ CommitVertex other = null;
+
Assert.False(commit.Equals(other));
Assert.False(object.Equals(commit, other));
}
@@ -77,13 +77,13 @@ public void ReturnsFalseWhenComparedToNull()
{
Assert.False(new CommitVertex("sha", "message") == null);
Assert.True(new CommitVertex("sha", "message") != null);
- }
-
- [Fact]
- public void ReturnsFalseWhenNullComparedToNonNull()
- {
- Assert.False(null == new CommitVertex("sha", "message"));
- Assert.True(null != new CommitVertex("sha", "message"));
+ }
+
+ [Fact]
+ public void ReturnsFalseWhenNullComparedToNonNull()
+ {
+ Assert.False(null == new CommitVertex("sha", "message"));
+ Assert.True(null != new CommitVertex("sha", "message"));
}
}
}
Something went wrong with that request. Please try again.