Closed jboulter11 closed 2 years ago
It's been a while since I've looked at the git-info formatting code... as far as I can tell, we don't do anything like this anywhere else in git-info (overriding a prompt variable depending on another one). It still may be worthwhile though.
I think the example you gave can be done without this patch, by setting the dirty format to just include the color format. I took another look at this and it doesn't seem like it.
So, I think this would be worthwhile, I just worry about the ballooning complexity if there are other use cases where people want to change other parts of the prompt based on git statuses. That being said, I'm not sure if there's a good way to account for that, so I guess we could just take things as they come.
Sorry, that was a bit of a ramble - the TL;DR is that I'm inclined to accept and merge this, but I'd be curious what the other maintainers think.
@belak thanks for your feedback. I agree that having these fields interact could be a slippery slope, but I think this one is pretty straightforward and the functionality is easy to understand and reason about.
If we are waiting on others, should we should give them a tag to get their attention?
@belak since no one has spoken up at this point, think we can merge this one?
That works! Thanks for the reminder ping!
Thank you! :)
Proposed Changes
Example usage, taken from my own prompt:
Clean:
Dirty: