git-tui 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +47 -4
  4. data/VERSION +1 -1
  5. data/bin/git-tui-setup +43 -0
  6. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a52726e41ca04efb41cbcfb03fd7dd08bb5572df3dfe0072b0da24634d37bab8
4
- data.tar.gz: 1417fd7e80bcbe7aed54f2837eac35253c0bd7ce6df5804929fe79dd3c8cb2ad
3
+ metadata.gz: a87bf283931665752f58530704498c9db12b311d9a6e7a1b5aa4f285257007e7
4
+ data.tar.gz: d70c4c435bad140da1deef361c05c9db93c60e7075aef553cb1a01681bb2979e
5
5
  SHA512:
6
- metadata.gz: ec2417368128a689675694cebda8202ad2af7e339fd8b6beef989c20b336f50f5a9199f9bf9c3a88c42fa386829d1e2637ca783cb99f74e83c52642347125eca
7
- data.tar.gz: e0c7a82ebb70da523a48344a934dbbd7ab32c46f475e7419b24d3a3accf8b3667ba39b0d8f4bb5d04e0af5cb8f0db28fac527b731c26955f8a0c2f810c8f0d61
6
+ metadata.gz: e001a8ed1e03f3ea4e3660267a230e9367b55ab8733c6aa85e21eba0a8b73b410d680db93cc5fa1f2b700b502096917b5a3d52569f400133220e7990f411309c
7
+ data.tar.gz: 8c8631fd7ac7d627bf1e9e096789381f8677c059b4f9078524c7985098d02814f158b18488ef6eac98963b8276133861ea9e25e3d0c893a9ed95ae157ef86b5b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.3
4
+
5
+ - Auto-configure global git aliases
6
+ - Auto-configure global git branch.autoSetupRebase always
7
+ - Auto-configure shell g="git" alias in `.zprofile`, `.zshrc` (fallback), `.bash_profile`, `.bashrc` (fallback)
8
+
3
9
  ## 0.0.2
4
10
 
5
11
  - Fixed issue with aborting git branch checkout change
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # Git-TUI (Git Text-based User Interface) 0.0.2
1
+ # Git-TUI (Git Text-based User Interface) 0.0.3
2
2
  [![Gem Version](https://badge.fury.io/rb/git-tui.svg)](https://badge.fury.io/rb/git-tui)
3
3
 
4
- This is an unobtrusive Git TUI (Text-based User Interface) that provides quick time-saving interactions only for Git commands that need it (e.g. `git checkout branchname`) while letting developers to continue to use Git from the command line for the rest of the option-less commands like `git pull`, especially given the ability to setup git aliases (e.g. `g pr` for `git pull --rebase`)
4
+ This is an unobtrusive Git TUI (Text-based User Interface) that provides quick time-saving interactions only for Git commands that need them (e.g. `git checkout branchname`) while [setting up global git aliases/configuration](#setup-instructions) to let developers to continue to use Git from the command line for the rest of the option-less commands (e.g. `g pr` for `git pull --rebase` and `g pf` for `push --force-with-lease`).
5
5
 
6
- Git-TUI intentionally avoids what some other TUIs do in taking up the whole screen to avoid interrupting the developer completely from the terminal yet only augment their workflow with improved productivity for Git option-heavy commands that benefit from auto-completion (e.g. `git checkout branchname`).
6
+ Git-TUI intentionally avoids what some other TUIs do in taking up the whole screen to avoid interrupting the developer completely from the terminal yet only augment their workflow with improved productivity for Git option-heavy commands that benefit from auto-completion (e.g. browsing available branches with autocomplete).
7
7
 
8
8
  ![GIT TUI DEMO](git-tui-demo.gif)
9
9
 
@@ -29,10 +29,53 @@ These are the commands you need to run in order to select a Ruby and gemset, ins
29
29
 
30
30
  ```
31
31
  rvm use @default # or a different ruby version/gemset like `rvm use ruby-3.1.0@git-tui --create`
32
- gem install git-tui -v0.0.2
32
+ gem install git-tui -v0.0.3
33
33
  git-tui-setup
34
34
  ```
35
35
 
36
+ This will add the `git-tui` command (shell function with `git-ui` and `gitui` aliases) and `g` alias for `git`.
37
+
38
+ Additionally, the following global git configuration will be added to `~/.gitconfig`:
39
+
40
+ ```ini
41
+ [alias]
42
+ aa = add -A
43
+ am = commit -am
44
+ ap = add -p
45
+ df = diff
46
+ dh = diff HEAD
47
+ br = branch
48
+ co = checkout
49
+ lp = log -p
50
+ sa = stash apply
51
+ sd = stash drop
52
+ sh = stash -u
53
+ sl = stash list
54
+ sp = stash pop
55
+ ss = stash save -u
56
+ st = status
57
+ cam = commit -am
58
+ cl = clone
59
+ ci = commit
60
+ cia = commit --amend
61
+ cm = commit -m
62
+ m = commit -m
63
+ mg = merge
64
+ pk = cherry-pick
65
+ ps = push
66
+ pf = push --force-with-lease
67
+ pl = pull
68
+ pr = pull --rebase
69
+ rb = rebase
70
+ rc = rebase --continue
71
+ rs = rebase --skip
72
+ ra = rebase --abort
73
+ ri = rebase --interactive
74
+ rh = reset HEAD
75
+ [branch]
76
+ autoSetupRebase = always
77
+ ```
78
+
36
79
  ## Usage
37
80
 
38
81
  Currently, only git branch checkout is supported.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/bin/git-tui-setup CHANGED
@@ -58,6 +58,7 @@ git_tui_script = <<~SHELL_SCRIPT
58
58
  }
59
59
  alias gitui=git-tui
60
60
  alias git-ui=git-tui
61
+ alias g=git
61
62
  SHELL_SCRIPT
62
63
 
63
64
  require 'fileutils'
@@ -74,7 +75,9 @@ File.write(git_tui_script_file, git_tui_script)
74
75
  shell_profile_file_name = profile_and_fallback.first
75
76
  shell_profile_file_name = profile_and_fallback.last if !File.exist?("#{home_dir}/#{shell_profile_file_name}")
76
77
  shell_profile_file = "#{home_dir}/#{shell_profile_file_name}"
78
+
77
79
  FileUtils.touch(shell_profile_file)
80
+
78
81
  bash_profile = File.read(shell_profile_file)
79
82
  git_tui_source_statement = "source \"#{git_tui_script_file_bash}\""
80
83
  unless bash_profile.split("\n").detect {|line| line.include?(git_tui_source_statement) }
@@ -83,6 +86,46 @@ File.write(git_tui_script_file, git_tui_script)
83
86
  puts "~/#{shell_profile_file_name} has been modified to source the `git-tui` function from ~/.git_tui_source"
84
87
  end
85
88
 
89
+ {
90
+ 'aa' => 'add -A',
91
+ 'am' => 'commit -am',
92
+ 'ap' => 'add -p',
93
+ 'df' => 'diff',
94
+ 'dh' => 'diff HEAD',
95
+ 'br' => 'branch',
96
+ 'co' => 'checkout',
97
+ 'lp' => 'log -p',
98
+ 'sa' => 'stash apply',
99
+ 'sd' => 'stash drop',
100
+ 'sh' => 'stash -u',
101
+ 'sl' => 'stash list',
102
+ 'sp' => 'stash pop',
103
+ 'ss' => 'stash save -u',
104
+ 'st' => 'status',
105
+ 'cam' => 'commit -am',
106
+ 'cl' => 'clone',
107
+ 'ci' => 'commit',
108
+ 'cia' => 'commit --amend',
109
+ 'cm' => 'commit -m',
110
+ 'm' => 'commit -m',
111
+ 'mg' => 'merge',
112
+ 'pk' => 'cherry-pick',
113
+ 'ps' => 'push',
114
+ 'pf' => 'push --force-with-lease',
115
+ 'pl' => 'pull',
116
+ 'pr' => 'pull --rebase',
117
+ 'rb' => 'rebase',
118
+ 'rc' => 'rebase --continue',
119
+ 'rs' => 'rebase --skip',
120
+ 'ra' => 'rebase --abort',
121
+ 'ri' => 'rebase --interactive',
122
+ 'rh' => 'reset HEAD',
123
+ }.each do |git_alias, git_command|
124
+ system "git config --global alias.#{git_alias} '#{git_command}'"
125
+ end
126
+
127
+ system "git config --global branch.autoSetupRebase 'always'"
128
+
86
129
  puts <<~OUTPUT
87
130
 
88
131
  Before using `git-tui`, start a new shell session (open a new terminal tab) or run:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-tui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - andy_maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 3.5.0
39
+ version: '3.5'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 3.5.0
46
+ version: '3.5'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ licenses:
150
150
  metadata: {}
151
151
  post_install_message: |2+
152
152
 
153
- To finish setting up the git-tui Ruby gem in your shell environment, run: git-tui-setup
153
+ To finish setting up the git-tui Ruby gem in your shell environment, run `git-tui-setup` in order to setup git-tui command and global git aliases/configuration.
154
154
 
155
155
  rdoc_options: []
156
156
  require_paths: