tj / git-extras

GIT utilities -- repo summary, repl, changelog population, author commit percentages and more
MIT License
17.3k stars 1.21k forks source link

feat: add reverse option to git-brv #1123

Closed joshka closed 9 months ago

joshka commented 9 months ago

When there are a large amount of branches it is often useful to see the most recent branches last as they end up closer to the prompt. This adds a new --reverse / -r option and an environment variable to set the default behavior (GIT_BRV_REVERSE).


❯ bin/git-brv
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)

❯ bin/git-brv -r
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ bin/git-brv --reverse
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ GIT_BRV_REVERSE=false bin/git-brv
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)

❯ GIT_BRV_REVERSE=true bin/git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ GIT_BRV_REVERSE=foo bin/git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
joshka commented 9 months ago
❯ git brv                                                
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)

❯ git brv --reverse
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ git brv -r       
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ git config --local git-extras.brv.reverse true
❯ git brv                                       
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv

❯ git config --local git-extras.brv.reverse false
❯ git brv                                        
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)

❯ git config --unset git-extras.brv.reverse      
❯ git config --global git-extras.brv.reverse true      
❯ git brv                                        
2023-11-30 foo              28b48c7 chore: add poetry to handle the tests of the git extras (#1121)
2023-12-11 main origin/main 93a32cf feat: add reverse option to git-brv
spacewander commented 9 months ago

@joshka Merged. Thanks!

joshka commented 9 months ago

Thank you!