-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Git prompt using libgit2 (again) (#55)
* Added simple Git repository parsing code The reference (which can be the branch name or commit hash) is obtained by reading `.git/HEAD` because the suggested way (https://stackoverflow.com/questions/12132862) does not work (`git_repository_head` fails) if there are no commits on the branch yet. * Workflow: install libgit2 on Linux * Merge and rebase status * Cherry-picking and reverting statuses * Reverted workflow change * Bisecting status * Full handling of (unborn) branch name, commit ID and tag * No need to check if reference is branch `git_branch_name` already does that * Status listing with callback * Moved callback function explanation to declaration * Replaced state `bool`s with single `std::string` * Added `bare` member * Renamed `set_*` methods as `establish_*` because they are not setters * Skip ignored files in status detection * Completed status detection code * Use git information from libgit2 instead of `__git_ps1` * Updated Bash and Zsh to not pass `__git_ps1` output * Initialise all primitive members Use this to detect if there is no Git repository. * Fixed edge case: a file can be new and modified both * Removed static linking on Windows Cannot link libgit2 statically * Renames and minor fixes * Moved tag detection to separate method * Detect annotated and unannotated tags both * Bit-fiddling to set dirty, staged and untracked statuses * Removed parameter names from method declarations * Updated documentation * Added Windows workflow to build libgit2 statically * Use Git instead of GitHub CLI, which requires a token * Install to target * Fixed `make` command * Windows has `mkdir` * Install pkg-onfig * Removed package workflow * Removed code to load `__git_ps1` in Bash and Zsh
- Loading branch information
Showing
7 changed files
with
309 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.