mathiasbynens / mathiasbynens/dotfiles
Use git-prompt.sh from git contrib
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 31.5k
- Forks
- 8.4k
- PR merge metrics
- No merged PRs in 30d
Description
Instead of the current git functions in `.bash_prompt` it would be better to use the recommended git way of customizing your PS1.
Checkout source and docs here: https://github.com/git/git/blob/v1.8.4/contrib/completion/git-prompt.sh
It gives you a single function __git_ps1 to use in your prompt and you can customize it with few environment variables.
It has features like:
- Show a `$` for available stash.
- Show `>`, `<` or `=` for comparison between a local and a remote branch
- Show a `+` for staged changes.
- Show a `%` for untracked files.
All of these are optional and could be set via some global constants so it is more customizable.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the current git functions in `.bash_prompt` and the linked `contrib/completion/git-prompt.sh` source and documentation. Replace the existing prompt integration with `__git_ps1`, preserving the prompt behavior and exposing the optional stash, branch comparison, staged-change, and untracked-file indicators through configurable constants; done means the prompt reflects those states correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, git, shell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100