acp-push 2.2.1 → 2.3.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.
Files changed (3) hide show
  1. package/README.md +7 -3
  2. package/bin/acp.js +12 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -29,7 +29,8 @@ npm install -g acp-push
29
29
  | `-u`, `--upstream` | Push to `origin`, then open a pull request to `upstream` |
30
30
  | `-ua`, `--upstream-allow` (or `--upstream-merge`) | Same as `-u`, then merge the pull request if you have write access to `upstream` |
31
31
  | `-bpa`, `--branch-pr-auto` | Push to a new branch on `origin`, open a pull request into the default branch, merge it, then delete the branch |
32
- | `-b`, `--branch <name>` | Push to `<name>` instead of `main` |
32
+ | `-bopa`, `--branch-origin-pr-auto` | Same as `-bpa` |
33
+ | `-b`, `--branch <name>` | Push to `<name>` instead of `main` (`-b-<name>` works too, e.g. `-b-nida`) |
33
34
  | `-m`, `--message <text>` | Use your own commit message instead of a random one |
34
35
  | `-c`, `--chunks` | Split your changes into 10 smaller commits (by change, not by file), then push |
35
36
  | `-h`, `--help` | Show help |
@@ -42,8 +43,11 @@ acp # git push origin main
42
43
  acp -u # git push origin main, then open a PR to upstream
43
44
  acp -ua # same, then merge the PR if you have write access
44
45
  acp -bpa # new branch, PR into main, merge, delete the branch
46
+ acp -bopa # same as -bpa
45
47
  acp -b dev # git push origin dev
46
48
  acp --branch=dev # same as above
49
+ acp -b-nida # same as -b nida, git push origin nida
50
+ acp -c -b-nida # commit in 10 chunks, then push to origin nida
47
51
  acp -u -b fix # git push origin fix, then open a PR to upstream
48
52
  acp -m "Fix login bug" # custom message
49
53
  acp -c # 10 smaller commits, then push
@@ -83,9 +87,9 @@ gh pr merge <pr> --merge
83
87
  - Of your logged-in `gh` accounts, `acp` uses one that can push to `upstream` (the owner's account first) for the push, the pull request and the merge.
84
88
  - The branch is not deleted after the merge.
85
89
 
86
- ## One repo: branch, PR, merge, delete (`-bpa`)
90
+ ## One repo: branch, PR, merge, delete (`-bpa` / `-bopa`)
87
91
 
88
- `acp -bpa` does the whole branch workflow in the repo you are in, with no fork or `upstream` needed:
92
+ `acp -bpa` (or `acp -bopa`) does the whole branch workflow in the repo you are in, with no fork or `upstream` needed:
89
93
 
90
94
  ```bash
91
95
  git add .
package/bin/acp.js CHANGED
@@ -31,6 +31,7 @@ Options:
31
31
  -bopa, --branch-origin-pr-auto
32
32
  Same as -bpa
33
33
  -b, --branch <name> Push to <name> instead of "main"
34
+ (-b-<name> works too, e.g. -b-nida)
34
35
  -m, --message <text> Use your own commit message instead of a random one
35
36
  -c, --chunks Split your changes into 10 smaller commits. With -u or
36
37
  -ua, each commit is pushed with its own pull request
@@ -75,7 +76,9 @@ Examples:
75
76
  acp -bpa ${dim('# push a new branch, PR into main, merge, delete the branch')}
76
77
  acp -bopa ${dim('# same as -bpa')}
77
78
  acp -b dev ${dim('# push to origin/dev')}
78
- acp -u --branch fix ${dim('# push to origin/fix, open a PR to upstream')}
79
+ acp -b-nida ${dim('# same as -b nida: push to origin/nida')}
80
+ acp -c -b-nida ${dim('# commit in 10 chunks, then push to origin/nida')}
81
+ acp -u --branch fix ${dim('# push to origin/fix, open a PR to upstream')}
79
82
  acp -m "Fix login bug" ${dim('# custom message, push to origin/main')}
80
83
  acp -c ${dim('# commit in 10 chunks, then push')}
81
84
  acp -c -ua ${dim('# each chunk: push, open a PR, merge it')}
@@ -112,6 +115,14 @@ function parseArgs(argv) {
112
115
  return next;
113
116
  };
114
117
 
118
+ // Shorthand: -b-nida is the same as -b nida (the name may contain dashes).
119
+ if (flag.startsWith('-b-')) {
120
+ if (flag.length === 3) fail('-b- needs a branch name, like -b-nida');
121
+ options.branch = flag.slice(3);
122
+ options.branchGiven = true;
123
+ continue;
124
+ }
125
+
115
126
  switch (flag) {
116
127
  case '-u':
117
128
  case '--upstream':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acp-push",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "git add, commit (with a random message) and push in one command: acp",
5
5
  "bin": {
6
6
  "acp": "bin/acp.js"