Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement showing of git branch in the prompt #67

Merged
merged 3 commits into from
Sep 7, 2024

Commits on Sep 7, 2024

  1. Implement showing of git branch in the prompt

    We keep track of if we are inside a git repository inside the ShellState
    struct as well as if the branch was updated in the last command. In the main
    loop we then update the branch name if it wasn't already updated, and then show
    the branch in the prompt if we are inside a repository.
    
    We only visit `.git/HEAD` once per `set_cwd()` call and we only run again in
    the main loop if we did not run in that iteration yet.
    
    However I discovered that the `set_cwd()` call is being called twice in every
    iteration for some reason, and so we also read `.git/HEAD` twice. This is a
    separate issue so it should be fixed in a separate PR once this is merged.
    certik committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    93deb65 View commit details
    Browse the repository at this point in the history
  2. Apply cargo fmt

    certik committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    68d62a6 View commit details
    Browse the repository at this point in the history
  3. Fix a typo

    certik committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    d29d2d1 View commit details
    Browse the repository at this point in the history