<commit_before>using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Handles;

namespace LibGit2Sharp
{
    /// <summary>
    /// A Commit
    /// </summary>
    [DebuggerDisplay("{DebuggerDisplay,nq}")]
    public class Commit : GitObject
    {
        private readonly GitObjectLazyGroup group1;
        private readonly GitObjectLazyGroup group2;
        private readonly ILazy<Tree> lazyTree;
        private readonly ILazy<Signature> lazyAuthor;
        private readonly ILazy<Signature> lazyCommitter;
        private readonly ILazy<string> lazyMessage;
        private readonly ILazy<string> lazyMessageShort;
        private readonly ILazy<string> lazyEncoding;

        private readonly ParentsCollection parents;
        private readonly Lazy<IEnumerable<Note>> lazyNotes;

        /// <summary>
        /// Needed for mocking purposes.
        /// </summary>
        protected Commit()
        { }

        internal Commit(Repository repo, ObjectId id)
            : base(repo, id)
        {
            lazyTree = GitObjectLazyGroup.Singleton(this.repo, id, obj => new Tree(this.repo, Proxy.git_commit_tree_id(obj), null));

            group1 = new GitObjectLazyGroup(this.repo, id);
            lazyAuthor = group1.AddLazy(Proxy.git_commit_author);
            lazyCommitter = group1.AddLazy(Proxy.git_commit_committer);
            group2 = new GitObjectLazyGroup(this.repo, id);
            lazyMessage = group2.AddLazy(Proxy.git_commit_message);
            lazyMessageShort = group2.AddLazy(Proxy.git_commit_summary);
            lazyEncoding = group2.AddLazy(RetrieveEncodingOf);

            lazyNotes = new Lazy<IEnumerable<Note>>(() => RetrieveNotesOfCommit(id).ToList());

            parents = new ParentsCollection(repo, id);
        }

        /// <summary>
        /// Gets the <see cref="TreeEntry"/> pointed at by the <paramref name="relativePath"/> in the <see cref="Tree"/>.
        /// </summary>
        /// <param name="relativePath">The relative path to the <see cref="TreeEntry"/> from the <see cref="Commit"/> working directory.</param>
        /// <returns><c>null</c> if nothing has been found, the <see cref="TreeEntry"/> otherwise.</returns>
        public virtual TreeEntry this[string relativePath]
        {
            get { return Tree[relativePath]; }
        }

        /// <summary>
        /// Gets the commit message.
        /// </summary>
        public virtual string Message { get { return lazyMessage.Value; } }<commit_msg>Adjusted Commit indexer xml doc see and fixes #966<commit_after>using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Handles;

namespace LibGit2Sharp
{
    /// <summary>
    /// A Commit
    /// </summary>
    [DebuggerDisplay("{DebuggerDisplay,nq}")]
    public class Commit : GitObject
    {
        private readonly GitObjectLazyGroup group1;
        private readonly GitObjectLazyGroup group2;
        private readonly ILazy<Tree> lazyTree;
        private readonly ILazy<Signature> lazyAuthor;
        private readonly ILazy<Signature> lazyCommitter;
        private readonly ILazy<string> lazyMessage;
        private readonly ILazy<string> lazyMessageShort;
        private readonly ILazy<string> lazyEncoding;

        private readonly ParentsCollection parents;
        private readonly Lazy<IEnumerable<Note>> lazyNotes;

        /// <summary>
        /// Needed for mocking purposes.
        /// </summary>
        protected Commit()
        { }

        internal Commit(Repository repo, ObjectId id)
            : base(repo, id)
        {
            lazyTree = GitObjectLazyGroup.Singleton(this.repo, id, obj => new Tree(this.repo, Proxy.git_commit_tree_id(obj), null));

            group1 = new GitObjectLazyGroup(this.repo, id);
            lazyAuthor = group1.AddLazy(Proxy.git_commit_author);
            lazyCommitter = group1.AddLazy(Proxy.git_commit_committer);
            group2 = new GitObjectLazyGroup(this.repo, id);
            lazyMessage = group2.AddLazy(Proxy.git_commit_message);
            lazyMessageShort = group2.AddLazy(Proxy.git_commit_summary);
            lazyEncoding = group2.AddLazy(RetrieveEncodingOf);

            lazyNotes = new Lazy<IEnumerable<Note>>(() => RetrieveNotesOfCommit(id).ToList());

            parents = new ParentsCollection(repo, id);
        }

        /// <summary>
        /// Gets the <see cref="TreeEntry"/> pointed at by the <paramref name="relativePath"/> in the <see cref="Tree"/>.
        /// </summary>
        /// <param name="relativePath">Path to the <see cref="TreeEntry"/> from the tree in this <see cref="Commit"/></param>
        /// <returns><c>null</c> if nothing has been found, the <see cref="TreeEntry"/> otherwise.</returns>
        public virtual TreeEntry this[string relativePath]
        {
            get { return Tree[relativePath]; }
        }

        /// <summary>
        /// Gets the commit message.
        /// </summary>
        public virtual string Message { get { return lazyMessage.Value; } }
{'fraction_non_alphanumeric': 0.10988593155893536, 'fraction_numerical': 0.005133079847908745, 'mean_word_length': 2.6307798481711524, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6574536', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1415, 'n_words': 361}