Skip to content

Commit 1d43280

Browse files
authored
Merge pull request #227 from epage/upgrade
Misc updates
2 parents de5b2b6 + 2c05360 commit 1d43280

File tree

6 files changed

+46
-10
lines changed

6 files changed

+46
-10
lines changed

Cargo.lock

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ concolor-clap = { version = "0.0.9", features = ["api_unstable"] }
3939
proc-exit = "1"
4040
eyre = "0.6"
4141
human-panic = "1"
42-
termtree = "0.2.4"
42+
termtree = "0.4"
4343
indexmap = "1"
4444

4545
git2-ext = "0.0.5"

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ Or use rust to install:
9595
$ cargo install git-stack
9696
```
9797

98+
We also recommend installing
99+
[`git-branch-stash`](https://github.com/gitext-rs/git-branch-stash) for easily
100+
undoing `git stack` operations:
101+
```console
102+
$ cargo install git-branch-stash-cli
103+
```
104+
98105
### Uninstall
99106

100107
See the uninstall method for your installer.
@@ -204,6 +211,14 @@ If a commit summary is only `WIP` or is prefixed by:
204211

205212
*This includes the prefixes used by [Gitlab](https://docs.gitlab.com/ee/user/project/merge_requests/drafts.html)*
206213

214+
### What is `git branch-staash`
215+
216+
[`git-branch-stash`](https://github.com/gitext-rs/git-branch-stash) is a
217+
separate utility that is like `git stash` for instead of your working tree, it
218+
stashes what commit each of your branches points to. `git stack` backs up
219+
using `git branch-stash`s file format to lower the risk of trying things out
220+
with `git stack`.
221+
207222
### Why don't you just ...?
208223

209224
Have an idea, we'd love to [hear it](https://github.com/gitext-rs/git-stack/discussions)!

docs/comparison.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ Cons:
6464
- Only supports Github
6565
- Sounds like they require user-prefixes for branches
6666

67+
## `git-machete`
68+
69+
[Website](https://github.com/VirtusLab/git-machete)
70+
71+
Pros:
72+
- Supports going up and down stacks (`go up`, `go down`, `go next`, `go prev`, `go root`)
73+
- Quick way to diff a branch on a stack
74+
75+
Cons:
76+
- Manually managed branch relationships
77+
- `discover` to get started
78+
- `add` to edit the file from the command-line
79+
6780
## `git spr`
6881

6982
[Website](https://github.com/ejoffe/spr)

docs/reference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ Why not `git push --set-upstream --force-with-lease origin <branch>`?
104104

105105
### `git branch-stash`
106106

107-
While `git stash` backs up and restores your working tree, `git branch-stash` backs up and restores the state of all of your branches.
107+
While `git stash` backs up and restores your working tree,
108+
[`git branch-stash`](https://github.com/gitext-rs/git-branch-stash) backs up
109+
and restores the state of all of your branches.
108110

109111
`git-stack` implicitly does a `git branch-stash` whenever modifying the tree.
110112

src/bin/git-stack/stack.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ impl<'r> Tree<'r> {
13001300
node: Some(self.root),
13011301
palette,
13021302
};
1303-
let mut tree = termtree::Tree::root(root).with_glyphs(GLYPHS);
1303+
let mut tree = termtree::Tree::new(root).with_glyphs(GLYPHS);
13041304
let joint = RenderNode {
13051305
repo,
13061306
head_branch,
@@ -1311,7 +1311,7 @@ impl<'r> Tree<'r> {
13111311
let stacks_len = self.stacks.len();
13121312
for (i, stack) in self.stacks.into_iter().enumerate() {
13131313
if i < stacks_len - 1 {
1314-
let mut stack_tree = termtree::Tree::root(joint).with_glyphs(JOINT_GLYPHS);
1314+
let mut stack_tree = termtree::Tree::new(joint).with_glyphs(JOINT_GLYPHS);
13151315
for child_tree in stack.into_iter() {
13161316
stack_tree.push(child_tree.into_display(
13171317
repo,
@@ -1325,7 +1325,7 @@ impl<'r> Tree<'r> {
13251325
let stack_len = stack.len();
13261326
for (j, child_tree) in stack.into_iter().enumerate() {
13271327
if i != 0 && j == 0 {
1328-
tree.push(termtree::Tree::root(joint).with_glyphs(SPACE_GLYPHS));
1328+
tree.push(termtree::Tree::new(joint).with_glyphs(SPACE_GLYPHS));
13291329
}
13301330
let child = RenderNode {
13311331
repo,
@@ -1334,11 +1334,11 @@ impl<'r> Tree<'r> {
13341334
node: Some(child_tree.root),
13351335
palette,
13361336
};
1337-
tree.push(termtree::Tree::root(child).with_glyphs(GLYPHS));
1337+
tree.push(termtree::Tree::new(child).with_glyphs(GLYPHS));
13381338
if !child_tree.stacks.is_empty() {
13391339
for child_stack in child_tree.stacks.into_iter() {
13401340
let mut stack_tree =
1341-
termtree::Tree::root(joint).with_glyphs(JOINT_GLYPHS);
1341+
termtree::Tree::new(joint).with_glyphs(JOINT_GLYPHS);
13421342
for child_tree in child_stack.into_iter() {
13431343
stack_tree.push(child_tree.into_display(
13441344
repo,
@@ -1350,7 +1350,7 @@ impl<'r> Tree<'r> {
13501350
tree.push(stack_tree);
13511351
}
13521352
if j < stack_len {
1353-
tree.push(termtree::Tree::root(joint).with_glyphs(SPACE_GLYPHS));
1353+
tree.push(termtree::Tree::new(joint).with_glyphs(SPACE_GLYPHS));
13541354
}
13551355
}
13561356
}

0 commit comments

Comments
 (0)