-
Notifications
You must be signed in to change notification settings - Fork 1.2k
other repl config ideas #1224
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
base: main
Are you sure you want to change the base?
other repl config ideas #1224
Conversation
|
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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)
Co-authored-by: Edwin Kofler <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.