2 * Copyright (C) 2010, Dominique van de Vorle <dvdvorle@gmail.com>
6 * Redistribution and use in source and binary forms, with or
7 * without modification, are permitted provided that the following
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * - Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * - Neither the name of the Git Development Community nor the
19 * names of its contributors may be used to endorse or promote
20 * products derived from this software without specific prior
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 using System
.Collections
.Generic
;
44 namespace GitSharp
.Commands
46 public class RevParseCommand
50 public RevParseCommand() {
53 // note: the naming of command parameters is not following .NET conventions in favour of git command line parameter naming conventions.
55 #region Properties / Options
56 public List
<string> Arguments { get; set; }
60 /// Use 'git-rev-parse' in option parsing mode (see PARSEOPT section below).
63 public bool Parseopt { get; set; }
68 /// Only meaningful in `--parseopt` mode. Tells the option parser to echo
69 /// out the first `--` met instead of skipping it.
72 public bool KeepDashdash { get; set; }
77 /// Only meaningful in `--parseopt` mode. Lets the option parser stop at
78 /// the first non-option argument. This can be used to parse sub-commands
79 /// that take options themself.
82 public bool StopAtNonOption { get; set; }
87 /// Use 'git-rev-parse' in shell quoting mode (see SQ-QUOTE
88 /// section below). In contrast to the `--sq` option below, this
89 /// mode does only quoting. Nothing else is done to command input.
92 public bool SqQuote { get; set; }
97 /// Do not output flags and parameters not meant for
98 /// 'git-rev-list' command.
101 public bool RevsOnly { get; set; }
106 /// Do not output flags and parameters meant for
107 /// 'git-rev-list' command.
110 public bool NoRevs { get; set; }
115 /// Do not output non-flag parameters.
118 public bool Flags { get; set; }
123 /// Do not output flag parameters.
126 public bool NoFlags { get; set; }
131 /// If there is no parameter given by the user, use `<arg>`
135 public string Default { get; set; }
140 /// The parameter given must be usable as a single, valid
141 /// object name. Otherwise barf and abort.
144 public bool Verify { get; set; }
149 /// Only meaningful in `--verify` mode. Do not output an error
150 /// message if the first argument is not a valid object name;
151 /// instead exit with non-zero status silently.
154 public bool Quiet { get; set; }
159 /// Usually the output is made one line per flag and
160 /// parameter. This option makes output a single line,
161 /// properly quoted for consumption by shell. Useful when
162 /// you expect your parameter to contain whitespaces and
163 /// newlines (e.g. when using pickaxe `-S` with
164 /// 'git-diff-\*'). In contrast to the `--sq-quote` option,
165 /// the command input is still interpreted as usual.
168 public bool Sq { get; set; }
173 /// When showing object names, prefix them with '{caret}' and
174 /// strip '{caret}' prefix from the object names that already have
178 public bool Not { get; set; }
183 /// Usually the object names are output in SHA1 form (with
184 /// possible '{caret}' prefix); this option makes them output in a
185 /// form as close to the original input as possible.
188 public bool Symbolic { get; set; }
193 /// This is similar to \--symbolic, but it omits input that
194 /// are not refs (i.e. branch or tag names; or more
195 /// explicitly disambiguating "heads/master" form, when you
196 /// want to name the "master" branch when there is an
197 /// unfortunately named tag "master"), and show them as full
198 /// refnames (e.g. "refs/heads/master").
201 public bool SymbolicFullName { get; set; }
206 /// A non-ambiguous short name of the objects name.
207 /// The option core.warnAmbiguousRefs is used to select the strict
208 /// abbreviation mode.
211 public string AbbrevRef { get; set; }
216 /// Show all refs found in `$GIT_DIR/refs`.
219 public bool All { get; set; }
224 /// Show branch refs found in `$GIT_DIR/refs/heads`.
227 public bool Branches { get; set; }
232 /// Show tag refs found in `$GIT_DIR/refs/tags`.
235 public bool Tags { get; set; }
240 /// Show tag refs found in `$GIT_DIR/refs/remotes`.
243 public bool Remotes { get; set; }
248 /// When the command is invoked from a subdirectory, show the
249 /// path of the current directory relative to the top-level
253 public bool ShowPrefix { get; set; }
258 /// When the command is invoked from a subdirectory, show the
259 /// path of the top-level directory relative to the current
260 /// directory (typically a sequence of "../", or an empty string).
263 public bool ShowCdup { get; set; }
268 /// Show `$GIT_DIR` if defined else show the path to the .git directory.
271 public bool GitDir { get; set; }
276 /// When the current working directory is below the repository
277 /// directory print "true", otherwise "false".
280 public bool IsInsideGitDir { get; set; }
285 /// When the current working directory is inside the work tree of the
286 /// repository print "true", otherwise "false".
289 public bool IsInsideWorkTree { get; set; }
294 /// When the repository is bare print "true", otherwise "false".
297 public bool IsBareRepository { get; set; }
300 ///// Not implemented
302 ///// Instead of outputting the full SHA1 values of object names try to
303 ///// abbreviate them to a shorter unique name. When no length is specified
304 ///// 7 is used. The minimum length is 4.
307 //public bool Short { get; set; }
312 /// Instead of outputting the full SHA1 values of object names try to
313 /// abbreviate them to a shorter unique name. When no length is specified
314 /// 7 is used. The minimum length is 4.
317 public string Short { get; set; }
322 /// Parse the date string, and output the corresponding
323 /// --max-age= parameter for 'git-rev-list'.
326 public string Since { get; set; }
331 /// Parse the date string, and output the corresponding
332 /// --max-age= parameter for 'git-rev-list'.
335 public string After { get; set; }
340 /// Parse the date string, and output the corresponding
341 /// --min-age= parameter for 'git-rev-list'.
344 public string Until { get; set; }
349 /// Parse the date string, and output the corresponding
350 /// --min-age= parameter for 'git-rev-list'.
353 public string Before { get; set; }
357 public override void Execute()
359 throw new NotImplementedException();