<commit_before>/*
 * ggit-repository.h
 * This file is part of libgit2-glib
 *
 * Copyright (C) 2011 - <NAME>
 *
 * libgit2-glib is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * libgit2-glib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __GGIT_REPOSITORY_H__
#define __GGIT_REPOSITORY_H__

#include <glib-object.h>
#include <git2.h>
#include <gio/gio.h>
#include <libgit2-glib/ggit-config.h>
#include <libgit2-glib/ggit-index.h>
#include <libgit2-glib/ggit-types.h>
#include <libgit2-glib/ggit-native.h>
#include <libgit2-glib/ggit-object.h>
#include <libgit2-glib/ggit-tree.h>
#include <libgit2-glib/ggit-branch.h>
#include <libgit2-glib/ggit-blob-output-stream.h>
#include <libgit2-glib/ggit-checkout-options.h>
#include <libgit2-glib/ggit-note.h>
#include <libgit2-glib/ggit-blame.h>
#include <libgit2-glib/ggit-cherry-pick-options.h>
#include <libgit2-glib/ggit-commit.h>
#include <libgit2-glib/ggit-tree-builder.h>
#include <libgit2-glib/ggit-remote.h>
#include <libgit2-glib/ggit-rebase.h>
#include <libgit2-glib/ggit-blob.h>
#include <libgit2-glib/ggit-tag.h>

G_BEGIN_DECLS

#define GGIT_TYPE_REPOSITORY			(ggit_repository_get_type ())
#define GGIT_REPOSITORY(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_REPOSITORY, GgitRepository))
#define GGIT_REPOSITORY_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), GGIT_TYPE_REPOSITORY, GgitRepositoryClass))
#define GGIT_IS_REPOSITORY(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GGIT_TYPE_REPOSITORY))
#define GGIT_IS_REPOSITORY_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((klass), GGIT_TYPE_REPOSITORY))
#define GGIT_REPOSITORY_GET_CLASS(obj)		(G_TYPE_INSTANCE_GET_CLASS ((obj), GGIT_TYPE_REPOSITORY, GgitRepositoryClass))

typedef struct _GgitRepositoryClass	GgitRepositoryClass;

struct _GgitRepository
{
	/*< private >*/
	GgitNative parent;
};

/**
 * GgitRepositoryClass:
 * @parent_class: The parent class.
 *
 * The class structure for #GgitRepositoryClass.
 */
struct _GgitRepositoryClass
{
	/*< private >*/
	GgitNativeClass parent_class;
};

GType               ggit_repository_get_type          (void) G_GNUC_CONST;

GgitRepository     *_ggit_repository_wrap             (git_repository        *repository,
                                                       gboolean               owned);

git_repository     *_ggit_repository_get_repository   (GgitRepository        *repository);

GgitRepository     *ggit_repository_open              (GFile                 *location,
                                                       GError               **error);

GgitRepository     *ggit_repository_init_repository   (GFile                 *location,
                                                       gboolean               is_bare,
                                                       GError               **error);

GgitRepository     *ggit_repository_clone             (const gchar           *url,
                                                       GFile                 *location,
                                                       GgitCloneOptions      *options,
                                                       GError               **error);

GgitObject         *ggit_repository_lookup            (GgitRepository        *repository,
                                                       GgitOId               *oid,
                                                       GType                  gtype,
                                                       GError               **error);

GgitRef            *ggit_repository_lookup_reference  (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       GError               **error);

GgitRef            *ggit_repository_lookup_reference_dwim  (GgitRepository        *repository,
                                                            const gchar           *short_name,
                                                            GError               **error);

GgitRef            *ggit_repository_create_reference  (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       GgitOId               *oid,
                                                       const gchar           *log_message,
                                                       GError               **error);

GgitRef            *ggit_repository_create_symbolic_reference
                                                      (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       const gchar           *target,
                                                       const gchar           *log_message,
                                                       GError               **error);

GgitBlobOutputStream *
                    ggit_repository_create_blob       (GgitRepository        *repository);


GgitOId            *ggit_repository_create_blob_from_buffer (
                                                       GgitRepository        *repository,
                                                       gconstpointer          buffer,
                                                       gsize                  size,
                                                       GError               **error);

GgitOId            *ggit_repository_create_blob_from_file (
                                                       GgitRepository        *repository,
                                                       GFile                 *file,
                                                       GError               **error);

GgitOId            *ggit_repository_create_blob_from_path (
                                                       GgitRepository        *repository,
                                                       const gchar           *path,
                                                       GError               **error);

GgitOId            *ggit_repository_create_commit     (GgitRepository        *repository,
                                                       const gchar           *update_ref,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitTree              *tree,
                                                       GgitCommit           **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

GgitOId            *ggit_repository_create_commit_from_ids (
                                                       GgitRepository        *repository,
                                                       const gchar           *update_ref,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitOId               *tree,
                                                       GgitOId              **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

gchar                *ggit_repository_create_commit_buffer (
                                                       GgitRepository        *repository,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitTree              *tree,
                                                       GgitCommit           **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

GgitOId      *ggit_repository_create_commit_with_signature (
                                                       GgitRepository  *repository,
                                                       const gchar     *commit_content,
                                                       const gchar     *signature,
                                                       const gchar     *signature_field,
                                                       GError         **error);

GgitOId            *ggit_repository_create_tag        (GgitRepository        *repository,
                                                       const gchar           *tag_name,
                                                       GgitObject            *target,
                                                       GgitSignature         *tagger,
                                                       const gchar           *message,<commit_msg>formatting<commit_after>/*
 * ggit-repository.h
 * This file is part of libgit2-glib
 *
 * Copyright (C) 2011 - <NAME>
 *
 * libgit2-glib is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * libgit2-glib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __GGIT_REPOSITORY_H__
#define __GGIT_REPOSITORY_H__

#include <glib-object.h>
#include <git2.h>
#include <gio/gio.h>
#include <libgit2-glib/ggit-config.h>
#include <libgit2-glib/ggit-index.h>
#include <libgit2-glib/ggit-types.h>
#include <libgit2-glib/ggit-native.h>
#include <libgit2-glib/ggit-object.h>
#include <libgit2-glib/ggit-tree.h>
#include <libgit2-glib/ggit-branch.h>
#include <libgit2-glib/ggit-blob-output-stream.h>
#include <libgit2-glib/ggit-checkout-options.h>
#include <libgit2-glib/ggit-note.h>
#include <libgit2-glib/ggit-blame.h>
#include <libgit2-glib/ggit-cherry-pick-options.h>
#include <libgit2-glib/ggit-commit.h>
#include <libgit2-glib/ggit-tree-builder.h>
#include <libgit2-glib/ggit-remote.h>
#include <libgit2-glib/ggit-rebase.h>
#include <libgit2-glib/ggit-blob.h>
#include <libgit2-glib/ggit-tag.h>

G_BEGIN_DECLS

#define GGIT_TYPE_REPOSITORY			(ggit_repository_get_type ())
#define GGIT_REPOSITORY(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_REPOSITORY, GgitRepository))
#define GGIT_REPOSITORY_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST ((klass), GGIT_TYPE_REPOSITORY, GgitRepositoryClass))
#define GGIT_IS_REPOSITORY(obj)			(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GGIT_TYPE_REPOSITORY))
#define GGIT_IS_REPOSITORY_CLASS(klass)		(G_TYPE_CHECK_CLASS_TYPE ((klass), GGIT_TYPE_REPOSITORY))
#define GGIT_REPOSITORY_GET_CLASS(obj)		(G_TYPE_INSTANCE_GET_CLASS ((obj), GGIT_TYPE_REPOSITORY, GgitRepositoryClass))

typedef struct _GgitRepositoryClass	GgitRepositoryClass;

struct _GgitRepository
{
	/*< private >*/
	GgitNative parent;
};

/**
 * GgitRepositoryClass:
 * @parent_class: The parent class.
 *
 * The class structure for #GgitRepositoryClass.
 */
struct _GgitRepositoryClass
{
	/*< private >*/
	GgitNativeClass parent_class;
};

GType               ggit_repository_get_type          (void) G_GNUC_CONST;

GgitRepository     *_ggit_repository_wrap             (git_repository        *repository,
                                                       gboolean               owned);

git_repository     *_ggit_repository_get_repository   (GgitRepository        *repository);

GgitRepository     *ggit_repository_open              (GFile                 *location,
                                                       GError               **error);

GgitRepository     *ggit_repository_init_repository   (GFile                 *location,
                                                       gboolean               is_bare,
                                                       GError               **error);

GgitRepository     *ggit_repository_clone             (const gchar           *url,
                                                       GFile                 *location,
                                                       GgitCloneOptions      *options,
                                                       GError               **error);

GgitObject         *ggit_repository_lookup            (GgitRepository        *repository,
                                                       GgitOId               *oid,
                                                       GType                  gtype,
                                                       GError               **error);

GgitRef            *ggit_repository_lookup_reference  (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       GError               **error);

GgitRef            *ggit_repository_lookup_reference_dwim  (GgitRepository        *repository,
                                                            const gchar           *short_name,
                                                            GError               **error);

GgitRef            *ggit_repository_create_reference  (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       GgitOId               *oid,
                                                       const gchar           *log_message,
                                                       GError               **error);

GgitRef            *ggit_repository_create_symbolic_reference
                                                      (GgitRepository        *repository,
                                                       const gchar           *name,
                                                       const gchar           *target,
                                                       const gchar           *log_message,
                                                       GError               **error);

GgitBlobOutputStream *
                    ggit_repository_create_blob       (GgitRepository        *repository);


GgitOId            *ggit_repository_create_blob_from_buffer (
                                                       GgitRepository        *repository,
                                                       gconstpointer          buffer,
                                                       gsize                  size,
                                                       GError               **error);

GgitOId            *ggit_repository_create_blob_from_file (
                                                       GgitRepository        *repository,
                                                       GFile                 *file,
                                                       GError               **error);

GgitOId            *ggit_repository_create_blob_from_path (
                                                       GgitRepository        *repository,
                                                       const gchar           *path,
                                                       GError               **error);

GgitOId                    *ggit_repository_create_commit (
                                                       GgitRepository        *repository,
                                                       const gchar           *update_ref,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitTree              *tree,
                                                       GgitCommit           **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

GgitOId            *ggit_repository_create_commit_from_ids (
                                                       GgitRepository        *repository,
                                                       const gchar           *update_ref,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitOId               *tree,
                                                       GgitOId              **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

gchar                *ggit_repository_create_commit_buffer (
                                                       GgitRepository        *repository,
                                                       GgitSignature         *author,
                                                       GgitSignature         *committer,
                                                       const gchar           *message_encoding,
                                                       const gchar           *message,
                                                       GgitTree              *tree,
                                                       GgitCommit           **parents,
                                                       gint                   parent_count,
                                                       GError               **error);

GgitOId      *ggit_repository_create_commit_with_signature (
                                                       GgitRepository  *repository,
                                                       const gchar     *commit_content,
                                                       const gchar     *signature,
                                                       const gchar     *signature_field,
                                                       GError         **error);

GgitOId                        *ggit_repository_create_tag (
                                                       GgitRepository        *repository,
                                                       const gchar           *tag_name,
                                                       GgitObject            *target,
                                                       GgitSignature         *tagger,
                                                       const gchar           *message,
{'fraction_non_alphanumeric': 0.05149966245539589, 'fraction_numerical': 0.0027967981483267433, 'mean_word_length': 0.8106338397066527, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 284, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7462236', 'n_tokens_mistral': 4046, 'n_tokens_neox': 3997, 'n_words': 881}