Skip to content

Commit 601f959

Browse files
committed
feat: change several default revsets to stack() | @
These make sense to run on the current commit even if it's not a draft commit. Exceptions: `git hide`, since we don't have any logic to automatically move the user to the latest non-hidden commit, it would be a little unusual to hide the current commit by default; `git submit`, since we don't want to accidentally force-push the main branch if we happen to have it checked out.
1 parent 26a6197 commit 601f959

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

git-branchless-opts/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ pub enum TestSubcommand {
682682
/// Clean any cached test results.
683683
Clean {
684684
/// The set of commits whose results should be cleaned.
685-
#[clap(value_parser, default_value = "stack()")]
685+
#[clap(value_parser, default_value = "stack() | @")]
686686
revset: Revset,
687687

688688
/// Options for resolving revset expressions.
@@ -702,7 +702,7 @@ pub enum TestSubcommand {
702702
command: Option<String>,
703703

704704
/// The set of commits to test.
705-
#[clap(value_parser, default_value = "stack()")]
705+
#[clap(value_parser, default_value = "stack() | @")]
706706
revset: Revset,
707707

708708
/// Options for resolving revset expressions.
@@ -734,7 +734,7 @@ pub enum TestSubcommand {
734734
command: Option<String>,
735735

736736
/// The set of commits to show the test output for.
737-
#[clap(value_parser, default_value = "stack()")]
737+
#[clap(value_parser, default_value = "stack() | @")]
738738
revset: Revset,
739739

740740
/// Options for resolving revset expressions.

git-branchless/tests/test_test.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fn test_test_cached_results() -> eyre::Result<()> {
146146
✓ Passed (cached): 1b0d484 Revert "create test3.txt"
147147
3 passed, 0 failed, 0 skipped
148148
hint: there was 1 cached test result
149-
hint: to clear these cached results, run: git test clean "stack()"
149+
hint: to clear these cached results, run: git test clean "stack() | @"
150150
hint: disable this hint by running: git config --global branchless.hint.cleanCachedTestResults false
151151
branchless: running command: <git-executable> rebase --abort
152152
"###);
@@ -164,7 +164,7 @@ fn test_test_cached_results() -> eyre::Result<()> {
164164
✓ Passed (cached): 1b0d484 Revert "create test3.txt"
165165
3 passed, 0 failed, 0 skipped
166166
hint: there were 3 cached test results
167-
hint: to clear these cached results, run: git test clean "stack()"
167+
hint: to clear these cached results, run: git test clean "stack() | @"
168168
hint: disable this hint by running: git config --global branchless.hint.cleanCachedTestResults false
169169
branchless: running command: <git-executable> rebase --abort
170170
"###);
@@ -237,7 +237,7 @@ fn test_test_verbosity() -> eyre::Result<()> {
237237
<no output>
238238
1 passed, 0 failed, 0 skipped
239239
hint: there was 1 cached test result
240-
hint: to clear these cached results, run: git test clean "stack()"
240+
hint: to clear these cached results, run: git test clean "stack() | @"
241241
hint: disable this hint by running: git config --global branchless.hint.cleanCachedTestResults false
242242
branchless: running command: <git-executable> rebase --abort
243243
"###);
@@ -300,7 +300,7 @@ fn test_test_verbosity() -> eyre::Result<()> {
300300
<no output>
301301
1 passed, 0 failed, 0 skipped
302302
hint: there was 1 cached test result
303-
hint: to clear these cached results, run: git test clean "stack()"
303+
hint: to clear these cached results, run: git test clean "stack() | @"
304304
hint: disable this hint by running: git config --global branchless.hint.cleanCachedTestResults false
305305
branchless: running command: <git-executable> rebase --abort
306306
"###);
@@ -437,8 +437,9 @@ fn test_test_command_alias() -> eyre::Result<()> {
437437
branchless: running command: <git-executable> diff --quiet
438438
Calling Git for on-disk rebase...
439439
branchless: running command: <git-executable> rebase --continue
440-
Ran echo default on 0 commits:
441-
0 passed, 0 failed, 0 skipped
440+
Ran echo default on 1 commit:
441+
✓ Passed: f777ecc create initial.txt
442+
1 passed, 0 failed, 0 skipped
442443
branchless: running command: <git-executable> rebase --abort
443444
"###);
444445
}
@@ -449,8 +450,9 @@ fn test_test_command_alias() -> eyre::Result<()> {
449450
branchless: running command: <git-executable> diff --quiet
450451
Calling Git for on-disk rebase...
451452
branchless: running command: <git-executable> rebase --continue
452-
Ran echo foo on 0 commits:
453-
0 passed, 0 failed, 0 skipped
453+
Ran echo foo on 1 commit:
454+
✓ Passed: f777ecc create initial.txt
455+
1 passed, 0 failed, 0 skipped
454456
branchless: running command: <git-executable> rebase --abort
455457
"###);
456458
}

0 commit comments

Comments
 (0)