scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

`gs` fixes #310

Closed yhpark closed 3 years ago

yhpark commented 3 years ago

before:

image

after:

image image

yhpark commented 3 years ago

@ghthor I just found there's an untended change introduced from this fix: if the branch is remote-tracking, git status --porcelain -b prints ## {local_branch}...{remote_branch} so the branch name is now parsed like branch...origin/branch. For me this is fine but if you want it the way before, changing the regex to something like ^## (?:Initial commit on )?(.*?)(?:\.\.\.| |$) would work.

ref: git doc says branch name cannot contain two or more consecutive dots.

ghthor commented 3 years ago

I think the change is fine. Just to clarify with some output. The change to the @branch variable is purely for the output of gs and I think showing the remote tracking branch as part of the output is an improvement here.

From this master

$ gs
# On branch: master |  [*] => $e*
#
➤ Untracked files
#
#      untracked: [1] lib/fun.sh 
#

To This master...origin/master

$ gs
# On branch: master...origin/master  |  [*] => $e*
#
➤ Untracked files
#
#      untracked: [1] lib/fun.sh 
#