fpm_git Module

Implementation for interacting with git repositories.



Contents


Variables

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

Actual enumerator for descriptors


Derived Types

type, public :: enum_descriptor

Possible git target

Components

TypeVisibility AttributesNameInitial
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

TypeVisibility AttributesNameInitial
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

Fetch and checkout in local directory

procedure, public :: info

Show information on instance


Functions

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

Target a branch in the git repository

Arguments

Type IntentOptional AttributesName
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 AttributesName
character(len=*), intent(in) :: url

Target URL of the git repository

Return Value type(git_target_t)

New git target

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

Target a specific git revision

Arguments

Type IntentOptional AttributesName
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 AttributesName
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 AttributesName
class(git_target_t), intent(in) :: self

Instance of the git target

character, intent(in) :: local_path

Local path to checkout in

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

Error

public subroutine git_revision(local_path, object, error)

Arguments

Type IntentOptional AttributesName
character, 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 AttributesName
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