@san-siva/gitsy 1.0.0 → 1.0.1

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.
package/README.md CHANGED
@@ -2,52 +2,190 @@
2
2
 
3
3
  A set of bash utilities for managing Git repositories with ease. Provides user-friendly commands with helpful prompts, color-coded outputs, and automation.
4
4
 
5
+ ## Documentation
6
+
7
+ For complete documentation, usage examples, and detailed command reference, visit the [gitsy documentation website](https://gitsy-56895.web.app).
8
+
9
+ ## System Requirements
10
+
11
+ - Node.js >= 12.0.0
12
+ - Bash shell
13
+ - Git
14
+ - Supported OS: macOS, Linux
15
+
5
16
  ## Available Commands
6
17
 
7
- - `g-co` - Checkout branch
8
- - `g-pull` - Pull changes from remote
9
- - `g-push` - Push changes to remote
10
- - `g-wa` - Create git worktree
11
- - `g-wr` - Remove git worktree
12
- - `g-db` - Delete branch
13
- - `g-dlc` - Discard last commit
14
- - `g-rmf` - Stash working directory
15
- - `g-rto` - Reset to remote branch
16
- - `g-cb` - Show current branch
17
- - `g-s` - Show git status
18
- - `g-diff` - Compare branches
18
+ | Command | Description |
19
+ |---------|-------------|
20
+ | `g-s` | Show git status with colorful output |
21
+ | `g-cb` | Display current branch name |
22
+ | `g-co` | Checkout branch with optional stashing |
23
+ | `g-pull` | Pull changes from remote branch |
24
+ | `g-push` | Push changes to remote (supports force push) |
25
+ | `g-wa` | Create git worktree for a branch |
26
+ | `g-wr` | Remove git worktree |
27
+ | `g-db` | Delete branch locally and remotely |
28
+ | `g-dlc` | Discard last commit |
29
+ | `g-rmf` | Stash working directory changes |
30
+ | `g-rto` | Reset to remote branch |
31
+ | `g-diff` | Compare changes between branches |
19
32
 
20
33
  ## Installation
21
34
 
35
+ Install gitsy globally with npm:
36
+
22
37
  ```bash
23
- git clone https://github.com/san-siva/gitsy.git
24
- cd gitsy
38
+ npm install -g gitsy
39
+ ```
25
40
 
26
- # Add to your PATH in .bashrc or .zshrc
27
- export PATH="$PATH:/path/to/gitsy"
41
+ That's it! All commands (`g-s`, `g-co`, `g-pull`, etc.) will be available immediately.
42
+
43
+ ### Prerequisites
44
+
45
+ You'll also need these dependencies installed:
46
+
47
+ ```bash
48
+ # macOS
49
+ brew install git figlet lolcat
50
+
51
+ # Ubuntu/Debian
52
+ sudo apt-get install git figlet lolcat
53
+
54
+ # Fedora/RHEL
55
+ sudo dnf install git figlet lolcat
28
56
  ```
29
57
 
30
- **Dependencies:** `git`, `figlet`, `lolcat`
58
+ ### Verify Installation
31
59
 
32
- ## Documentation
60
+ ```bash
61
+ g-s --help
62
+ ```
33
63
 
34
- For complete documentation, usage examples, and detailed command reference, visit the [gitsy documentation website](https://gitsy-56895.web.app).
64
+ ### Troubleshooting
65
+
66
+ **Commands not found:**
67
+ - Ensure npm global bin directory is in your PATH
68
+ - Try: `npm uninstall -g gitsy && npm install -g gitsy`
69
+
70
+ **Missing dependencies:**
71
+ - Verify with: `git --version`, `figlet --version`, `lolcat --version`
72
+
73
+ **Permission errors:**
74
+ - Use `sudo npm install -g gitsy` on some systems
75
+ - Or configure npm user directory: `npm config set prefix ~/.npm-global`
76
+
77
+ ## Usage
78
+
79
+ All gitsy commands support the `--help` flag for detailed usage information:
35
80
 
36
- Quick start:
37
81
  ```bash
38
- # Run any command with --help to see available options
39
82
  g-co --help
40
83
  ```
41
84
 
85
+ ### Quick Examples
86
+
87
+ **Check git status:**
88
+ ```bash
89
+ g-s
90
+ ```
91
+
92
+ **Checkout a branch:**
93
+ ```bash
94
+ g-co -t feature-branch
95
+ ```
96
+
97
+ **Create a new worktree:**
98
+ ```bash
99
+ g-wa -t new-feature
100
+ ```
101
+
102
+ **Pull latest changes:**
103
+ ```bash
104
+ g-pull
105
+ ```
106
+
107
+ **Push changes to remote:**
108
+ ```bash
109
+ g-push
110
+ ```
111
+
112
+ **Compare branches:**
113
+ ```bash
114
+ g-diff -s main -t feature-branch
115
+ ```
116
+
117
+ For complete command documentation and advanced usage examples, visit the [gitsy documentation website](https://gitsy-56895.web.app).
118
+
119
+ ## Features
120
+
121
+ - **Interactive prompts** - User-friendly command-line prompts guide you through operations
122
+ - **Color-coded output** - Easy-to-read, colorful terminal output powered by lolcat
123
+ - **Safety checks** - Built-in validations prevent common git mistakes
124
+ - **Automation** - Streamlines complex git workflows into single commands
125
+ - **Worktree management** - Simplified git worktree creation and removal
126
+ - **Branch operations** - Quick branch switching, creation, and deletion
127
+
42
128
  ## Contributing
43
129
 
44
- Contributions are welcome! Please fork the repo and submit pull requests. For bugs or feature requests, open an issue on the repository.
130
+ Contributions are welcome! Here's how to contribute:
131
+
132
+ ### Development Setup
133
+
134
+ 1. **Fork and clone** the repository:
135
+ ```bash
136
+ git clone https://github.com/YOUR_USERNAME/gitsy.git
137
+ cd gitsy
138
+ ```
139
+
140
+ 2. **Install dependencies** (git, figlet, lolcat)
141
+
142
+ 3. **Link for local development**:
143
+ ```bash
144
+ npm link
145
+ ```
146
+ This creates symlinks so you can test your changes globally.
147
+
148
+ 4. **Create a feature branch**:
149
+ ```bash
150
+ git checkout -b feature/your-feature-name
151
+ ```
152
+
153
+ 5. **Make your changes** and test thoroughly
154
+
155
+ 6. **Validate syntax**:
156
+ ```bash
157
+ npm test
158
+ ```
159
+
160
+ 7. **Commit and push**:
161
+ ```bash
162
+ git commit -m "Description of your changes"
163
+ git push origin feature/your-feature-name
164
+ ```
165
+
166
+ 8. **Create a Pull Request** on GitHub
167
+
168
+ ### Reporting Issues
169
+
170
+ Found a bug or have a feature request? Please [open an issue](https://github.com/san-siva/gitsy/issues) with:
171
+ - A clear description of the problem or suggestion
172
+ - Steps to reproduce (for bugs)
173
+ - Expected vs actual behavior
174
+ - Your environment (OS, Node version, shell)
45
175
 
46
176
  ## License
47
177
 
48
- This project is licensed under the MIT License.
178
+ This project is licensed under the MIT License. See the LICENSE file for details.
179
+
180
+ ## Author
181
+
182
+ **Santhosh Siva**
183
+ - GitHub: [@san-siva](https://github.com/san-siva)
184
+ - Documentation: [gitsy-56895.web.app](https://gitsy-56895.web.app)
49
185
 
50
- ## Contact
186
+ ## Acknowledgments
51
187
 
52
- Author: Santhosh Siva
53
- GitHub: https://github.com/san-siva
188
+ Built with:
189
+ - [figlet](http://www.figlet.org/) - ASCII art text generator
190
+ - [lolcat](https://github.com/busyloop/lolcat) - Rainbow colorizer
191
+ - Bash - The GNU Bourne Again Shell
package/g-cb CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # This script returns the current branch name in a git repository.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  set_flags() {
12
20
  while [ $# -gt 0 ]; do
package/g-co CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # A script to checkout branches, optionally stash changes, and manage git workflow efficiently.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  # Default Values
12
20
  stash=false
package/g-db CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # A script to delete a branch locally and push the deletion to remote.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  # Default Values
12
20
  target_branch=
package/g-diff CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # A script to compare changes between two git branches.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  target_branch=""
12
20
  source_branch=""
package/g-dlc CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # A script to discard the last commit with optional force mode.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  # Default Values
12
20
  force_mode=false
package/g-pull CHANGED
@@ -6,9 +6,15 @@
6
6
  # Description:
7
7
  # A script to checkout branches, optionally stash changes, and manage git workflow efficiently.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
10
-
11
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
12
18
 
13
19
  target_branch=
14
20
  do_fetch=false
package/g-push CHANGED
@@ -6,9 +6,15 @@
6
6
  # Description:
7
7
  # A script to checkout branches, optionally stash changes, and manage git workflow efficiently.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
10
-
11
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
12
18
 
13
19
  target_branch=
14
20
  should_force_push=false
package/g-rmf CHANGED
@@ -7,7 +7,15 @@
7
7
  # A script to clear your working directory by stashing changes.
8
8
  # The stashed changes is tagged with the current date and time.
9
9
 
10
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
10
+ # Resolve script directory (works with symlinks for npm global install)
11
+ SOURCE="${BASH_SOURCE[0]}"
12
+ while [ -L "$SOURCE" ]; do
13
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
14
+ SOURCE="$(readlink "$SOURCE")"
15
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
16
+ done
17
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
18
+ source "$SCRIPT_DIR/utils"
11
19
 
12
20
  # Default Values
13
21
  tag_message=
package/g-rto CHANGED
@@ -7,7 +7,15 @@
7
7
  # A script to quickly reset your working directory to the latest changes from the remote branch.
8
8
  # In case you ran this command by mistake, you can use the `git stash apply` command to restore your changes.
9
9
 
10
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
10
+ # Resolve script directory (works with symlinks for npm global install)
11
+ SOURCE="${BASH_SOURCE[0]}"
12
+ while [ -L "$SOURCE" ]; do
13
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
14
+ SOURCE="$(readlink "$SOURCE")"
15
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
16
+ done
17
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
18
+ source "$SCRIPT_DIR/utils"
11
19
 
12
20
  set_flags() {
13
21
  while [ $# -gt 0 ]; do
package/g-s CHANGED
@@ -6,7 +6,15 @@
6
6
  # Description:
7
7
  # This script returns the current status of the git repository.
8
8
 
9
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
9
+ # Resolve script directory (works with symlinks for npm global install)
10
+ SOURCE="${BASH_SOURCE[0]}"
11
+ while [ -L "$SOURCE" ]; do
12
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
13
+ SOURCE="$(readlink "$SOURCE")"
14
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
15
+ done
16
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
17
+ source "$SCRIPT_DIR/utils"
10
18
 
11
19
  set_flags() {
12
20
  while [ $# -gt 0 ]; do
package/g-wa CHANGED
@@ -7,7 +7,15 @@
7
7
  # This script creates a new git worktree for a specified branch.
8
8
  # If the branch does not exist, it prompts the user to create it.
9
9
 
10
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
10
+ # Resolve script directory (works with symlinks for npm global install)
11
+ SOURCE="${BASH_SOURCE[0]}"
12
+ while [ -L "$SOURCE" ]; do
13
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
14
+ SOURCE="$(readlink "$SOURCE")"
15
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
16
+ done
17
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
18
+ source "$SCRIPT_DIR/utils"
11
19
 
12
20
  # Default Values
13
21
  stash=false
package/g-wr CHANGED
@@ -7,9 +7,15 @@
7
7
  # This script removes a git worktree for a specified branch.
8
8
  # It searches through the worktrees directory and removes matching worktrees.
9
9
 
10
- source "$(dirname "${BASH_SOURCE[0]}")/utils"
11
-
12
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ # Resolve script directory (works with symlinks for npm global install)
11
+ SOURCE="${BASH_SOURCE[0]}"
12
+ while [ -L "$SOURCE" ]; do
13
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
14
+ SOURCE="$(readlink "$SOURCE")"
15
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
16
+ done
17
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
18
+ source "$SCRIPT_DIR/utils"
13
19
 
14
20
  # Default Values
15
21
  target_branch=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@san-siva/gitsy",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A set of bash utilities for managing Git repositories with ease",
5
5
  "keywords": [
6
6
  "git",
@@ -57,7 +57,7 @@
57
57
  ],
58
58
  "scripts": {
59
59
  "test": "bash -c 'for script in g-*; do bash -n \"$script\" || exit 1; done'",
60
- "postinstall": "echo '\\n✓ gitsy installed successfully!\\n\\nDependencies required: git, figlet, lolcat\\n\\nRun any command with --help to get started:\\n g-co --help\\n\\nDocumentation: https://gitsy-56895.web.app\\n'"
60
+ "postinstall": "echo '\\n✓ gitsy installed successfully!\\n\\nDependencies required: git, figlet, lolcat\\n\\nRun any command with --help to get started:\\n g-s --help\\n\\nQuick example:\\n g-s # Show git status\\n\\nDocumentation: https://gitsy-56895.web.app\\n'"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=12.0.0"