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

align repo msg #250

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
install:
pip3 install -e .
test:
pytest tests --cov=./gita $(TEST_ARGS) -n=auto
pytest tests --cov=./gita $(TEST_ARGS) -n=auto -vv
dist:
python3 setup.py sdist
twine:
Expand Down
5 changes: 3 additions & 2 deletions gita/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ def get_commit_time(prop: Dict[str, str]) -> str:
def get_repo_status(prop: Dict[str, str], no_colors=False) -> str:
head = get_head(prop["path"])
dirty, staged, untracked, color = _get_repo_status(prop, no_colors)
info = f"{head:<10} [{dirty+staged+untracked}]"
if color:
return f"{color}{head+' ['+dirty+staged+untracked+']':<13}{Color.end}"
return f"{head+' ['+dirty+staged+untracked+']':<13}"
return f"{color}{info:<17}{Color.end}"
return f"{info:<17}"


def get_repo_branch(prop: Dict[str, str]) -> str:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
setup(
name="gita",
packages=["gita"],
version="0.16.4",
version="0.16.4.2",
license="MIT",
description="Manage multiple git repos with sanity",
long_description=long_description,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ def test_ls(self, monkeypatch, capfd):
[
(
PATH_FNAME,
"repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \nxxx cmaster [dsu] \x1b[0m msg \n",
"repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \nxxx cmaster [dsu] \x1b[0m msg \n",
),
(PATH_FNAME_EMPTY, ""),
(
PATH_FNAME_CLASH,
"repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \n",
"repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \n",
),
],
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ def test_auto_group(repos, paths, expected):
(
[{"abc": {"path": "/root/repo/", "type": "", "flags": []}}, False],
True,
"abc \x1b[31mrepo [*+?] \x1b[0m msg xx",
"abc \x1b[31mrepo [*+?] \x1b[0m msg xx",
),
(
[{"abc": {"path": "/root/repo/", "type": "", "flags": []}}, True],
True,
"abc repo [*+?] msg xx",
"abc repo [*+?] msg xx",
),
(
[{"repo": {"path": "/root/repo2/", "type": "", "flags": []}}, False],
False,
"repo \x1b[32mrepo [?] \x1b[0m msg xx",
"repo \x1b[32mrepo [?] \x1b[0m msg xx",
),
],
)
Expand Down