bash-git-prompt
bash-git-prompt copied to clipboard
Add mercurial-support
This addresses #222. The set of displayable information is not exactly the same due to differences in how hg and git work, but this comes close and displays other useful information in places where hg differs from git.
Sorry for trashing gitstatus.sh, wrapping the existing code in a function seemed to be the easiest way.
Hi Jörg,
I've offered to jump in to get this reviewed. I contribute to mercurial and would love to see this merged too. Would you be able to rebase this patch on top of master? That'll make it easier for me to test locally, so we can see if this can be landed!
Thanks!
Hi @jwalt,
could you please rebase this PR on top of master?
Thanks a lot
Hi @jwalt, I don't know if you are still interested in this feature, but if so, I'd suggest the following changes in order to have separate the concerns better:
- Create a new script which is called "git-support.sh`.
- Move all git operations used anywhere in the repository out to this script into well named really short (usually one-liners) functions.
- Source the git-operatoins.sh in the script which needs git
this would be a good first merge request by separating git from the rest of the logic.
The next one would then be, to create a mercurial-support.sh
script, and implement the same functions as it was done in the git-support.sh
, and make the sourcing then a little bit smarter to decide if it is git or mercurial.
If you can work in this changes, I'm happy to merge this for you.