Skip to content

Commit c17cf5e

Browse files
committed
Add stgit.new.verbose config option
Instead of piggybacking on Git's commit.new config option, StGit now has its own config option for turning-on `stg new --verbose`. Two considerations for this change: - `stg new` does not refresh, thus it leaves changes in the worktree. This is a significant semantic difference with `git commit` that makes reuse of `commit.verbose` an awkward fit. - The performance implications in large monorepos with `stg new --verbose` versus `git commit --verbose` are quite different. See #145. The gist is that the diff operation needed for `stg new --verbose` can be much more expensive than `git commit --verbose`. Signed-off-by: Peter Grayson <[email protected]>
1 parent 5215692 commit c17cf5e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- `stg edit` gains helpful instructions (#138)
1515
- `stg new` learns `--verbose`, which includes a diff in the editor
1616
window (similar to `git commit --verbose`). This behavior is also
17-
configurable with the `commit.verbose` configuration option
17+
configurable with the `stgit.new.verbose` configuration option
1818
- `stg push` and `stg float` learn `--noapply` option; allows patches
1919
to be reordered without updating worktree and deferring merge conflict
2020
resolution (#144)

stgit/commands/new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def func(parser, options, args):
8787
if options.verbose:
8888
verbose = options.verbose
8989
else:
90-
verbose = config.getbool('commit.verbose') or False
90+
verbose = config.getbool('stgit.new.verbose') or False
9191

9292
cd = CommitData(
9393
tree=stack.head.data.tree,

t/t1003-new.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ test_expect_success \
114114
'New with verbose config option' '
115115
test_set_editor "$(pwd)/fake-editor" &&
116116
test_when_finished test_set_editor false &&
117-
test_config commit.verbose "1" &&
117+
test_config stgit.new.verbose "1" &&
118118
stg new verbose-config-patch &&
119119
grep "something else" raw_commit_message.txt
120120
'
@@ -123,7 +123,7 @@ test_expect_success \
123123
'New with verbose config boolean option' '
124124
test_set_editor "$(pwd)/fake-editor" &&
125125
test_when_finished test_set_editor false &&
126-
test_config commit.verbose "true" &&
126+
test_config stgit.new.verbose "true" &&
127127
stg new verbose-config-bool-patch &&
128128
grep "something else" raw_commit_message.txt
129129
'

0 commit comments

Comments
 (0)