
git.pl -- Run GIT commands
This module performs common GIT tasks by calling git as a remote process
through process_create/3. It requires that the git executable is in the
current PATH.
This module started life in ClioPatria and has been used by the Prolog web-server to provide information on git repositories. It is now moved into the core Prolog library to support the Prolog package manager.
git(+Argv, +Options) is detinformational.output(Out), but messages are printed at level error.
git_process_output(+Argv, :OnOutput, +Options) is detcall(OnOutput, Stream).
git_open_file(+GitRepoDir, +File, +Branch, -Stream) is det
is_git_directory(+Directory) is semidet
git_describe(-Version, +Options) is semidetV*)HEAD
git_hash(-Hash, +Options) is det
is_git_hash(+Atom) is semidet
git_ls_tree(-Entries, +Options) is detobject(Mode, Type, Hash, Size, Name)
git_remote_url(+Remote, -URL, +Options) is det
git_ls_remote(+GitURL, -Refs, +Options) is detgit ls-remote against the remote repository to fetch
references from the remote. Options processed:
heads(Boolean)tags(Boolean)refs(List)
For example, to find the hash of the remote HEAD, one can use
?- git_ls_remote('git://www.swi-prolog.org/home/pl/git/pl-devel.git',
Refs, [refs(['HEAD'])]).
Refs = ['5d596c52aa969d88e7959f86327f5c7ff23695f3'-'HEAD'].
git_remote_branches(+GitURL, -Branches) is det
git_default_branch(-BranchName, +Options) is detrev-parse on
origin/HEAD. If not, we look at branches shared between the
local and remote and select main or master or the first common
breach. Options:
origin.
git_default_branch(-BranchName, +Options) is semidet
git_branches(-Branches, +Options) is det
git_tags(-Tags, +Options) is det
git_tags_on_branch(+Dir, +Branch, -Tags) is det
git_shortlog(+Dir, -ShortLog, +Options) is detpath, but Path is relative to the repository.
git_show(+Dir, +Hash, -Commit, +Options) is detstatThe following predicates are exported, but not or incorrectly documented.
git_current_branch(Arg1, Arg2)
git_commit_data(Arg1, Arg2, Arg3)
git_log_data(Arg1, Arg2, Arg3)