git-improved 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGES.md +8 -0
- data/MIT-LICENSE +21 -0
- data/README.md +307 -0
- data/bin/gi +7 -0
- data/git-improved.gemspec +34 -0
- data/lib/git-improved.rb +1626 -0
- data/test/action_test.rb +1953 -0
- data/test/shared.rb +96 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e11e5f761930d6144256491b8a70969fc476a3f69a46279b5cd3bc202d5a5fb0
|
4
|
+
data.tar.gz: d921d52ba6e620b61c1c0e8d2258dd386025b865a1c97a854c672aeb9df3a2af
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9ac92a732673c69a58c50c2d5036b3f9e0ca76bcf0e47af8d2d1324386e88ffc1c58a28a7e14c89297babd26823c5eeff16a69174d2f1b9b85dc5f2620e1713b
|
7
|
+
data.tar.gz: e86c62fcf12164acbc3b3fc97ffd16965f851217a28a3c9a9e5f7d265c524a79a1f827f25d61df19c306967e98e816571e0a7d0689c2a9d4a638a4c775fa5352
|
data/CHANGES.md
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 kwatch@gmail.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,307 @@
|
|
1
|
+
# GitImproved
|
2
|
+
|
3
|
+
|
4
|
+
## What's This?
|
5
|
+
|
6
|
+
GitImproved is a wrapper script for Git command.
|
7
|
+
It provides a much better interface than Git.
|
8
|
+
|
9
|
+
* Intuitive
|
10
|
+
* Easy to understand
|
11
|
+
* Fewer commands
|
12
|
+
|
13
|
+
Links:
|
14
|
+
|
15
|
+
* Document: <https://kwatch.github.io/git-improved/>
|
16
|
+
* GitHub: <https://github.com/kwatch/git-improved>
|
17
|
+
* Changes: <https://github.com/kwatch/git-improved/CHANGES.md>
|
18
|
+
|
19
|
+
|
20
|
+
### Table of Contents
|
21
|
+
|
22
|
+
<!-- TOC -->
|
23
|
+
|
24
|
+
* [What's This?](#whats-this)
|
25
|
+
* [Install](#install)
|
26
|
+
* [Quick Example](#quick-example)
|
27
|
+
* [Actions](#actions)
|
28
|
+
* [Branch](#branch)
|
29
|
+
* [Commit](#commit)
|
30
|
+
* [Config](#config)
|
31
|
+
* [File](#file)
|
32
|
+
* [Help](#help)
|
33
|
+
* [History](#history)
|
34
|
+
* [Misc](#misc)
|
35
|
+
* [Repo](#repo)
|
36
|
+
* [Staging](#staging)
|
37
|
+
* [Stash](#stash)
|
38
|
+
* [Status](#status)
|
39
|
+
* [Sync](#sync)
|
40
|
+
* [Tag](#tag)
|
41
|
+
* [Aliases](#aliases)
|
42
|
+
* [License and Copyright](#license-and-copyright)
|
43
|
+
|
44
|
+
<!-- /TOC -->
|
45
|
+
|
46
|
+
|
47
|
+
## Install
|
48
|
+
|
49
|
+
GitImproved requires Ruby >= 2.3.
|
50
|
+
|
51
|
+
```console
|
52
|
+
$ gem install git-improved
|
53
|
+
$ gi --version
|
54
|
+
1.0.0
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
## Quick Example
|
59
|
+
|
60
|
+
```console
|
61
|
+
## help
|
62
|
+
$ gi -h | less # help message
|
63
|
+
$ gi -l | less # list actions
|
64
|
+
$ gi -h commit:create # help of an action
|
65
|
+
|
66
|
+
## create a repo
|
67
|
+
$ mkdir mysample # or: gi repo:clone github:<user>/<repo>
|
68
|
+
$ cd mysample
|
69
|
+
$ gi repo:init -u yourname -e yourname@gmail.com
|
70
|
+
|
71
|
+
## add files
|
72
|
+
$ vi README.md # create a new file
|
73
|
+
$ gi track README.md # register files into the repository
|
74
|
+
$ gi # show current status
|
75
|
+
$ gi cc "add README file" # commit changes
|
76
|
+
|
77
|
+
## edit files
|
78
|
+
$ vi README.md # update an existing file
|
79
|
+
$ gi stage . # add changes into staging area
|
80
|
+
$ gi # show current status
|
81
|
+
$ gi staged # show changes in staging area
|
82
|
+
$ gi cc "update README file" # commit changes
|
83
|
+
|
84
|
+
## upload changes
|
85
|
+
$ gi repo:remote:seturl github:yourname/mysample
|
86
|
+
$ gi push # upload local commits to remote repo
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
## Actions
|
91
|
+
|
92
|
+
|
93
|
+
### Branch
|
94
|
+
|
95
|
+
```
|
96
|
+
branch:checkout : create a new local branch from a remote branch
|
97
|
+
branch:create : create a new branch, not switch to it
|
98
|
+
(alias: branch)
|
99
|
+
branch:current : show current branch name
|
100
|
+
branch:delete : delete a branch
|
101
|
+
branch:echo : print CURR/PREV/PARENT branch name
|
102
|
+
branch:fork : create a new branch and switch to it
|
103
|
+
(alias: fork)
|
104
|
+
branch:join : merge current branch into previous or other branch
|
105
|
+
(alias: join)
|
106
|
+
branch:list : list branches
|
107
|
+
(alias: branches)
|
108
|
+
branch:merge : merge previous or other branch into current branch
|
109
|
+
(alias: merge)
|
110
|
+
branch:parent : show parent branch name (EXPERIMENTAL)
|
111
|
+
branch:previous : show previous branch name
|
112
|
+
branch:rebase : rebase (move) current branch on top of other branch
|
113
|
+
branch:rename : rename the current branch to other name
|
114
|
+
branch:reset : change commit-id of current HEAD
|
115
|
+
branch:switch : switch to previous or other branch
|
116
|
+
(alias: sw, switch)
|
117
|
+
branch:update : git pull && git stash && git rebase && git stash pop
|
118
|
+
(alias: update)
|
119
|
+
branch:upstream : print upstream repo name of current branch
|
120
|
+
```
|
121
|
+
|
122
|
+
|
123
|
+
### Commit
|
124
|
+
|
125
|
+
```
|
126
|
+
commit:apply : apply a commit to curr branch (known as 'cherry-pick')
|
127
|
+
commit:correct : correct the last commit
|
128
|
+
(alias: correct)
|
129
|
+
commit:create : create a new commit
|
130
|
+
(alias: cc, commit)
|
131
|
+
commit:fixup : correct the previous commit
|
132
|
+
(alias: fixup)
|
133
|
+
commit:revert : create a new commit which reverts the target commit
|
134
|
+
commit:rollback : cancel recent commits up to the target commit-id
|
135
|
+
commit:show : show commits in current branch
|
136
|
+
(alias: commits)
|
137
|
+
```
|
138
|
+
|
139
|
+
|
140
|
+
### Config
|
141
|
+
|
142
|
+
```
|
143
|
+
config : list/get/set/delete config values
|
144
|
+
config:alias : list/get/set/delete aliases of 'git' (not of 'gi')
|
145
|
+
config:setuser : set user name and email
|
146
|
+
```
|
147
|
+
|
148
|
+
|
149
|
+
### File
|
150
|
+
|
151
|
+
```
|
152
|
+
file:blame : print commit-id, author, and timestap of each line
|
153
|
+
file:changes : show changes of files
|
154
|
+
(alias: changes)
|
155
|
+
file:delete : delete files or directories
|
156
|
+
file:egrep : find by pattern
|
157
|
+
file:list : list (un)tracked/ignored/missing files
|
158
|
+
(alias: files)
|
159
|
+
file:move : move files into a directory
|
160
|
+
file:rename : rename a file or directory to new name
|
161
|
+
file:restore : restore files (= clear changes)
|
162
|
+
file:track : register files into the repository
|
163
|
+
(alias: register, track)
|
164
|
+
```
|
165
|
+
|
166
|
+
|
167
|
+
### Help
|
168
|
+
|
169
|
+
```
|
170
|
+
help : print help message (of action if specified)
|
171
|
+
```
|
172
|
+
|
173
|
+
|
174
|
+
### History
|
175
|
+
|
176
|
+
```
|
177
|
+
history : show commit history in various format
|
178
|
+
(alias: hist (with '-F graph'))
|
179
|
+
history:edit:cancel : cancel (or abort) `git rebase -i`
|
180
|
+
history:edit:resume : resume (= conitnue) suspended `git rebase -i`
|
181
|
+
history:edit:skip : skip current commit and resume
|
182
|
+
history:edit:start : start `git rebase -i` to edit commit history
|
183
|
+
(alias: histedit)
|
184
|
+
history:notuploaded : show commits not uploaded yet
|
185
|
+
```
|
186
|
+
|
187
|
+
|
188
|
+
### Misc
|
189
|
+
|
190
|
+
```
|
191
|
+
misc:initfile : generate a init file, or print to stdout if no args
|
192
|
+
```
|
193
|
+
|
194
|
+
|
195
|
+
### Repo
|
196
|
+
|
197
|
+
```
|
198
|
+
repo:clone : copy a repository ('github:<user>/<repo>' is available)
|
199
|
+
repo:create : create a new directory and initialize it as a git repo
|
200
|
+
repo:init : initialize git repository with empty initial commit
|
201
|
+
repo:remote : list/get/set/delete remote repository
|
202
|
+
repo:remote:origin : get/set/delete origin (= default remote repository)
|
203
|
+
```
|
204
|
+
|
205
|
+
|
206
|
+
### Staging
|
207
|
+
|
208
|
+
```
|
209
|
+
staging:add : add changes of files into staging area
|
210
|
+
(alias: pick (with '-p'), stage)
|
211
|
+
staging:clear : delete all changes in staging area
|
212
|
+
(alias: unstage)
|
213
|
+
staging:edit : edit changes in staging area
|
214
|
+
staging:show : show changes in staging area
|
215
|
+
(alias: staged)
|
216
|
+
```
|
217
|
+
|
218
|
+
|
219
|
+
### Stash
|
220
|
+
|
221
|
+
```
|
222
|
+
stash:drop : delete latest changes from stash
|
223
|
+
stash:list : list stash history
|
224
|
+
stash:pop : restore latest changes from stash
|
225
|
+
stash:put : save current changes into stash
|
226
|
+
stash:show : show changes on stash
|
227
|
+
```
|
228
|
+
|
229
|
+
|
230
|
+
### Status
|
231
|
+
|
232
|
+
```
|
233
|
+
status:compact : show status in compact format
|
234
|
+
(alias: status)
|
235
|
+
status:default : show status in default format
|
236
|
+
status:here : same as 'stats:compact .'
|
237
|
+
status:info : show various infomation of current status
|
238
|
+
```
|
239
|
+
|
240
|
+
|
241
|
+
### Sync
|
242
|
+
|
243
|
+
```
|
244
|
+
sync:both : download and upload commits
|
245
|
+
(alias: sync)
|
246
|
+
sync:pull : download commits from remote and apply them to local
|
247
|
+
(alias: dl, download, pull)
|
248
|
+
sync:push : upload commits to remote
|
249
|
+
(alias: push, up, upload)
|
250
|
+
```
|
251
|
+
|
252
|
+
|
253
|
+
### Tag
|
254
|
+
|
255
|
+
```
|
256
|
+
tag : list/show/create/delete tags
|
257
|
+
tag:create : create a new tag
|
258
|
+
tag:delete : delete a tag
|
259
|
+
tag:download : download tags
|
260
|
+
tag:list : list tags
|
261
|
+
(alias: tags)
|
262
|
+
tag:upload : upload tags
|
263
|
+
```
|
264
|
+
|
265
|
+
|
266
|
+
## Aliases
|
267
|
+
|
268
|
+
```
|
269
|
+
branch : alias for 'branch:create'
|
270
|
+
fork : alias for 'branch:fork'
|
271
|
+
join : alias for 'branch:join'
|
272
|
+
branches : alias for 'branch:list'
|
273
|
+
merge : alias for 'branch:merge'
|
274
|
+
sw : alias for 'branch:switch'
|
275
|
+
switch : alias for 'branch:switch'
|
276
|
+
update : alias for 'branch:update'
|
277
|
+
correct : alias for 'commit:correct'
|
278
|
+
cc : alias for 'commit:create'
|
279
|
+
commit : alias for 'commit:create'
|
280
|
+
fixup : alias for 'commit:fixup'
|
281
|
+
commits : alias for 'commit:show'
|
282
|
+
changes : alias for 'file:changes'
|
283
|
+
files : alias for 'file:list'
|
284
|
+
register : alias for 'file:track'
|
285
|
+
track : alias for 'file:track'
|
286
|
+
hist : alias for 'history -F graph'
|
287
|
+
histedit : alias for 'history:edit:start'
|
288
|
+
pick : alias for 'staging:add -p'
|
289
|
+
stage : alias for 'staging:add'
|
290
|
+
unstage : alias for 'staging:clear'
|
291
|
+
staged : alias for 'staging:show'
|
292
|
+
status : alias for 'status:compact'
|
293
|
+
sync : alias for 'sync:both'
|
294
|
+
dl : alias for 'sync:pull'
|
295
|
+
download : alias for 'sync:pull'
|
296
|
+
pull : alias for 'sync:pull'
|
297
|
+
push : alias for 'sync:push'
|
298
|
+
up : alias for 'sync:push'
|
299
|
+
upload : alias for 'sync:push'
|
300
|
+
tags : alias for 'tag:list'
|
301
|
+
```
|
302
|
+
|
303
|
+
|
304
|
+
## License and Copyright
|
305
|
+
|
306
|
+
* $License: MIT License $
|
307
|
+
* $Copyright: copyright(c) 2023 kwatch@gmail.com $
|
data/bin/gi
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "git-improved"
|
5
|
+
spec.version = "$Release: 0.1.0 $".split()[1]
|
6
|
+
spec.author = "kwatch"
|
7
|
+
spec.email = "kwatch@gmail.com"
|
8
|
+
spec.platform = Gem::Platform::RUBY
|
9
|
+
spec.homepage = "https://kwatch.github.io/git-improved/"
|
10
|
+
spec.summary = "Improved interface for Git command"
|
11
|
+
spec.description = <<-"END"
|
12
|
+
Git-Improved is a wrapper script for Git command.
|
13
|
+
It provides much better interface than Git.
|
14
|
+
|
15
|
+
See #{spec.homepage} for details.
|
16
|
+
END
|
17
|
+
spec.license = "MIT"
|
18
|
+
spec.files = Dir[
|
19
|
+
"README.md", "MIT-LICENSE", "CHANGES.md",
|
20
|
+
"#{spec.name}.gemspec",
|
21
|
+
"lib/**/*.rb", "test/**/*.rb", "bin/*",
|
22
|
+
#"doc/*.html", "doc/css/*.css",
|
23
|
+
]
|
24
|
+
spec.executables = ["gi"]
|
25
|
+
spec.bindir = "bin"
|
26
|
+
spec.require_path = "lib"
|
27
|
+
spec.test_files = Dir["test/**/*_test.rb"] # or: ["test/run_all.rb"]
|
28
|
+
#spec.extra_rdoc_files = ["README.md", "CHANGES.md"]
|
29
|
+
|
30
|
+
spec.required_ruby_version = ">= 2.3"
|
31
|
+
spec.add_runtime_dependency "benry-cmdapp" , "~> 1"
|
32
|
+
spec.add_runtime_dependency "benry-unixcommand" , "~> 1"
|
33
|
+
spec.add_development_dependency "oktest" , "~> 1"
|
34
|
+
end
|