Skip to content

fix: display relative repo path instead of repo name in directory column#39

Closed
casperklein wants to merge 1 commit intobircni:mainfrom
casperklein:fix-36
Closed

fix: display relative repo path instead of repo name in directory column#39
casperklein wants to merge 1 commit intobircni:mainfrom
casperklein:fix-36

Conversation

@casperklein
Copy link
Contributor

Before:

git-statuses -c -d 2
┌─────────────┬─────────────────────┬────────────┬─────────┬─────────┐
│ Directory   ┆ Branch              ┆ Local      ┆ Commits ┆ Status  │
╞═════════════╪═════════════════════╪════════════╪═════════╪═════════╡
│ my-repo     ┆ master              ┆ ↑0 ↓0      ┆ 34      ┆ Clean   │
│ a           ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
│ b           ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
│ d           ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
└─────────────┴─────────────────────┴────────────┴─────────┴─────────┘

After:

git-statuses -c -d 2
┌─────────────┬─────────────────────┬────────────┬─────────┬─────────┐
│ Directory   ┆ Branch              ┆ Local      ┆ Commits ┆ Status  │
╞═════════════╪═════════════════════╪════════════╪═════════╪═════════╡
│ foo/my-repo ┆ master              ┆ ↑0 ↓0      ┆ 34      ┆ Clean   │
│ a           ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
│ b           ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
│ c/d         ┆ master (no commits) ┆ local-only ┆ 0       ┆ Unknown │
└─────────────┴─────────────────────┴────────────┴─────────┴─────────┘

This fixes #35, #36 and probably #38.

@bircni
Copy link
Owner

bircni commented Sep 15, 2025

@casperklein I would suggest to add another cell to the table with the dir as the dir can be named other than the repository itself

@casperklein
Copy link
Contributor Author

Currently there is a Directory column, however it is not showing the directory a repo is in, but instead the repo "name". IMO this is misleading.

Technically speaking, a repo doesn't have a name (there is no meta data for that). If I create a new repo with git init in any directory, the repo is created, but doesn't have any name. You can rename this directory to whatever you want afterwards.

When talking about remotes, there is something like a name, because you have to address the remote repo somehow: https://github.com/user/REPO-NAME

My suggestion is, to fix the Directory column, so it displays the directory, where a repo is in (this PR).

Personally, I don't see a real value in adding another Name column. If someone is interested in the remote name, there is already the -r option.

@bircni
Copy link
Owner

bircni commented Sep 17, 2025

@casperklein I created #40 - Would this fit for you?

@casperklein
Copy link
Contributor Author

I've tested #40 and it fixes #35, #36 for me.

If the remote name and the local directory name differs, the directory is shown in parentheses.

However, that leads in some cases to a doubling of the column width for me. As said earlier, I personally don't have a need to see the "repo name", as I can use -r to get that info if I want. I would prefer, that the column would only show the directory.

@bircni
Copy link
Owner

bircni commented Oct 3, 2025

found some problems in your changes, fixed them and will be merging now and releasing a new version soon

@casperklein
Copy link
Contributor Author

Thank you! I can confirm, this works 👍

@casperklein casperklein deleted the fix-36 branch October 3, 2025 20:06
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

Successfully merging this pull request may close these issues.

Directory name in listing is wrong

2 participants