gitext-rs / git-stack

Stacked branch management for Git
Apache License 2.0
516 stars 19 forks source link

git config stack.stack not taking effect #96

Closed Bouke closed 3 years ago

Bouke commented 3 years ago

Description

I'm trying to change the default --stack argument to descendants to reduce the amount of output generated by git stack. I believe this should work, but I can't seem to get it to work:

$ git config stack.stack descendants

$ git config stack.stack descendants
descendants

$ git stack --dump-config -
[stack]
...
    stack=All

Version

0.2.9

Steps to reproduce

No response

Actual Behaviour

No response

Expected Behaviour

No response

Debug Output

[TRACE git_stack::config] Initializing
[TRACE git_stack::config] Loading gitconfig
[TRACE git_stack::config] Loading /Users/bouke/Developer/XXX/.gitconfig
[TRACE git_stack::config] Loading /Users/bouke/Developer/XXX/.git/config (< this file contains the stack.stack config)
epage commented 3 years ago

Try all instead of All.

There is a bug in the arg parsing where values are CamelCase instead of kebab-case like the config.

Bouke commented 3 years ago

Also doesn't work:

$ git config stack.stack Descendants

$ git config stack.stack
Descendants

$git stack --dump-config - | grep stack=
    stack=All
epage commented 3 years ago

So there are a couple of bugs here.

The first two bugs make it easy to think you can do

git config stack.stack All

or

git config stack.stack Descendants

But these are invalid values (should be all and descendants) and we ignore invalid values and fallback to defaults.

epage commented 3 years ago

I just release v0.4.1 which includes #108

Bouke commented 3 years ago

Working great, thanks!