File: Git.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (123 lines) | stat: -rw-r--r-- 2,565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
TITLE:: Git
summary:: git interface
categories:: Frontends
related:: Classes/Quarks, Classes/Quark

DESCRIPTION::
An interface to the git toolchain. For more information on git, see link::http://git.io::.


CLASSMETHODS::



METHOD:: new
creates a new instance of code::Git::, pointing to an existing local git repository.
argument:: localPath
path to the git repository.


METHOD:: isGit
returns code::true::, if a local directory is a git repository.
argument:: localPath

METHOD:: checkForGit
returns code::true::, if the git toolchain is found on the system.


INSTANCEMETHODS::

subsection:: info

METHOD:: branch
returns:: current branch name.

METHOD:: remote, url
returns:: url of the first remote that it finds.

METHOD:: remoteAsHttpUrl
Detects if the remote URI starts with code::"git@":: or code::"git:":: and remodels it to a valid code::"https":: URI. Otherwise, it returns the unaltered remote.

code::
// git-style remote URI's are transformed to https
Git().url_("git@github.com:foo/bar.git").remoteAsHttpUrl;
Git().url_("https://github.com/foo/bar").remoteAsHttpUrl;
Git().url_("git@foo.net:foo/bar.git").remoteAsHttpUrl;

// http and https are left untouched
Git().url_("https://foo.org/bar").remoteAsHttpUrl;
Git().url_("http://foo.org/bar").remoteAsHttpUrl;

// unknown URI styles are left untouched
Git().url_("fooBar").remoteAsHttpUrl;
::

returns:: remote URI formatted for code::http:: respectively code::https:: requests.

METHOD:: remoteLatest
returns:: hash of latest commit on the remote

METHOD:: localPath
returns:: path to local repository

METHOD:: tag
returns:: currently checked out tag

METHOD:: tags
returns:: avaliable tags

METHOD:: sha
returns:: hash of the currently checked out version

METHOD:: shaForTag
argument:: tag
one of the tags returned by link::#-tags::
returns:: hash of the given tag


METHOD:: isDirty
returns:: code::true:: if there are local changes



subsection:: perform actions on remote

METHOD:: fetch
perform a fetch from remote


METHOD:: checkout
perform a checkout from remote with argument code::refspec::
argument:: refspec

METHOD:: pull
perform a pull from remote

METHOD:: clone
perform a clone from url into link::#-localPath::
argument:: url
the url of the remotes


PRIVATE:: git, refspec



EXAMPLES::

code::
// create a Git that points to a Quark directory
g = Git(Quarks.all.choose.localPath);

// alternatively, provide a pathname to a local git repository:
g = Git("/path/to/local/repo");

// get all available tags
g.tags;

// return local path
g.localPath;

// return url
g.url;
::