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

Add git root inside a git repo #111

Merged
merged 6 commits into from
Dec 3, 2020

Conversation

gazorby
Copy link
Contributor

@gazorby gazorby commented Jan 30, 2020

WHAT

Inside a git repository (either at root or under sub directories), the list is shifted towards the bottom so the first element become the git root folder of the repository.

Support has been added for both zsh and fish.

WHY

#110

@gazorby gazorby requested a review from babarot January 30, 2020 01:52
@babarot
Copy link
Owner

babarot commented Jan 30, 2020

Wow, amazing. I'll check it later

@babarot babarot added area/bash Catch all for changes in bash files area/fish Catch all for changes in fish files area/zsh Catch all for changes in zsh files labels Feb 7, 2020
Copy link
Owner

@babarot babarot left a comment

Choose a reason for hiding this comment

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

LGTM!

@babarot
Copy link
Owner

babarot commented Feb 9, 2020

@gazorby

Sorry for the late response and thank you for the contribution!

Could you fix the conflicts?

@hoshsadiq
Copy link

Slight request for improvement, can we change it so that it doesn't show if you're at the git root dir?

@@ -0,0 +1,8 @@
__enhancd::entry::git::root()
{
if git rev-parse --is-inside-work-tree 2> /dev/null && [[ $(git rev-parse --show-toplevel) != $PWD ]]; then

Choose a reason for hiding this comment

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

I suggest to quote the $(git rev-parse --show-toplevel) and $PWD to prevent issues with spaces in dir/file names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the bash manual,

Word splitting and filename expansion are not performed on the words between the [[ and ]]

So i don't think it's necessary

Choose a reason for hiding this comment

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

Cool! Didn't know that.

@hoshsadiq
Copy link

Thanks for the update @gazorby!

@hoshsadiq
Copy link

Any update on this?

@gazorby gazorby mentioned this pull request Nov 8, 2020
1 task
@jorgebucaran
Copy link
Collaborator

@hoshsadiq We should probably merge #139 first and then come back to this.

@jorgebucaran jorgebucaran merged commit 52cd5f5 into babarot:master Dec 3, 2020
jorgebucaran added a commit that referenced this pull request Dec 3, 2020
Fix Fish installation (#107, #108, #123, #124, #132)
Use Fisher for Fish; drop OMF support
Add Alt+F key binding to trigger enhancd when writing commands and paste the selected item in Fish
Add git root inside a git repo (#110, #111) (Fish & Bash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bash Catch all for changes in bash files area/fish Catch all for changes in fish files area/zsh Catch all for changes in zsh files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants