{"id":19090530,"url":"https://github.com/sschleemilch/cpp-gitbash-powerline","last_synced_at":"2025-08-24T16:46:43.794Z","repository":{"id":113906229,"uuid":"181168864","full_name":"sschleemilch/cpp-gitbash-powerline","owner":"sschleemilch","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-26T19:01:23.000Z","size":234,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T07:17:42.968Z","etag":null,"topics":["bashrc","cpp","git","gitbash","powerline-shell"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sschleemilch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-13T12:37:15.000Z","updated_at":"2024-01-22T09:06:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"95f4cd26-758d-437a-bad4-1e1b42732c57","html_url":"https://github.com/sschleemilch/cpp-gitbash-powerline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sschleemilch/cpp-gitbash-powerline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschleemilch%2Fcpp-gitbash-powerline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschleemilch%2Fcpp-gitbash-powerline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschleemilch%2Fcpp-gitbash-powerline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschleemilch%2Fcpp-gitbash-powerline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sschleemilch","download_url":"https://codeload.github.com/sschleemilch/cpp-gitbash-powerline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschleemilch%2Fcpp-gitbash-powerline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271907400,"owners_count":24842069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bashrc","cpp","git","gitbash","powerline-shell"],"created_at":"2024-11-09T03:05:34.058Z","updated_at":"2025-08-24T16:46:43.764Z","avatar_url":"https://github.com/sschleemilch.png","language":"C++","readme":"# cpp-gitbash-powerline\n\nA gitbash-powerline implemented in C++ using libgit2.\nProvides several information regarding the git repository currently navigated into such as:\n- current branch + commitID or showing that you are on a detached HEAD\n- how many commits the current branch is ahead/behind of its origin reference\n- modified, staged, untracked files if not switched off with '--no-status'\n- warning if on detached HEAD and modified files are present\n\n## Using\n\n### Install and configure a Powerline Font\nFor being able to use the binary as it is you do need to setup a font that supports the unicode characters\nbeing used. You can find the font I am using in `setup`.\n\nIn case of Windows, to activate the font, you will need to modify your `~/.minttyrc`. Here an example content with a color schema:\n\n```\nBoldAsFont=no\nFont=DejaVu Sans Mono for Powerline\nBoldAsColour=yes\nFontHeight=13\nForegroundColour=248,248,242\nBackgroundColour=40,42,54\nBlack=0,0,0\nBoldBlack=40,42,53\nRed=255,85,85\nBoldRed=255,110,103\nGreen=80,250,123\nBoldGreen=90,247,142\nYellow=241,250,140\nBoldYellow=244,249,157\nBlue=202,169,250\nBoldBlue=202,169,250\nMagenta=255,121,198\nBoldMagenta=255,146,208\nCyan=139,233,253\nBoldCyan=154,237,254\nWhite=191,191,191\nBoldWhite=230,230,230\nTerm=xterm-256color\nTransparency=off\nOpaqueWhenFocused=no\n```\n\nIn case of Unix, you will have the best experience if you change your terminal color-shema to the same colors defined\nas the given colors in `.minttyrc`. I recommend playing around with the colors that in the end it just looks good (e.g. use gpick to find the right colors\nso that the prompt symbol has transparent background).\n\n\n### .bashrc adaptions to call the executable\n\nWe need to manuplate the `PS1` variable of our bash to call our executable and saving the result in a variable.\nSince printing Unicode can be messy on Windows, I decided to leave it to the bash itself to interprete the \nunicode sequences. Therefore, I am calling `echo -e \u003cbinary-result\u003e`.\nFor large repositories, the repository status information can be switched off and on, since a `git status` can\ntake several seconds (even though the implementation with libgit2 is faster then a normal `git status` on the \ncommand line!). For that purpose, the following `.bashrc` example also defines a small function to be able to\nswitch the status of files in the index and in the working tree dynamically and defining a short alias for it.\n\n```bash\nGITBASH_POWERLINE_STATUS=\nfunction _update_ps1() {\n   PS1_CONTENT=\"$(\u003cpath-to-gitbash-binary\u003e $? $GITBASH_POWERLINE_STATUS 2\u003e /dev/null)\"\n   PS1=\"$(echo -e $PS1_CONTENT) \"\n}\n\n\nPROMPT_COMMAND=\"_update_ps1; $PROMPT_COMMAND\"\n\n\nfunction gitbash_powerline_switch_status() {\n    if [ \"$GITBASH_POWERLINE_STATUS\" = --no-status ] ; then\n        GITBASH_POWERLINE_STATUS=\n    else\n        GITBASH_POWERLINE_STATUS=--no-status\n    fi\n}\n\nalias switch_status=gitbash_powerline_switch_status\n```\n\n## Compiling\n\n### Linux (Ubuntu as example)\n\n- install openssl: `sudo apt install libssl-dev`\n- install build-essentials: `sudo apt install build-essentials`\n- install cmake: `sudo apt install cmake`\n\n`mkdir build \u0026\u0026 cd build`\n`cmake ..`\n`cmake --build .`\n\n### Windows\n\n- I did compile with msvc 16 which is shipped with Visual Studio 2019 Community Edition\n\n`mkdir build \u0026\u0026 cd build`\n`cmake ..`\n`cmake --build .`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschleemilch%2Fcpp-gitbash-powerline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsschleemilch%2Fcpp-gitbash-powerline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschleemilch%2Fcpp-gitbash-powerline/lists"}