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

Alternative Git Status details? #524

Closed
MunifTanjim opened this issue Jun 12, 2017 · 10 comments · Fixed by #635
Closed

Alternative Git Status details? #524

MunifTanjim opened this issue Jun 12, 2017 · 10 comments · Fixed by #635
Milestone

Comments

@MunifTanjim
Copy link
Contributor

Current Behaviour

Prompt shows line differences as git status. e.g.:

master(+27,-20)

Proposed Behaviour

I assume, the current behavior works alright with many people, as nobody has said anything about it. But if I have difference with thousands of lines that info is of little use. Rather a shortened info about git status would be more helpful. Such as: if there are 3 staged files, 2 unstaged files and 2 untracked files, the prompt could show:

master(S:3 U:2 ?:2)

Is there any plan for adding this feature? It can be implemented behind an optional variable, without breaking any default behavior. I've already implemented this feature on my personal repository. If adding this feature causes no problem, I can send a PR.

@MunifTanjim MunifTanjim changed the title Alternative Git Status? Alternative Git Status details? Jun 12, 2017
@nojhan
Copy link
Collaborator

nojhan commented Jun 12, 2017

Maybe we can add an option for displaying details or not, something like LP_ENABLE_GIT_DETAILS.
By default, the prompt would show branch(±47)+* (even shorter than the current one) but could be expanded to branch(+27 -20 3S 2U 2?) when the option is enabled.

@MunifTanjim
Copy link
Contributor Author

That sounds great too! Also another thing, could we split them into different functions? For example:

_lp_git_diff would output +27 -20
_lp_git_status would output 3S 2U 2?

And then they will be conditionally called from the current _lp_git_branch_color function.

I'm not sure if adding extra functions will cause any performance hit. They are loaded only once during startup, so I don't think an extra 2 or 3 functions will cause noticeable performance hit. But, as I said, I'm not sure.

The upside of using separate functions is that, if users want to tweak the behavior of any specific function, they can override it easily after liquidprompt is sourced.

@MunifTanjim
Copy link
Contributor Author

On another note, even if you don't like the extra colon (i.e. S:3 U:2 ?:2), I think putting S, U and ? before the number is more readable than putting them after. In my defense,

When you read 3S 2U 2? you will have to first read the number, then you will know if it's for Staged/Unstaged/Untracked files.

But, when you read S3 U2 ?2 you immediately know which type of number you are going to read. Also, you will know that the first letter will always represent the type (just as +27 -20).

It's a very minor detail, I know, but just pointing it out.

@nojhan
Copy link
Collaborator

nojhan commented Jun 12, 2017

Just try and have a look at performances, if it have a minor effect, OK for two functions.

You've got a point on letter/number order.

I would also add that one should look for unicode symbols, too (we already have both in liquid.theme).

@brianmay
Copy link
Contributor

I would really like to see the number of stashed changes in the prompt. Stashed changes are something I am always forgetting.

@augmentedfourth
Copy link
Contributor

@brianmay I usually see a + in the prompt when I have stashed changes. It doesn't list the number, but is the notification that you have one or more enough to remind you to git stash list at least?

@brianmay
Copy link
Contributor

brianmay commented Feb 4, 2018

Strange, I never saw a plus in the prompt when there were stashed changes. However, I was using the last official release, 1.11, which might be somewhat old.

In any case, have switched to another solution now.

@nojhan
Copy link
Collaborator

nojhan commented Aug 19, 2018

I now think that the VCS design should be more oriented toward a simple workflow of "what needs to be done now", just like the Oh-my-git prompt.

@BlueDrink9
Copy link

Chiming in here, I'm also keen for a lot more customisability on the VCS side. Currently I just have it disabled, in favour of my own version that takes up much less room than the standard >12 characters.

@Rycieos Rycieos added this to the v2.0 milestone Jul 5, 2020
@Rycieos Rycieos linked a pull request Dec 14, 2020 that will close this issue
@Rycieos
Copy link
Collaborator

Rycieos commented Jan 21, 2021

Merged a reworked version of @MunifTanjim's PR #525 as #635. This adds a separate theme alternate_vcs that functionally works as @MunifTanjim described.

For those that wanted a simpler way to modify the VCS display, check out the implementation of that new theme in themes/alternate_vcs/ as an example. The new theming engine in v2 makes it much simpler than before.

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 a pull request may close this issue.

6 participants