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

Handle replication of git base path within full path #47

Open
renatofq opened this issue Apr 25, 2023 · 0 comments
Open

Handle replication of git base path within full path #47

renatofq opened this issue Apr 25, 2023 · 0 comments

Comments

@renatofq
Copy link

That's maybe too specific but I have a directory structure somewhat like this

~/projects ❱ tree -L 2
.
├── project_a
│   ├── dev_project_a
│   ├── prd_project_a
│   ├── project_a
│   └── stg_project_a
└── project_b
    ├── dev_project_b
    ├── prd_project_b
    ├── project_b
    └── stg_project_b

Where all of these leaves are git repos. The thing is, when I get into ~/projects/project_a/project_a, the prompt is shown like this

~/p/project_a/project_a master ❱

And when I I get into ~/projects/project_a/project_a/src it goes like that

~/p/project_a/p/src master ❱

I've made a small patch to fix it

24c24
<         string replace -- "/$git_base/" /:/ |
---
>         string replace --regex -- "/($git_base)(?!.*\1)/" "/:/" |
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

No branches or pull requests

1 participant