Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CommitOptions.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c36fb43344b385d0ddf2e2cafd15bd46902e98e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibGit2Sharp
{
    /// <summary>
    /// Provides optional additional information to commit creation.
    /// By default, a new commit will be created (instead of amending the
    /// HEAD commit) and an empty commit which is unchanged from the current
    /// HEAD is disallowed.
    /// </summary>
    public sealed class CommitOptions
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CommitOptions"/> class.
        /// <para>
        ///   Default behavior:
        ///     The message is prettified.
        ///     No automatic removal of comments is performed.
        /// </para>
        /// </summary>
        public CommitOptions()
        {
            PrettifyMessage = true;
        }

        /// <summary>
        /// True to amend the current <see cref="Commit"/> pointed at by <see cref="Repository.Head"/>, false otherwise.
        /// </summary>
        public bool AmendPreviousCommit { get; set; }

        /// <summary>
        /// True to allow creation of an empty <see cref="Commit"/>, false otherwise.
        /// </summary>
        public bool AllowEmptyCommit { get; set; }

        /// <summary>
        /// True to prettify the message by stripping leading and trailing empty lines, trailing whitespace, and collapsing consecutive empty lines, false otherwise.
        /// </summary>
        public bool PrettifyMessage { get; set; }

        /// <summary>
        /// The starting line char used to identify commentaries in the Commit message during the prettifying of the Commit message. If set (usually to '#'), all lines starting with this char will be removed from the message before the Commit is done.
        /// This property will only be considered when PrettifyMessage is set to true.
        /// </summary>
        public char? CommentaryChar { get; set; }
    }
}