Skip to content

Handle replication of git base path within full path  #47

@renatofq

Description

@renatofq

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)/" "/:/" |

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions