fpm_git Module

Implementation for interacting with git repositories.



Contents


Variables

Type Visibility Attributes Name Initial
character(len=*), public, parameter :: compressed_package_name = 'compressed_package'

Name of the compressed package that is generated temporarily.

type(enum_descriptor), public, parameter :: git_descriptor = enum_descriptor()

Actual enumerator for descriptors

character(len=*), public, parameter :: out_fmt = '("#", *(1x, g0))'

Common output format for writing to the command line


Interfaces

public interface operator(==)

  • public function git_target_eq(this, that) result(is_equal)

    Check that two git targets are equal

    Arguments

    Type IntentOptional Attributes Name
    type(git_target_t), intent(in) :: this

    Two input git targets

    type(git_target_t), intent(in) :: that

    Two input git targets

    Return Value logical


Derived Types

type, public ::  enum_descriptor

Possible git target

Components

Type Visibility Attributes Name Initial
integer, public :: branch = 201

Branch in git repository

integer, public :: default = 200

Default target

integer, public :: revision = 203

Commit hash

integer, public :: tag = 202

Tag in git repository

type, public ::  git_target_t

Description of an git target

Components

Type Visibility Attributes Name Initial
integer, public :: descriptor = git_descriptor%default

Kind of the git target

character(len=:), public, allocatable :: object

Additional descriptor of the git object

character(len=:), public, allocatable :: url

Target URL of the git repository

Type-Bound Procedures

procedure , public , :: checkout Subroutine

Fetch and checkout in local directory

procedure , public , :: info Subroutine

Show information on instance


Functions

public function git_matches_manifest(cached, manifest, verbosity, iunit)

Check that a cached dependency matches a manifest request

Read more…

Arguments

Type IntentOptional Attributes Name
type(git_target_t), intent(in) :: cached

Two input git targets

type(git_target_t), intent(in) :: manifest

Two input git targets

integer, intent(in) :: verbosity
integer, intent(in) :: iunit

Return Value logical

public function git_target_branch(url, branch) result(self)

Target a branch in the git repository

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: url

Target URL of the git repository

character(len=*), intent(in) :: branch

Name of the branch of interest

Return Value type(git_target_t)

New git target

public function git_target_default(url) result(self)

Default target

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: url

Target URL of the git repository

Return Value type(git_target_t)

New git target

public function git_target_eq(this, that) result(is_equal)

Check that two git targets are equal

Arguments

Type IntentOptional Attributes Name
type(git_target_t), intent(in) :: this

Two input git targets

type(git_target_t), intent(in) :: that

Two input git targets

Return Value logical

public function git_target_revision(url, sha1) result(self)

Target a specific git revision

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: url

Target URL of the git repository

character(len=*), intent(in) :: sha1

Commit hash of interest

Return Value type(git_target_t)

New git target

public function git_target_tag(url, tag) result(self)

Target a git tag

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: url

Target URL of the git repository

character(len=*), intent(in) :: tag

Tag name of interest

Return Value type(git_target_t)

New git target


Subroutines

public subroutine checkout(self, local_path, error)

Arguments

Type IntentOptional Attributes Name
class(git_target_t), intent(in) :: self

Instance of the git target

character(len=*), intent(in) :: local_path

Local path to checkout in

type(error_t), intent(out), allocatable :: error

Error

public subroutine git_archive(source, destination, ref, verbose, error)

Archive a folder using git archive.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: source

Directory to archive.

character(len=*), intent(in) :: destination

Destination of the archive.

character(len=*), intent(in) :: ref

(Symbolic) Reference to be archived.

logical, intent(in) :: verbose

Print additional information if true.

type(error_t), intent(out), allocatable :: error

Error handling.

public subroutine git_revision(local_path, object, error)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: local_path

Local path to checkout in

character(len=:), intent(out), allocatable :: object

Git object reference

type(error_t), intent(out), allocatable :: error

Error

public subroutine info(self, unit, verbosity)

Show information on git target

Arguments

Type IntentOptional Attributes Name
class(git_target_t), intent(in) :: self

Instance of the git target

integer, intent(in) :: unit

Unit for IO

integer, intent(in), optional :: verbosity

Verbosity of the printout