Skip to content

Conversation

@jjb
Copy link

@jjb jjb commented Jan 10, 2026

git-extras (other-repl-config-ideas)±

@jjb
Copy link
Author

jjb commented Jan 10, 2026

@spacewander @hyperupcall

a few more ideas - maybe currently a bit messy, open to any feedback

WDYT?

project_name=""
fi

prompt_base="$prefix$project_name$cur_string$es_string$prompt_character"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need separator between $prefix and $project_name

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

bin/git-repl Outdated

show_project_name=$(git config --get --default 'false' git-extras.repl.show-project-name)
if [[ "$show_project_name" == "true" ]]; then
project_name=$(basename $(git config --get remote.origin.url) .git)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the repo doesn't have a remote, this will cause an error. What about falling back to git rev-parse --show-toplevel?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, noting that git config's --default doesn't quite fix this since git rev-parse --show-toplevel prints a directory that might end with .git.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, i made it always be git rev-parse --show-toplevel, i can't think of a scenario where i would want git config --get remote.origin.url. if someone has two checkous, my-project and my-project-tmp, they would want to know they are in the -tmp variant.

Copy link
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small suggestion by me, otherwise looks great (aside from @spacewander's comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants