Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an additional git prompt symbol for a branch's tracking state #202

Merged
merged 1 commit into from
Aug 25, 2015

Conversation

paulmarsy
Copy link
Contributor

@dahlbyk pull request for issues:
#172
#190

As per the discussion in #190

  • The symbol showing the state of the working tree has been added back in
  • The remote tracking state is always shown as it is now decoupled from the working tree symbol

I also added a space between the branch name and symbol for clarity.

Should the DelimText character be used to segment the different parts of the prompt?

In sync with no local changes
synced no changes
In sync with unstaged local changes
unstaged synced
In sync with staged local changes
staged synced
Ahead of the remote branch
ahead
Behind the remote branch
behind
Both ahead & behind the remote branch
ahead and behind

The three unicode characters used (0x2261, 0x2191 & 0x2193) render correctly in:

  • ConEmu with Consolas font
  • Windows PowerShell console with the default Lucida Console font (Windows 10)
  • Windows PowerShell console with the default 'Raster Fonts' (Windows 8.1 & Windows Server 2012 R2)
  • Windows PowerShell ISE with the default Lucida Console font (Windows 10 & 8.1) both script pane and console pane
  • Command Prompt / cmd.exe (Windows 10, 8.1 & Windows Server 2012 R2)
  • 'Git Bash' - mintty
  • 'Git Bash' - msysgit

RE: @bazzilic & #190 (comment) I'm unsure where to find and test those fonts.

@bazzilic
Copy link

Why not the ↕ symbol for both ahead and behind?

As for the fonts,
Lucida Console and Consolas are preinstalled with Windows.
Ubuntu Font Family: http://font.ubuntu.com/
Monaco: http://www.fontpalace.com/font-details/Monaco/
Droid Sans Mono: http://www.fontsquirrel.com/fonts/droid-sans-mono
Source Code Pro: http://www.1001fonts.com/source-code-pro-font.html
Menlo: https://github.com/hbin/top-programming-fonts/blob/master/Menlo-Regular.ttf?raw=true

@paulmarsy
Copy link
Contributor Author

Testing in ConEmu/PowerShell under Windows 7 all four symbols render correctly in the below fonts using:
"$([char]0x2191)$([char]0x2193)$([char]0x2261)$([char]0x2195)"
↑↓≡↕

  • Lucida Console ✔️
  • Consolas ✔️
  • Menlo-Regular ✔️
  • Monaco ✔️
  • Ubuntu ✔️
  • UbuntuCondensed ✔️
  • UbuntuLight ✔️
  • UbuntuMono ✔️
  • SourceCodePro-Black ✔️
  • SourceCodePro-ExtraLight ✔️
  • SourceCodePro-Light ✔️
  • SourceCodePro-Regular ✔️
  • SourceCodePro-Semibold ✔️
  • DroidSansMono ✔️

I'll update the ahead & behind symbol to use ↕ as it is more appropriate.

@paulmarsy paulmarsy closed this Jun 25, 2015
@paulmarsy paulmarsy force-pushed the branch-status-symbols branch from d00904b to 7acc70b Compare June 25, 2015 19:10
@paulmarsy paulmarsy reopened this Jun 25, 2015
@paulmarsy
Copy link
Contributor Author

Is there any further feedback on this? Are there any changes to the implementation that should be made or is it suitable?
I realise there are a large number of changes to the prompt file which requires careful consideration to avoid introducing any bugs in such a critical function. Are there any additional scenarios which should be tested?

Here is an example workflow with the current proposed PR:
workflow

For the user experience the only thing I am unsure of is whether to keep the space between the branch name and it's symbol. I am leaning towards removing the space to keep things more compact.

@dahlbyk
Copy link
Owner

dahlbyk commented Jun 29, 2015

Sorry for the delayed response - your implementation and testing seems quite thorough, I just haven't had an opportunity to dig in for a final review due to recent travel. Soon, I hope!

@paulmarsy
Copy link
Contributor Author

No problem, just wanted to make sure there was nothing currently outstanding for me to do 😄

@paulmarsy
Copy link
Contributor Author

An example workflow of the change without the space is below.
I am undecided and have no preference one way or the other.. the difference is minor.

no space example workflow

@bazzilic
Copy link

bazzilic commented Jul 1, 2015

Looks great to me. As for the space, I prefer the first one, with the space between the arrow and the branch name.

@codewithtyler
Copy link

I also prefer the first one. The additional space makes it easier to read.

@dahlbyk
Copy link
Owner

dahlbyk commented Aug 25, 2015

I should have just merged this months ago. Great work, @paulmarsy!

dahlbyk added a commit that referenced this pull request Aug 25, 2015
Adding an additional git prompt symbol for a branch's tracking state
@dahlbyk dahlbyk merged commit a3617ac into dahlbyk:master Aug 25, 2015
@shiftkey shiftkey mentioned this pull request Mar 2, 2016
dahlbyk added a commit that referenced this pull request Mar 4, 2017
The setting exists for legacy reasons: 02956e1.
It was removed in #202 and restored in #209 to avoid a breaking change.

Since we still have it, I suppose we might as well support using it to
control the prompt text color.
dahlbyk added a commit that referenced this pull request Mar 4, 2017
The setting exists for legacy reasons: 02956e1.
It was removed in #202 and restored in #209 to avoid a breaking change.

Since we still have it, I suppose we might as well support using it to
control the prompt text color.
dahlbyk added a commit that referenced this pull request Mar 4, 2017
The setting exists for legacy reasons: 02956e1.
It was removed in #202 and restored in #209 to avoid a breaking change.

Since we still have it, I suppose we might as well support using it to
control the prompt text color.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants