Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove GitSharp project

  • Loading branch information...
commit f09376776aeed22b90259751098ed663a38e79d9 1 parent eea74d9
@yysun authored
Showing with 542 additions and 22,883 deletions.
  1. +36 −0 GitSharp licence.txt
  2. +0 −234 GitSharp/AbstractObject.cs
  3. +0 −85 GitSharp/Author.cs
  4. +0 −175 GitSharp/Blob.cs
  5. +0 −288 GitSharp/Branch.cs
  6. +0 −167 GitSharp/Change.cs
  7. +0 −216 GitSharp/Commands/AbstractCommand.cs
  8. +0 −136 GitSharp/Commands/AbstractFetchCommand.cs
  9. +0 −201 GitSharp/Commands/AddCommand.cs
  10. +0 −264 GitSharp/Commands/AmCommand.cs
  11. +0 −232 GitSharp/Commands/AnnotateCommand.cs
  12. +0 −332 GitSharp/Commands/ApplyCommand.cs
  13. +0 −134 GitSharp/Commands/ArchiveCommand.cs
  14. +0 −289 GitSharp/Commands/BlameCommand.cs
  15. +0 −229 GitSharp/Commands/BranchCommand.cs
  16. +0 −116 GitSharp/Commands/CatFileCommand.cs
  17. +0 −257 GitSharp/Commands/CheckoutCommand.cs
  18. +0 −155 GitSharp/Commands/CheckoutIndexCommand.cs
  19. +0 −72 GitSharp/Commands/CherryCommand.cs
  20. +0 −138 GitSharp/Commands/CherryPickCommand.cs
  21. +0 −121 GitSharp/Commands/CleanCommand.cs
  22. +0 −330 GitSharp/Commands/CloneCommand.cs
  23. +0 −213 GitSharp/Commands/CommitCommand.cs
  24. +0 −72 GitSharp/Commands/CommitTreeCommand.cs
  25. +0 −229 GitSharp/Commands/ConfigCommand.cs
  26. +0 −76 GitSharp/Commands/CountObjectsCommand.cs
  27. +0 −167 GitSharp/Commands/DescribeCommand.cs
  28. +0 −602 GitSharp/Commands/DiffCommand.cs
  29. +0 −677 GitSharp/Commands/DiffFilesCommand.cs
  30. +0 −621 GitSharp/Commands/DiffIndexCommand.cs
  31. +0 −782 GitSharp/Commands/DiffTreeCommand.cs
  32. +0 −118 GitSharp/Commands/DifftoolCommand.cs
  33. +0 −184 GitSharp/Commands/FastExportCommand.cs
  34. +0 −177 GitSharp/Commands/FastImportCommand.cs
  35. +0 −88 GitSharp/Commands/FetchCommand.cs
  36. +0 −161 GitSharp/Commands/FetchPackCommand.cs
  37. +0 −251 GitSharp/Commands/FilterBranchCommand.cs
  38. +0 −108 GitSharp/Commands/ForEachRefCommand.cs
  39. +0 −865 GitSharp/Commands/FormatPatchCommand.cs
  40. +0 −157 GitSharp/Commands/FsckCommand.cs
  41. +0 −126 GitSharp/Commands/GcCommand.cs
  42. +0 −361 GitSharp/Commands/GrepCommand.cs
  43. +0 −121 GitSharp/Commands/HashObjectCommand.cs
  44. +0 −158 GitSharp/Commands/IndexPackCommand.cs
  45. +0 −136 GitSharp/Commands/InitCommand.cs
  46. +0 −663 GitSharp/Commands/LogCommand.cs
  47. +0 −260 GitSharp/Commands/LsFilesCommand.cs
  48. +0 −97 GitSharp/Commands/LsRemoteCommand.cs
  49. +0 −149 GitSharp/Commands/LsTreeCommand.cs
  50. +0 −149 GitSharp/Commands/MailinfoCommand.cs
  51. +0 −99 GitSharp/Commands/MailsplitCommand.cs
  52. +0 −71 GitSharp/Commands/MergeBaseCommand.cs
  53. +0 −147 GitSharp/Commands/MergeCommand.cs
  54. +0 −94 GitSharp/Commands/MergeFileCommand.cs
  55. +0 −93 GitSharp/Commands/MergeIndexCommand.cs
  56. +0 −126 GitSharp/Commands/MergetoolCommand.cs
  57. +0 −93 GitSharp/Commands/MktreeCommand.cs
  58. +0 −103 GitSharp/Commands/MvCommand.cs
  59. +0 −124 GitSharp/Commands/NameRevCommand.cs
  60. +0 −85 GitSharp/Commands/NotesCommand.cs
  61. +0 −349 GitSharp/Commands/PackObjectsCommand.cs
  62. +0 −88 GitSharp/Commands/PackRedundantCommand.cs
  63. +0 −78 GitSharp/Commands/PackRefsCommand.cs
  64. +0 −64 GitSharp/Commands/PatchIdCommand.cs
  65. +0 −81 GitSharp/Commands/PeekRemoteCommand.cs
  66. +0 −89 GitSharp/Commands/PruneCommand.cs
  67. +0 −80 GitSharp/Commands/PrunePackedCommand.cs
  68. +0 −238 GitSharp/Commands/PushCommand.cs
  69. +0 −96 GitSharp/Commands/QuiltimportCommand.cs
  70. +0 −194 GitSharp/Commands/ReadTreeCommand.cs
  71. +0 −253 GitSharp/Commands/RebaseCommand.cs
  72. +0 −64 GitSharp/Commands/ReceivePackCommand.cs
  73. +0 −138 GitSharp/Commands/ReflogCommand.cs
  74. +0 −73 GitSharp/Commands/RelinkCommand.cs
  75. +0 −73 GitSharp/Commands/RemoteCommand.cs
  76. +0 −204 GitSharp/Commands/RepackCommand.cs
  77. +0 −91 GitSharp/Commands/ReplaceCommand.cs
  78. +0 −64 GitSharp/Commands/RequestPullCommand.cs
  79. +0 −126 GitSharp/Commands/ResetCommand.cs
  80. +0 −362 GitSharp/Commands/RevParseCommand.cs
  81. +0 −129 GitSharp/Commands/RevertCommand.cs
  82. +0 −118 GitSharp/Commands/RmCommand.cs
  83. +0 −129 GitSharp/Commands/SendPackCommand.cs
  84. +0 −108 GitSharp/Commands/ShortlogCommand.cs
  85. +0 −225 GitSharp/Commands/ShowBranchCommand.cs
  86. +0 −112 GitSharp/Commands/ShowCommand.cs
  87. +0 −127 GitSharp/Commands/ShowRefCommand.cs
  88. +0 −254 GitSharp/Commands/StatusCommand.cs
  89. +0 −72 GitSharp/Commands/StripspaceCommand.cs
  90. +0 −174 GitSharp/Commands/SubmoduleCommand.cs
  91. +0 −163 GitSharp/Commands/SvnCommand.cs
  92. +0 −82 GitSharp/Commands/SymbolicRefCommand.cs
  93. +0 −164 GitSharp/Commands/TagCommand.cs
  94. +0 −72 GitSharp/Commands/TarTreeCommand.cs
  95. +0 −64 GitSharp/Commands/UnpackFileCommand.cs
  96. +0 −101 GitSharp/Commands/UnpackObjectsCommand.cs
  97. +0 −294 GitSharp/Commands/UpdateIndexCommand.cs
  98. +0 −72 GitSharp/Commands/UpdateServerInfoCommand.cs
  99. +0 −64 GitSharp/Commands/UploadArchiveCommand.cs
  100. +0 −80 GitSharp/Commands/UploadPackCommand.cs
  101. +0 −74 GitSharp/Commands/VarCommand.cs
  102. +0 −82 GitSharp/Commands/VerifyPackCommand.cs
  103. +0 −64 GitSharp/Commands/VerifyTagCommand.cs
  104. +0 −152 GitSharp/Commands/WhatchangedCommand.cs
  105. +0 −3  GitSharp/Commands/_NotSupportedCommands.txt
  106. +0 −541 GitSharp/Commit.cs
  107. +0 −146 GitSharp/Config.cs
  108. +0 −360 GitSharp/Diff.cs
  109. +0 −219 GitSharp/Git.cs
  110. +0 −198 GitSharp/GitSharp.csproj
  111. +0 −53 GitSharp/IReferenceObject.cs
  112. +0 −53 GitSharp/ITreeNode.cs
  113. +0 −196 GitSharp/IgnoreRules.cs
  114. +0 −410 GitSharp/Index.cs
  115. +0 −118 GitSharp/Leaf.cs
  116. +0 −4 GitSharp/Properties/AssemblyInfo.cs
  117. +0 −2  GitSharp/README.txt
  118. +0 −183 GitSharp/Ref.cs
  119. +0 −570 GitSharp/Repository.cs
  120. +0 −383 GitSharp/RepositoryStatus.cs
  121. +0 −67 GitSharp/ResetBehavior.cs
  122. +0 −145 GitSharp/Tag.cs
  123. +0 −183 GitSharp/Text.cs
  124. +0 −220 GitSharp/Tree.cs
  125. +0 −57 GitSharp/UserInfoProvider.cs
  126. +2 −17 GitSharp/Commands/IGitCommand.cs → JGit licence.txt
  127. +47 −0 MiscUtil licence.txt
  128. +457 −0 Winterdom.IO.FileMap License.txt
View
36 GitSharp licence.txt
@@ -0,0 +1,36 @@
+Git# is Copyright (C) 2007-2009 by the Git Development Community
+See source file headers for specific contributor copyrights
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+- Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+- Neither the name of the Git Development Community nor the
+ names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
View
234 GitSharp/AbstractObject.cs
@@ -1,234 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using ObjectId = GitSharp.Core.ObjectId;
-using CoreRef = GitSharp.Core.Ref;
-using CoreCommit = GitSharp.Core.Commit;
-using CoreTree = GitSharp.Core.Tree;
-using CoreTag = GitSharp.Core.Tag;
-using System.Diagnostics;
-
-namespace GitSharp
-{
- /// <summary>
- /// AbstractObject is the base class for the classes Blob, Commit, Tag and Tree. It proviedes test methods
- /// to identify its specialized type (i.e. IsBlob, IsCommit, etc). AbstractObject also defines comparison operators so you can
- /// safely compare git objects by using the operators == or != which internally efficiently compare the objects hashes.
- /// </summary>
- public abstract class AbstractObject
- {
- protected Repository _repo;
- internal ObjectId _id; // <--- the git object is lazy loaded. only a _id is required until properties are accessed.
-
- internal AbstractObject(Repository repo, ObjectId id)
- {
- _repo = repo;
- _id = id;
- }
-
- internal AbstractObject(Repository repo, string name)
- {
- _repo = repo;
- _id = _repo._internal_repo.Resolve(name);
- }
-
- /// <summary>
- /// The git object's SHA1 hash. This is the long hash, See ShortHash for the abbreviated version.
- /// </summary>
- public string Hash
- {
- get
- {
- if (_id == null)
- return null;
- return _id.Name;
- }
- }
-
- /// <summary>
- /// The git object's abbreviated SHA1 hash.
- /// </summary>
- public string ShortHash
- {
- get
- {
- if (_id == null)
- return null;
- return _id.Abbreviate(_repo._internal_repo).name();
- }
- }
-
- /// <summary>
- /// True if this object is a Blob (or Leaf which is a subclass of Blob).
- /// </summary>
- public virtual bool IsBlob
- {
- get
- {
- if (_id == null)
- return false;
- return _repo._internal_repo.MapObject(_id, null) is byte[];
- }
- }
-
- /// <summary>
- /// True if this object is a Commit.
- /// </summary>
- public virtual bool IsCommit
- {
- get
- {
- if (_id == null)
- return false;
- return _repo._internal_repo.MapObject(_id, null) is CoreCommit;
- }
- }
-
- /// <summary>
- /// True if this object is a Tag.
- /// </summary>
- public virtual bool IsTag
- {
- get
- {
- if (_id == null)
- return false;
- return _repo._internal_repo.MapObject(_id, null) is CoreTag;
- }
- }
-
- /// <summary>
- /// True if the internal object is a Tree.
- /// </summary>
- public virtual bool IsTree
- {
- get
- {
- if (_id == null)
- return false;
- return _repo._internal_repo.MapObject(_id, null) is CoreTree;
- }
- }
-
- /// <summary>
- /// The repository where this git object belongs to.
- /// </summary>
- public Repository Repository
- {
- get
- {
- return _repo;
- }
- }
-
-#if implemented
- public Diff Diff(AbstractObject other) { }
-
- public ?? Grep(?? pattern) { }
-
- public Byte[] Content { get; }
-
- public long Size { get; }
-#endif
-
- /// <summary>
- /// Internal helper function to create the right object instance for a given hash
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="objectId"></param>
- /// <returns></returns>
- internal static AbstractObject Wrap(Repository repo, ObjectId objectId)
- {
- Debug.Assert(objectId != null, "ObjectId is null");
- Debug.Assert(repo != null, "Repository is null");
- var obj = repo._internal_repo.MapObject(objectId, null);
- if (obj is CoreCommit)
- return new Commit(repo, obj as CoreCommit);
- else if (obj is CoreTag)
- return new Tag(repo, obj as CoreTag);
- else if (obj is CoreTree)
- return new Tree(repo, obj as CoreTree);
- else if (obj is byte[])
- return new Blob(repo, objectId, obj as byte[]);
- else
- {
- //Debug.Assert(false, "What kind of object do we have here?");
- return null;
- }
- }
-
- #region Equality overrides
-
- /// <summary>
- /// Overriding equals to reflect that different AbstractObject instances with the same hash are in fact equal.
- /// </summary>
- /// <param name="obj"></param>
- /// <returns></returns>
- public override bool Equals(object obj)
- {
- if (obj is AbstractObject)
- return _id == (obj as AbstractObject)._id;
- else
- return false;
- }
-
- public static bool operator ==(AbstractObject self, object other)
- {
- return Equals(self, other);
- }
-
- public static bool operator !=(AbstractObject self, object other)
- {
- return !(self == other);
- }
-
- public override int GetHashCode()
- {
- if (_id != null)
- return _id.GetHashCode();
- return base.GetHashCode();
- }
-
- #endregion
-
- }
-}
View
85 GitSharp/Author.cs
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp
-{
- /// <summary>
- /// Represents the Author or Committer of a Commit.
- /// </summary>
- public class Author
- {
-
- /// <summary>
- /// Creates an uninitialized Author. You may use the object initializer syntax with this constructor, i.e. new Author { Name="henon", EmailAddress="henon@gitsharp.com" }
- /// </summary>
- public Author() { }
-
- /// <summary>
- /// Creates an Author.
- /// </summary>
- public Author(string name, string email)
- {
- Name = name;
- EmailAddress = email;
- }
-
- public string Name { get; set; }
-
- public string EmailAddress { get; set; }
-
- /// <summary>
- /// Preconfigured anonymous Author, which may be used by GitSharp if no Author has been configured.
- /// </summary>
- public static Author Anonymous
- {
- get
- {
- return new Author("anonymous", "anonymous@(none).com");
- }
- }
-
- public static Author GetDefaultAuthor(Repository repo)
- {
- return new Author(repo.Config["user.name"], repo.Config["user.email"]);
- }
- }
-}
View
175 GitSharp/Blob.cs
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using GitSharp.Core.Util;
-using ObjectId = GitSharp.Core.ObjectId;
-using CoreRef = GitSharp.Core.Ref;
-using CoreCommit = GitSharp.Core.Commit;
-using CoreTree = GitSharp.Core.Tree;
-using CoreTag = GitSharp.Core.Tag;
-using System.IO;
-
-namespace GitSharp
-{
- /// <summary>
- /// Represents a specific version of the content of a file tracked by git. Using a Blob you can access the contents of
- /// any git object as string or byte array. For tracked files (leaves of a git tree) it returns the content of the file. For git objects
- /// such as Commit, Tag or Tree the Blob API may be used to inspect the the uncompressed internal representation.
- ///
- /// To open a git object instantiate a Blob with the object's Hash or another valid reference (see Ref).
- ///
- /// var b=new Blob(repo, "e287f54");
- ///
- /// Note, that new Blob( ...) does not create a new blob in the repository but rather constructs the object to manipulate an existing blob.
- ///
- /// Advanced: To create a new Blob inside the repository you can use the static create function, however, you are advised to use
- /// higher level functionality to create new revisions of files, i.e. by using the Commit.Create API (see Commit).
- /// </summary>
- public class Blob : AbstractObject
- {
-
- internal Blob(Repository repo, ObjectId id)
- : base(repo, id)
- {
- }
-
- internal Blob(Repository repo, ObjectId id, byte[] blob)
- : base(repo, id)
- {
- _blob = blob;
- }
-
- /// <summary>
- /// Create a Blob object which represents an existing blob in the git repository
- /// </summary>
- /// <param name="repo">The repository which owns the object to load</param>
- /// <param name="hash">The SHA1 Hash of the object to load</param>
- public Blob(Repository repo, string hash) : base(repo, hash) { }
-
- private byte[] _blob;
-
- /// <summary>
- /// Get the uncompressed contents of this Blob as string. This assumes that the contents are encoded in UTF8.
- /// </summary>
- public string Data
- {
- get
- {
- if (RawData == null)
- return null;
- return RawParseUtils.decode(RawData);
- }
- }
-
- /// <summary>
- /// Get the uncompressed original encoded raw data of the Blob as byte array. This is useful if the contents of the blob are encoded in some legacy encoding instead of UTF8.
- /// </summary>
- public byte[] RawData
- {
- get
- {
- if (_blob == null)
- {
- var loader = _repo._internal_repo.OpenBlob(_id);
- if (loader == null)
- return null;
- _blob = loader.Bytes;
- }
- return _blob;
- }
- }
-
- public override string ToString()
- {
- return "Blob[" + ShortHash + "]";
- }
-
- /// <summary>
- /// Create a new Blob containing the given string data as content. The string will be encoded as UTF8
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="content">string to be stored in the blob</param>
- /// <returns></returns>
- public static Blob Create(Repository repo, string content)
- {
- return Create(repo, content, Encoding.UTF8);
- }
-
- /// <summary>
- /// Create a new Blob containing the given string data as content. The string will be encoded by the submitted encoding
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="content">string to be stored in the blob</param>
- /// <param name="encoding"></param>
- /// <returns></returns>
- public static Blob Create(Repository repo, string content, Encoding encoding)
- {
- return Create(repo, encoding.GetBytes(content));
- }
-
- /// <summary>
- /// Create a new Blob containing the contents of the given file.
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="path">Path to the file that should be stored in the blob</param>
- /// <returns></returns>
- public static Blob CreateFromFile(Repository repo, string path)
- {
- if (new FileInfo(path).Exists == false)
- throw new ArgumentException("File does not exist", "path");
- return Create(repo, File.ReadAllBytes(path));
- }
-
- /// <summary>
- /// Create a new Blob containing exactly the raw bytes given (before compression).
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="content">Uncompressed, encoded raw data to be stored in the blob</param>
- /// <returns></returns>
- public static Blob Create(Repository repo, byte[] content)
- {
- var db = repo._internal_repo;
- var id = new GitSharp.Core.ObjectWriter(db).WriteBlob(content);
- return new Blob(repo, id, content);
- }
-
- }
-}
View
288 GitSharp/Branch.cs
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- * Copyright (C) 2009, Nulltoken <emeric.fermas@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-using System;
-using GitSharp.Commands;
-using GitSharp.Core;
-using CoreRef = GitSharp.Core.Ref;
-using CoreCommit = GitSharp.Core.Commit;
-using CoreTree = GitSharp.Core.Tree;
-using CoreRepository = GitSharp.Core.Repository;
-
-namespace GitSharp
-{
- /// <summary>
- /// Represents a branch in git. You can create and manipulate git branches and you can manipulate your working directory using Branch.
- ///
- /// Note, that new Branch( ...) does not create a new branch in the repository but rather constructs the object to manipulate an existing branch.
- /// To create a new branch use the static Branch.Create API.
- /// </summary>
- public class Branch : Ref
- {
-
- /// <summary>
- /// Open a branch by resolving a reference (such as HEAD)
- /// </summary>
- /// <param name="ref"></param>
- public Branch(Ref @ref)
- : base(@ref._repo, @ref.Name)
- {
- }
-
- /// <summary>
- /// Open a branch by branch name (i.e. "master" or "origin/master")
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="name"></param>
- public Branch(Repository repo, string name)
- : base(repo, name)
- {
- }
-
- internal Branch(Repository repo, CoreRef @ref)
- : this(repo, @ref.Name)
- {
- }
-
- /// <summary>
- /// Get the branch's full path name relative to the .git directory
- /// </summary>
- public string Fullname
- {
- get { return Constants.R_HEADS + Name; }
- }
-
- /// <summary>
- /// Returns the latest commit on this branch, or in other words, the commit this branch is pointing to.
- /// </summary>
- public Commit CurrentCommit
- {
- get { return Target as Commit; }
- }
-
- /// <summary>
- /// True if the branch is the current branch of the repository
- /// </summary>
- public bool IsCurrent
- {
- get { return _repo.CurrentBranch == this; }
- }
-
- /// <summary>
- /// True if this Ref points to a remote branch.
- /// </summary>
- public bool IsRemote
- {
- get;
- internal set;
- }
-
- #region --> Merging
-
-
- /// <summary>
- /// Merge the given branch into this Branch using the given merge strategy.
- /// </summary>
- /// <param name="other"></param>
- public MergeResult Merge(Branch other, MergeStrategy strategy)
- {
- return MergeCommand.Execute(new MergeOptions { Branches = new[] { this, other }, MergeStrategy = strategy });
- }
-
-
- #endregion
-
- /// <summary>
- /// Delete this branch
- ///
- /// Not yet implemented!
- /// </summary>
- public void Delete()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Check out this branch into the working directory and have HEAD point to it.
- /// </summary>
- public void Checkout()
- {
- var db = _repo._internal_repo;
- RefUpdate u = db.UpdateRef(Constants.HEAD);
- u.link(Constants.R_HEADS + this.Name);
- Reset(ResetBehavior.Hard);
- }
-
- /// <summary>
- /// Rename the Branch.
- ///
- /// Not yet implemented!
- /// </summary>
- public void Rename(string name)
- {
- throw new NotImplementedException();
- }
-
- #region --> Reset
-
-
- /// <summary>
- /// Reset this Branch to the current Commit using the given ResetBehavior. <see cref="Reset(GitSharp.Commit,GitSharp.ResetBehavior)"/> for explanation of the reset behavior.
- /// </summary>
- public void Reset(ResetBehavior resetBehavior)
- {
- if (this.CurrentCommit == null)
- throw new InvalidOperationException(string.Format("Branch '{0}' has no commit.", Name));
- var commit = this.CurrentCommit;
- Reset(commit, resetBehavior);
- }
-
- /// <summary>
- /// Reset this Branch to the named Commit using the given ResetBehavior. <see cref="Reset(GitSharp.Commit,GitSharp.ResetBehavior)"/> for explanation of the reset behavior.
- /// </summary>
- public void Reset(string commitHash, ResetBehavior resetBehavior)
- {
- var commit = new Commit(_repo, commitHash);
- if (!commit.IsCommit)
- throw new ArgumentException(string.Format("The provided hash ({0}) does not point to a commit.", commitHash));
- Reset(commit, resetBehavior);
- }
-
- /// <summary>
- /// Reset this Branch to the given Commit using the given ResetBehavior.
- /// <para/>
- /// Reset behavior:
- /// <u>
- /// <il>Mixed - Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated. This is the default action.</il>
- /// <il>Soft - Does not touch the index file nor the working tree at all, but requires them to be in a good order. This leaves all your changed files "Changes to be committed", as git status would put it.</il>
- /// <il>Hard - Matches the working tree and index to that of the tree being switched to. Any changes to tracked files in the working tree since the commit are lost.</il>
- /// <il>Merge - (NOT IMPLEMENTED) Resets the index to match the tree recorded by the named commit, and updates the files that are different between the named commit and the current commit in the working tree.</il>
- /// </u>
- /// </summary>
- public void Reset(Commit commit, ResetBehavior resetBehavior)
- {
- if (commit == null)
- throw new ArgumentNullException("commit");
- switch (resetBehavior)
- {
- case ResetBehavior.Hard:
- ResetHard(commit);
- break;
- case ResetBehavior.Soft:
- ResetSoft(commit);
- break;
- case ResetBehavior.Mixed:
- ResetMixed(commit);
- break;
- case ResetBehavior.Merge:
- throw new NotImplementedException();
- default:
- throw new NotSupportedException(string.Format("{0} is not supported.", resetBehavior));
- }
- }
-
- private void ResetMixed(Commit commit)
- {
- if (commit.Tree == null || commit.Tree.InternalTree == null)
- throw new InvalidOperationException("The given commit '" + commit.Hash + "'contains no valid tree.");
- var index = _repo.Index.GitIndex;
- index.ReadTree(commit.Tree.InternalTree);
- index.write();
- Ref.Update("HEAD", commit);
- }
-
- private static void ResetSoft(Commit commit)
- {
- Ref.Update("HEAD", commit);
- }
-
- private void ResetHard(Commit commit)
- {
- commit.Checkout();
- _repo._internal_repo.Index.write();
- Ref.Update("HEAD", commit);
- }
-
-
- #endregion
-
- #region --> Branch Creation API
-
- /// <summary>
- /// Create a new branch based on HEAD.
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="name">The name of the branch to create (i.e. "master", not "refs/heads/master")</param>
- /// <returns>returns the newly created Branch object</returns>
- public static Branch Create(Repository repo, string name)
- {
- if (string.IsNullOrEmpty(name))
- throw new ArgumentException("Branch name must not be null or empty");
- Ref.Update("refs/heads/" + name, repo.Head.CurrentCommit);
- return new Branch(repo, name);
- }
-
- /// <summary>
- /// Create a new branch basing on the given commit
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="name">The name of the branch to create (i.e. "master", not "refs/heads/master")</param>
- /// <param name="commit">The commit to base the branch on.</param>
- /// <returns>returns the newly created Branch object</returns>
- public static Branch Create(Repository repo, string name, Commit commit)
- {
- if (string.IsNullOrEmpty(name))
- throw new ArgumentException("Branch name must not be null or empty", "name");
- if (commit == null || !commit.IsCommit)
- throw new ArgumentException("Invalid commit", "commit");
- Ref.Update("refs/heads/" + name, commit);
- return new Branch(repo, name);
- }
-
-
- #endregion
-
-
- public override string ToString()
- {
- return "Branch[" + Name + "]";
- }
-
- }
-}
View
167 GitSharp/Change.cs
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp
-{
-
- public enum ChangeType
- {
- Added, Deleted, Modified, TypeChanged, Renamed, Copied
- }
-
- /// <summary>
- /// Represents a change of a single file between two commits. Use Commit.Diff to get a list of Change objects.
- /// </summary>
- public class Change
- {
-
- /// <summary>
- /// The commit that serves as reference for this comparison. The change reflects the difference of the other commit against this ReferenceCommit.
- /// </summary>
- public Commit ReferenceCommit
- {
- get;
- internal set;
- }
-
- /// <summary>
- /// The commit which is compared against the ReferenceCommit.
- /// </summary>
- public Commit ComparedCommit
- {
- get;
- internal set;
- }
-
- /// <summary>
- /// The kind of change (Added, Modified, Deleted, etc. )
- /// </summary>
- public ChangeType ChangeType { get; internal set; }
-
- /// <summary>
- /// The revision of the file from the ReferenceCommit. It may be null in some cases i.e. for ChangeType.Added
- /// </summary>
- public AbstractObject ReferenceObject { get; internal set; }
-
- /// <summary>
- /// The revision of the file from the ComparedCommit. It may be null in some cases i.e. for ChangeType.Removed
- /// </summary>
- public AbstractObject ComparedObject { get; internal set; }
-
- /// <summary>
- /// The file (i.e. Blob) this Change is according to.
- /// Always returns a non-null revision of the file, no matter what kind of change. It normally returns the ComparedCommit's version of the changed
- /// object except for ChangeType.Removed where it returns the ReferenceCommit's version of the object.
- ///
- /// This property is designed to release the calling code from null checking and revision selection and may be especially useful for GUI bindings.
- /// </summary>
- public AbstractObject ChangedObject
- {
- get
- {
- if (ComparedObject != null)
- return ComparedObject;
- else
- return ReferenceObject;
- }
- }
-
- /// <summary>
- /// The filepath of the ChangedObject
- /// </summary>
- public string Path { get; internal set; }
-
- /// <summary>
- /// The filename of the ChangedObject
- /// </summary>
- public string Name { get; internal set; }
-
- /// <summary>
- /// Unix file permissions of the ReferenceCommit's version of the object
- /// </summary>
- public int ReferencePermissions
- {
- get;
- internal set;
- }
-
- /// <summary>
- /// Unix file permissions of the ComparedCommit's version of the object
- /// </summary>
- public int ComparedPermissions { get; internal set; }
-
- /// <summary>
- /// Returns ReferenceCommit and ComparedCommit as array
- /// </summary>
- public Commit[] Commits
- {
- get
- {
- return new Commit[] { ReferenceCommit, ComparedCommit };
- }
- }
-
- /// <summary>
- /// Returns ReferenceObject and ComparedObject as array
- /// </summary>
- public AbstractObject[] Objects
- {
- get
- {
- return new AbstractObject[] { ReferenceObject, ComparedObject };
- }
- }
-
- /// <summary>
- /// Returns ReferenceObject's and ComparedObject's permissions as array
- /// </summary>
- public int[] Permissions
- {
- get
- {
- return new int[] { ReferencePermissions, ComparedPermissions };
- }
- }
-
- }
-
-}
View
216 GitSharp/Commands/AbstractCommand.cs
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2009, Henon <meinrad.recheis@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.IO;
-using GitSharp.Core;
-
-namespace GitSharp.Commands
-{
- /// <summary>
- /// Abstract base class of all git commands. It provides basic infrastructure
- /// </summary>
- public abstract class AbstractCommand : IGitCommand
- {
- /// <summary>
- /// Abbreviates a ref-name, used in internal output
- /// </summary>
- /// <param name="dst">long ref</param>
- /// <param name="abbreviateRemote">abbreviate as remote</param>
- /// <returns></returns>
- protected string AbbreviateRef(String dst, bool abbreviateRemote)
- {
- if (dst.StartsWith(Constants.R_HEADS))
- dst = dst.Substring(Constants.R_HEADS.Length);
- else if (dst.StartsWith(Constants.R_TAGS))
- dst = dst.Substring(Constants.R_TAGS.Length);
- else if (abbreviateRemote && dst.StartsWith(Constants.R_REMOTES))
- dst = dst.Substring(Constants.R_REMOTES.Length);
- return dst;
- }
-
- /// <summary>
- /// Performs upward recursive lookup to return git directory. Honors the environment variable GIT_DIR.
- /// </summary>
- /// <returns></returns>
- public static string FindGitDirectory(string rootDirectory, bool recursive, bool isBare)
- {
- string directory = null;
- string gitDir = null;
- string envGitDir = System.Environment.GetEnvironmentVariable("GIT_DIR");
-
- //Determine which git directory to use
- if (rootDirectory != null) //Directory specified by --git-dir
- directory = rootDirectory;
- else if (envGitDir != null) //Directory specified by $GIT_DIR
- directory = envGitDir;
- else //Current Directory
- {
- directory = Directory.GetCurrentDirectory();
- if (recursive)
- {
- //Check for non-bare repositories
- if (!isBare)
- {
- while (directory != null)
- {
- gitDir = Path.Combine(directory, Constants.DOT_GIT);
- if (Directory.Exists(gitDir))
- return directory;
-
- //Get parent directory
- string parentDirectory = Path.Combine(directory, "..");
- parentDirectory = Path.GetFullPath(parentDirectory);
- if (parentDirectory == directory)
- return null;
- directory = parentDirectory;
- }
- }
- else
- {
- //Check for bare repositories
- while (directory != null)
- {
- if (directory.EndsWith(Constants.DOT_GIT_EXT) && Directory.Exists(directory))
- return directory;
-
- //Get parent directory
- directory = Path.Combine(directory, "..");
- directory = Path.GetFullPath(directory);
- }
- }
- }
- }
- if (!directory.EndsWith(Constants.DOT_GIT_EXT))
- {
- if (!isBare)
- directory = Path.Combine(directory, Constants.DOT_GIT);
- else
- directory += Constants.DOT_GIT_EXT;
- }
- return directory;
- }
-
- /// <summary>
- /// Returns the value of the process' environment variable GIT_DIR
- /// </summary>
- protected string GIT_DIR
- {
- get
- {
- return System.Environment.GetEnvironmentVariable("GIT_DIR");
- }
- }
-
- /// <summary>
- /// This command's output stream. If not explicitly set, the command writes to Git.OutputStream out.
- /// </summary>
- public StreamWriter OutputStream
- {
- get
- {
- if (_output == null)
- return Git.DefaultOutputStream;
- return _output;
- }
- set
- {
- _output = value;
- }
- }
- StreamWriter _output = null;
-
- /// <summary>
- /// The git repository that is either result of the command (init, clone) or subject to alteration (all other commands).
- /// If not explicitly set, the command uses Git.Commands.Repository.
- ///
- /// Note: InitCommand and CloneCommand ignore this property and overwrite it as a result of Execute.
- /// </summary>
- public Repository Repository
- {
- get
- {
- if (_repository == null)
- return Git.DefaultRepository;
- return _repository;
- }
- set // <--- for the time being this is public settable. we need to refactor in order to remove the Repository property from Clone and Init
- {
- _repository = value;
- }
- }
- Repository _repository = null;
-
- /// <summary>
- /// The git directory. If not explicitly set, the command uses Git.GitDirectory.
- /// </summary>
- public virtual string GitDirectory
- {
- get
- {
- if (_gitDirectory == null)
- return Git.DefaultGitDirectory;
- return _gitDirectory;
- }
- set
- {
- _gitDirectory = value;
- }
- }
- protected string _gitDirectory = null;
-
- /// <summary>
- /// Get the directory where the Init command will initialize the repository. if GitDirectory is null ActualDirectory is used to initialize the repository.
- /// </summary>
- public virtual string ActualDirectory
- {
- get
- {
- return FindGitDirectory(GitDirectory, false, false);
- }
- }
-
- /// <summary>
- /// Execute the git command.
- /// </summary>
- public abstract void Execute();
-
- }
-}
View
136 GitSharp/Commands/AbstractFetchCommand.cs
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-using System;
-using GitSharp.Core;
-using GitSharp.Core.Transport;
-
-namespace GitSharp.Commands
-{
- public abstract class AbstractFetchCommand : AbstractCommand
- {
- protected bool verbose;
-
- protected void showFetchResult(GitSharp.Core.Transport.Transport tn, FetchResult r)
- {
- bool shownURI = false;
- foreach (TrackingRefUpdate u in r.TrackingRefUpdates)
- {
- if (!verbose && u.Result == RefUpdate.RefUpdateResult.NO_CHANGE)
- continue;
-
- char type = shortTypeOf(u.Result);
- string longType = longTypeOf(u);
- string src = AbbreviateRef(u.RemoteName, false);
- string dst = AbbreviateRef(u.LocalName, true);
-
- if (!shownURI)
- {
- OutputStream.Write("From ");
- OutputStream.WriteLine(tn.Uri);
- shownURI = true;
- }
-
- OutputStream.WriteLine(" " + type + " " + longType + " " + src + " -> " + dst);
- }
- }
-
- private string longTypeOf(TrackingRefUpdate u)
- {
- RefUpdate.RefUpdateResult r = u.Result;
- if (r == RefUpdate.RefUpdateResult.LOCK_FAILURE)
- return "[lock fail]";
- if (r == RefUpdate.RefUpdateResult.IO_FAILURE)
- return "[i/o error]";
- if (r == RefUpdate.RefUpdateResult.REJECTED)
- return "[rejected]";
- if (ObjectId.ZeroId.Equals(u.NewObjectId))
- return "[deleted]";
-
- if (r == RefUpdate.RefUpdateResult.NEW)
- {
- if (u.RemoteName.StartsWith(Constants.R_HEADS))
- return "[new branch]";
- if (u.LocalName.StartsWith(Constants.R_TAGS))
- return "[new tag]";
- return "[new]";
- }
-
- if (r == RefUpdate.RefUpdateResult.FORCED)
- {
- string aOld = u.OldObjectId.Abbreviate(Repository).name();
- string aNew = u.NewObjectId.Abbreviate(Repository).name();
- return aOld + "..." + aNew;
- }
-
- if (r == RefUpdate.RefUpdateResult.FAST_FORWARD)
- {
- string aOld = u.OldObjectId.Abbreviate(Repository).name();
- string aNew = u.NewObjectId.Abbreviate(Repository).name();
- return aOld + ".." + aNew;
- }
-
- if (r == RefUpdate.RefUpdateResult.NO_CHANGE)
- return "[up to date]";
-
- return "[" + r + "]";
- }
-
- private static char shortTypeOf(RefUpdate.RefUpdateResult r)
- {
- switch (r)
- {
- case RefUpdate.RefUpdateResult.LOCK_FAILURE:
- case RefUpdate.RefUpdateResult.IO_FAILURE:
- case RefUpdate.RefUpdateResult.REJECTED:
- return '!';
-
- case RefUpdate.RefUpdateResult.NEW:
- return '*';
-
- case RefUpdate.RefUpdateResult.FORCED:
- return '+';
-
- case RefUpdate.RefUpdateResult.NO_CHANGE:
- return '=';
-
- default:
- return ' ';
- }
- }
-
- }
-}
View
201 GitSharp/Commands/AddCommand.cs
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using GitSharp.Core.FnMatch;
-using GitSharp.Core;
-
-namespace GitSharp.Commands
-{
- public class AddCommand
- : AbstractCommand
- {
-
- public AddCommand() {
- }
-
- // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
-
- #region Properties / Options
- public List<string> Arguments { get; set; }
- /// <summary>
- /// Not implemented
- ///
- /// Don't actually add the file(s), just show if they exist.
- ///
- /// </summary>
- public bool DryRun { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Be verbose.
- ///
- /// </summary>
- public bool Verbose { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Allow adding otherwise ignored files.
- ///
- /// </summary>
- public bool Force { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Add modified contents in the working tree interactively to
- /// the index. Optional path arguments may be supplied to limit
- /// operation to a subset of the working tree. See ``Interactive
- /// mode'' for details.
- ///
- /// </summary>
- public bool Interactive { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Interactively choose hunks of patch between the index and the
- /// work tree and add them to the index. This gives the user a chance
- /// to review the difference before adding modified contents to the
- /// index.
- /// +
- /// This effectively runs `add --interactive`, but bypasses the
- /// initial command menu and directly jumps to the `patch` subcommand.
- /// See ``Interactive mode'' for details.
- ///
- /// </summary>
- public bool Patch { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Open the diff vs. the index in an editor and let the user
- /// edit it. After the editor was closed, adjust the hunk headers
- /// and apply the patch to the index.
- /// +
- /// *NOTE*: Obviously, if you change anything else than the first character
- /// on lines beginning with a space or a minus, the patch will no longer
- /// apply.
- ///
- /// </summary>
- public bool E { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Update only files that git already knows about, staging modified
- /// content for commit and marking deleted files for removal. This
- /// is similar
- /// to what "git commit -a" does in preparation for making a commit,
- /// except that the update is limited to paths specified on the
- /// command line. If no paths are specified, all tracked files in the
- /// current directory and its subdirectories are updated.
- ///
- /// </summary>
- public bool Update { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Update files that git already knows about (same as '\--update')
- /// and add all untracked files that are not ignored by '.gitignore'
- /// mechanism.
- ///
- /// </summary>
- public bool All { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Record only the fact that the path will be added later. An entry
- /// for the path is placed in the index with no content. This is
- /// useful for, among other things, showing the unstaged content of
- /// such files with 'git diff' and committing them with 'git commit
- /// -a'.
- ///
- /// </summary>
- public bool IntentToAdd { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Don't add the file(s), but only refresh their stat()
- /// information in the index.
- ///
- /// </summary>
- public bool Refresh { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// If some files could not be added because of errors indexing
- /// them, do not abort the operation, but continue adding the
- /// others. The command shall still exit with non-zero status.
- ///
- /// </summary>
- public bool IgnoreErrors { get; set; }
-
- #endregion
-
- public override void Execute()
- {
- foreach (string arg in Arguments)
- {
- //Todo: Add FileNameMatcher support. To be added when fnmatch is completed.
- //For now, pattern matching is not allowed. Please specify the files only.
-
- //Gain access to the Git index using the repository determined before command execution
- Index index = new Index(Repository);
-
- //Use full paths only to eliminate platform-based directory differences
- string path = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), arg));
-
- //Perform the validity tests outside of the index to handle the error messages
- if ((new FileInfo(path).Exists) || (new DirectoryInfo(path).Exists))
- index.Add(path);
- else
- OutputStream.WriteLine(path + " does not exist.");
- }
- }
- }
-}
View
264 GitSharp/Commands/AmCommand.cs
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp.Commands
-{
- public class AmCommand
- : AbstractCommand
- {
-
- public AmCommand() {
- }
-
- // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
-
- #region Properties / Options
- public List<string> Arguments { get; set; }
- /// <summary>
- /// Not implemented
- ///
- /// Add a `Signed-off-by:` line to the commit message, using
- /// the committer identity of yourself.
- ///
- /// </summary>
- public bool Signoff { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Pass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).
- ///
- /// </summary>
- public bool Keep { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Remove everything in body before a scissors line (see
- /// linkgit:git-mailinfo[1]).
- ///
- /// </summary>
- public bool Scissors { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Ignore scissors lines (see linkgit:git-mailinfo[1]).
- ///
- /// </summary>
- public bool NoScissors { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Be quiet. Only print error messages.
- ///
- /// </summary>
- public bool Quiet { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Pass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).
- /// The proposed commit log message taken from the e-mail
- /// is re-coded into UTF-8 encoding (configuration variable
- /// `i18n.commitencoding` can be used to specify project's
- /// preferred encoding if it is not UTF-8).
- /// +
- /// This was optional in prior versions of git, but now it is the
- /// default. You can use `--no-utf8` to override this.
- ///
- /// </summary>
- public bool Utf8 { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Pass `-n` flag to 'git-mailinfo' (see
- /// linkgit:git-mailinfo[1]).
- ///
- /// </summary>
- public bool NoUtf8 { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When the patch does not apply cleanly, fall back on
- /// 3-way merge if the patch records the identity of blobs
- /// it is supposed to apply to and we have those blobs
- /// available locally.
- ///
- /// </summary>
- public bool ThreeWay { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
- /// program that applies
- /// the patch.
- ///
- /// </summary>
- public bool IgnoreSpaceChange { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
- /// program that applies
- /// the patch.
- ///
- /// </summary>
- public string IgnoreWhitespace { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
- /// program that applies
- /// the patch.
- ///
- /// </summary>
- public string Whitespace { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
- /// program that applies
- /// the patch.
- ///
- /// </summary>
- public string Directory { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
- /// program that applies
- /// the patch.
- ///
- /// </summary>
- public bool Reject { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Run interactively.
- ///
- /// </summary>
- public bool Interactive { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// By default the command records the date from the e-mail
- /// message as the commit author date, and uses the time of
- /// commit creation as the committer date. This allows the
- /// user to lie about the committer date by using the same
- /// value as the author date.
- ///
- /// </summary>
- public bool CommitterDateIsAuthorDate { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// By default the command records the date from the e-mail
- /// message as the commit author date, and uses the time of
- /// commit creation as the committer date. This allows the
- /// user to lie about the author date by using the same
- /// value as the committer date.
- ///
- /// </summary>
- public bool IgnoreDate { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Skip the current patch. This is only meaningful when
- /// restarting an aborted patch.
- ///
- /// </summary>
- public bool Skip { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// After a patch failure (e.g. attempting to apply
- /// conflicting patch), the user has applied it by hand and
- /// the index file stores the result of the application.
- /// Make a commit using the authorship and commit log
- /// extracted from the e-mail message and the current index
- /// file, and continue.
- ///
- /// </summary>
- public bool Resolved { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When a patch failure occurs, &lt;msg&gt; will be printed
- /// to the screen before exiting. This overrides the
- /// standard message informing you to use `--resolved`
- /// or `--skip` to handle the failure. This is solely
- /// for internal use between 'git-rebase' and 'git-am'.
- ///
- /// </summary>
- public string Resolvemsg { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Restore the original branch and abort the patching operation.
- /// </summary>
- public bool Abort { get; set; }
-
- #endregion
-
- public override void Execute()
- {
- throw new NotImplementedException();
- }
- }
-}
View
232 GitSharp/Commands/AnnotateCommand.cs
@@ -1,232 +0,0 @@
-/*
- * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp.Commands
-{
- public class AnnotateCommand
- : AbstractCommand
- {
-
- public AnnotateCommand() {
- }
-
- // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
-
- #region Properties / Options
- public List<string> Arguments { get; set; }
- /// <summary>
- /// Not implemented
- ///
- /// Show blank SHA-1 for boundary commits. This can also
- /// be controlled via the `blame.blankboundary` config option.
- ///
- /// </summary>
- public bool B { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Do not treat root commits as boundaries. This can also be
- /// controlled via the `blame.showroot` config option.
- ///
- /// </summary>
- public bool Root { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Include additional statistics at the end of blame output.
- ///
- /// </summary>
- public bool ShowStats { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Annotate only the given line range. &lt;start&gt; and &lt;end&gt; can take
- /// one of these forms:
- ///
- /// </summary>
- public string L { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show long rev (Default: off).
- ///
- /// </summary>
- public bool l { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show raw timestamp (Default: off).
- ///
- /// </summary>
- public bool T { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Use revisions from revs-file instead of calling linkgit:git-rev-list[1].
- ///
- /// </summary>
- public string S { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Walk history forward instead of backward. Instead of showing
- /// the revision in which a line appeared, this shows the last
- /// revision in which a line has existed. This requires a range of
- /// revision like START..END where the path to blame exists in
- /// START.
- ///
- /// </summary>
- public bool Reverse { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show in a format designed for machine consumption.
- ///
- /// </summary>
- public bool Porcelain { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show the result incrementally in a format designed for
- /// machine consumption.
- ///
- /// </summary>
- public bool Incremental { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Specifies the encoding used to output author names
- /// and commit summaries. Setting it to `none` makes blame
- /// output unconverted data. For more information see the
- /// discussion about encoding in the linkgit:git-log[1]
- /// manual page.
- ///
- /// </summary>
- public string Encoding { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When &lt;rev&gt; is not specified, the command annotates the
- /// changes starting backwards from the working tree copy.
- /// This flag makes the command pretend as if the working
- /// tree copy has the contents of the named file (specify
- /// `-` to make the command read from the standard input).
- ///
- /// </summary>
- public string Contents { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// The value is one of the following alternatives:
- /// {relative,local,default,iso,rfc,short}. If --date is not
- /// provided, the value of the blame.date config variable is
- /// used. If the blame.date config variable is also not set, the
- /// iso format is used. For more information, See the discussion
- /// of the --date option at linkgit:git-log[1].
- ///
- /// </summary>
- public string Date { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Detect moving lines in the file as well. When a commit
- /// moves a block of lines in a file (e.g. the original file
- /// has A and then B, and the commit changes it to B and
- /// then A), the traditional 'blame' algorithm typically blames
- /// the lines that were moved up (i.e. B) to the parent and
- /// assigns blame to the lines that were moved down (i.e. A)
- /// to the child commit. With this option, both groups of lines
- /// are blamed on the parent.
- /// +
- /// alphanumeric characters that git must detect as moving
- /// within a file for it to associate those lines with the parent
- /// commit.
- ///
- /// </summary>
- public string M { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// In addition to `-M`, detect lines copied from other
- /// files that were modified in the same commit. This is
- /// useful when you reorganize your program and move code
- /// around across files. When this option is given twice,
- /// the command additionally looks for copies from all other
- /// files in the parent for the commit that creates the file.
- /// +
- /// alphanumeric characters that git must detect as moving
- /// between files for it to associate those lines with the parent
- /// commit.
- ///
- /// </summary>
- public string C { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show help message.
- /// </summary>
- public bool Help { get; set; }
-
- #endregion
-
- public override void Execute()
- {
- throw new NotImplementedException();
- }
- }
-}
View
332 GitSharp/Commands/ApplyCommand.cs
@@ -1,332 +0,0 @@
-/*
- * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp.Commands
-{
- public class ApplyCommand
- : AbstractCommand
- {
-
- public ApplyCommand() {
- }
-
- // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
-
- #region Properties / Options
- public List<string> Arguments { get; set; }
- /// <summary>
- /// Not implemented
- ///
- /// Instead of applying the patch, output diffstat for the
- /// input. Turns off "apply".
- ///
- /// </summary>
- public bool Stat { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Similar to `--stat`, but shows the number of added and
- /// deleted lines in decimal notation and the pathname without
- /// abbreviation, to make it more machine friendly. For
- /// binary files, outputs two `-` instead of saying
- /// `0 0`. Turns off "apply".
- ///
- /// </summary>
- public bool Numstat { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Instead of applying the patch, output a condensed
- /// summary of information obtained from git diff extended
- /// headers, such as creations, renames and mode changes.
- /// Turns off "apply".
- ///
- /// </summary>
- public bool Summary { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Instead of applying the patch, see if the patch is
- /// applicable to the current working tree and/or the index
- /// file and detects errors. Turns off "apply".
- ///
- /// </summary>
- public bool Check { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When `--check` is in effect, or when applying the patch
- /// (which is the default when none of the options that
- /// disables it is in effect), make sure the patch is
- /// applicable to what the current index file records. If
- /// the file to be patched in the working tree is not
- /// up-to-date, it is flagged as an error. This flag also
- /// causes the index file to be updated.
- ///
- /// </summary>
- public bool Index { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Apply a patch without touching the working tree. Instead take the
- /// cached data, apply the patch, and store the result in the index
- /// without using the working tree. This implies `--index`.
- ///
- /// </summary>
- public bool Cached { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Newer 'git-diff' output has embedded 'index information'
- /// for each blob to help identify the original version that
- /// the patch applies to. When this flag is given, and if
- /// the original versions of the blobs are available locally,
- /// builds a temporary index containing those blobs.
- /// +
- /// When a pure mode change is encountered (which has no index information),
- /// the information is read from the current index instead.
- ///
- /// </summary>
- public string BuildFakeAncestor { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Apply the patch in reverse.
- ///
- /// </summary>
- public bool Reverse { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// For atomicity, 'git-apply' by default fails the whole patch and
- /// does not touch the working tree when some of the hunks
- /// do not apply. This option makes it apply
- /// the parts of the patch that are applicable, and leave the
- /// rejected hunks in corresponding *.rej files.
- ///
- /// </summary>
- public bool Reject { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When `--numstat` has been given, do not munge pathnames,
- /// but use a NUL-terminated machine-readable format.
- /// +
- /// Without this option, each pathname output will have TAB, LF, double quotes,
- /// and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`,
- /// respectively, and the pathname will be enclosed in double quotes if
- /// any of those replacements occurred.
- ///
- /// </summary>
- public bool Z { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Remove &lt;n&gt; leading slashes from traditional diff paths. The
- /// default is 1.
- ///
- /// </summary>
- public string P { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Ensure at least &lt;n&gt; lines of surrounding context match before
- /// and after each change. When fewer lines of surrounding
- /// context exist they all must match. By default no context is
- /// ever ignored.
- ///
- /// </summary>
- public string C { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// By default, 'git-apply' expects that the patch being
- /// applied is a unified diff with at least one line of context.
- /// This provides good safety measures, but breaks down when
- /// applying a diff generated with `--unified=0`. To bypass these
- /// checks use `--unidiff-zero`.
- /// +
- /// Note, for the reasons stated above usage of context-free patches is
- /// discouraged.
- ///
- /// </summary>
- public bool UnidiffZero { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// If you use any of the options marked "Turns off
- /// 'apply'" above, 'git-apply' reads and outputs the
- /// requested information without actually applying the
- /// patch. Give this flag after those flags to also apply
- /// the patch.
- ///
- /// </summary>
- public bool Apply { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When applying a patch, ignore additions made by the
- /// patch. This can be used to extract the common part between
- /// two files by first running 'diff' on them and applying
- /// the result with this option, which would apply the
- /// deletion part but not the addition part.
- ///
- /// </summary>
- public bool NoAdd { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Historically we did not allow binary patch applied
- /// without an explicit permission from the user, and this
- /// flag was the way to do so. Currently we always allow binary
- /// patch application, so this is a no-op.
- ///
- /// </summary>
- public bool AllowBinaryReplacement { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Historically we did not allow binary patch applied
- /// without an explicit permission from the user, and this
- /// flag was the way to do so. Currently we always allow binary
- /// patch application, so this is a no-op.
- ///
- /// </summary>
- public bool Binary { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Don't apply changes to files matching the given path pattern. This can
- /// be useful when importing patchsets, where you want to exclude certain
- /// files or directories.
- ///
- /// </summary>
- public string Exclude { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Apply changes to files matching the given path pattern. This can
- /// be useful when importing patchsets, where you want to include certain
- /// files or directories.
- /// +
- /// When `--exclude` and `--include` patterns are used, they are examined in the
- /// order they appear on the command line, and the first match determines if a
- /// patch to each path is used. A patch to a path that does not match any
- /// on the command line, and ignored if there is any include pattern.
- ///
- /// </summary>
- public string Include { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When applying a patch, ignore changes in whitespace in context
- /// lines if necessary.
- /// Context lines will preserve their whitespace, and they will not
- /// undergo whitespace fixing regardless of the value of the
- /// `--whitespace` option. New lines will still be fixed, though.
- ///
- /// </summary>
- public bool IgnoreSpaceChange { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When applying a patch, ignore changes in whitespace in context
- /// lines if necessary.
- /// Context lines will preserve their whitespace, and they will not
- /// undergo whitespace fixing regardless of the value of the
- /// `--whitespace` option. New lines will still be fixed, though.
- ///
- /// </summary>
- public bool IgnoreWhitespace { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// When applying a patch, detect a new or modified line that has
- /// whitespace errors. What are considered whitespace errors is
- /// controlled by `core.whitespace` configuration. By default,
- /// trailing whitespaces (including lines that solely consist of
- /// whitespaces) and a space character that is immediately followed
- /// by a tab character inside the initial indent of the line are
- /// considered whitespace errors.
- /// +
- /// By default, the command outputs warning messages but applies the patch.
- /// When `git-apply` is used for statistics and not applying a
- /// patch, it defaults to `nowarn`.
- /// +
- /// You can use different `&lt;action&gt;` values to control this
- /// behavior:
- /// +
- /// * `nowarn` turns off the trailing whitespace warning.
- /// * `warn` outputs warnings for a few such errors, but applies the
- /// </summary>
- public string Whitespace { get; set; }
-
- #endregion
-
- public override void Execute()
- {
- throw new NotImplementedException();
- }
- }
-}
View
134 GitSharp/Commands/ArchiveCommand.cs
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * - Neither the name of the Git Development Community nor the
- * names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace GitSharp.Commands
-{
- public class ArchiveCommand
- : AbstractCommand
- {
-
- public ArchiveCommand() {
- }
-
- // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
-
- #region Properties / Options
- public List<string> Arguments { get; set; }
- /// <summary>
- /// Not implemented
- ///
- /// Format of the resulting archive: 'tar' or 'zip'. If this option
- /// is not given, and the output file is specified, the format is
- /// inferred from the filename if possible (e.g. writing to "foo.zip"
- /// makes the output to be in the zip format). Otherwise the output
- /// format is `tar`.
- ///
- /// </summary>
- public string Format { get; set; }
-
- /// <summary>
- /// Not implemented
- ///
- /// Show all