gg icon indicating copy to clipboard operation
gg copied to clipboard

Show relativePath in the result for better readability

Open dineshba opened this issue 5 years ago • 7 comments

dineshba avatar Apr 21 '20 04:04 dineshba

y? Full path is always better

jpninanjohn avatar Apr 21 '20 18:04 jpninanjohn

Mostly we know where we are running the gg command from. So relativePath should be understandable by the users.

WITH RELATIVE PATH (with 3 columns. I feel we can remove the time colume)

✦ ❯ gg status
./nomad-cluster                          new files                                                                                                     00:00:00
./microservices-demo                     1 ahead, modifications                                                                                        00:00:00
./endgame/istio                          no changes                                                                                                    00:00:00
./endgame/k8s-cluster                    no changes                                                                                                    00:00:00
./endgame/kube-prometheus                no changes                                                                                                    00:00:00
./compose2nomad                          no changes                                                                                                    00:00:00
./consul-k8s-l7-obs-guide                no changes                                                                                                    00:00:00
./contacts-ui                            new files                                                                                                     00:00:00

WITH FULL PATH

✦ ❯ gg status
"/Users/dinesh/projects/trials/devops/nomad-cluster": new files
"/Users/dinesh/projects/trials/devops/microservices-demo": 1 ahead, modifications
"/Users/dinesh/projects/trials/devops/endgame/istio": no changes
"/Users/dinesh/projects/trials/devops/endgame/k8s-cluster": no changes
"/Users/dinesh/projects/trials/devops/endgame/kube-prometheus": no changes
"/Users/dinesh/projects/trials/devops/compose2nomad": no changes
"/Users/dinesh/projects/trials/devops/consul-k8s-l7-obs-guide": no changes
"/Users/dinesh/projects/trials/devops/contacts-ui": new files

Output of relativePath looks simple. So suggesting. Thoughts ?

dineshba avatar Apr 22 '20 06:04 dineshba

I agree it looks simple. I was thinking, for navigation purposes... absolute path is always better. In case they see a repo with changes and want to go to it. Yes it will work with relative path also but only if their dir hasn't changed. Presentation wise, I would go with relative path... but for navigation purposes.. absolute is better.

Lets take a scenario. I have a nested structure like this.

- home
- dir1
    - inner dir
       -repo1
       -repo2
    - inner dir 2
       -repo3

If I run gg from where dir1 is, I would get relative paths to each of these. Suppose I go inside dir1. I can no longer use any of the paths shown in gg status unless I run from within again.

jpninanjohn avatar Apr 22 '20 19:04 jpninanjohn

Yes. time column is not needed

jpninanjohn avatar Apr 22 '20 19:04 jpninanjohn

@dineshba Can I close this? Do you still think relative path is needed?

jpninanjohn avatar Jun 05 '20 04:06 jpninanjohn

I still feel, few might prefer relative path to absolute path. If it is configurable using some env or flag, it should be good.

dineshba avatar Jun 08 '20 03:06 dineshba

Ok. Keep it configurable

jpninanjohn avatar Jun 10 '20 05:06 jpninanjohn