branchy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- branchy-0.1.0/PKG-INFO +53 -0
- branchy-0.1.0/README.md +40 -0
- branchy-0.1.0/branchy/__init__.py +0 -0
- branchy-0.1.0/branchy/cli.py +133 -0
- branchy-0.1.0/branchy.egg-info/PKG-INFO +53 -0
- branchy-0.1.0/branchy.egg-info/SOURCES.txt +11 -0
- branchy-0.1.0/branchy.egg-info/dependency_links.txt +1 -0
- branchy-0.1.0/branchy.egg-info/entry_points.txt +2 -0
- branchy-0.1.0/branchy.egg-info/requires.txt +1 -0
- branchy-0.1.0/branchy.egg-info/top_level.txt +1 -0
- branchy-0.1.0/pyproject.toml +16 -0
- branchy-0.1.0/setup.cfg +4 -0
- branchy-0.1.0/setup.py +31 -0
branchy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: branchy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Git branch viewer CLI tool
|
|
5
|
+
Home-page: https://taplink.cc/itsqaxxorov
|
|
6
|
+
Author: Axmadjon Qaxxorov
|
|
7
|
+
License: MIT
|
|
8
|
+
Requires-Python: >=3.7
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: rich
|
|
11
|
+
Dynamic: home-page
|
|
12
|
+
Dynamic: requires-python
|
|
13
|
+
|
|
14
|
+
# 🌿 branchy – Beautiful Git Branch Viewer CLI
|
|
15
|
+
|
|
16
|
+
`branchy` is a lightweight and colorful CLI tool for exploring your local and remote Git branches with elegance.
|
|
17
|
+
|
|
18
|
+
[](https://pypi.org/project/branchy/)
|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ✨ Features
|
|
25
|
+
|
|
26
|
+
- 📍 Lists both local and remote branches separately
|
|
27
|
+
- 📅 Shows creation and latest commit times
|
|
28
|
+
- 👤 Displays commit author and number of commits
|
|
29
|
+
- 💬 Shows latest commit message
|
|
30
|
+
- 🌈 Rich-powered terminal output with colors and clean formatting
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 📦 Installation
|
|
35
|
+
|
|
36
|
+
*Install via PyPI:*
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
pip install branchy
|
|
40
|
+
```
|
|
41
|
+
**🚀 Usage Just run:**
|
|
42
|
+
|
|
43
|
+
```branchy```
|
|
44
|
+
|
|
45
|
+
Options:
|
|
46
|
+
```--help``` or ```-h``` – *Show help message*
|
|
47
|
+
|
|
48
|
+
*--creator or -c – Show tool creator info*
|
|
49
|
+
|
|
50
|
+
**👨💻 Author Axmadjon Qaxxorov**
|
|
51
|
+
|
|
52
|
+
**[🔗 Visit My Taplink](https://taplink.cc/itsqaxxorov)**
|
|
53
|
+
|
branchy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 🌿 branchy – Beautiful Git Branch Viewer CLI
|
|
2
|
+
|
|
3
|
+
`branchy` is a lightweight and colorful CLI tool for exploring your local and remote Git branches with elegance.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/branchy/)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
12
|
+
|
|
13
|
+
- 📍 Lists both local and remote branches separately
|
|
14
|
+
- 📅 Shows creation and latest commit times
|
|
15
|
+
- 👤 Displays commit author and number of commits
|
|
16
|
+
- 💬 Shows latest commit message
|
|
17
|
+
- 🌈 Rich-powered terminal output with colors and clean formatting
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
*Install via PyPI:*
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
pip install branchy
|
|
27
|
+
```
|
|
28
|
+
**🚀 Usage Just run:**
|
|
29
|
+
|
|
30
|
+
```branchy```
|
|
31
|
+
|
|
32
|
+
Options:
|
|
33
|
+
```--help``` or ```-h``` – *Show help message*
|
|
34
|
+
|
|
35
|
+
*--creator or -c – Show tool creator info*
|
|
36
|
+
|
|
37
|
+
**👨💻 Author Axmadjon Qaxxorov**
|
|
38
|
+
|
|
39
|
+
**[🔗 Visit My Taplink](https://taplink.cc/itsqaxxorov)**
|
|
40
|
+
|
|
File without changes
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.table import Table
|
|
9
|
+
|
|
10
|
+
console = Console()
|
|
11
|
+
|
|
12
|
+
def run_git_command(args):
|
|
13
|
+
result = subprocess.run(["git"] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
|
14
|
+
return result.stdout.strip()
|
|
15
|
+
|
|
16
|
+
def get_branches():
|
|
17
|
+
local_raw = run_git_command(["branch"]).split('\n')
|
|
18
|
+
remote_raw = run_git_command(["branch", "-r"]).split('\n')
|
|
19
|
+
|
|
20
|
+
local_branches = []
|
|
21
|
+
remote_branches = []
|
|
22
|
+
current_branch = ""
|
|
23
|
+
|
|
24
|
+
for line in local_raw:
|
|
25
|
+
name = line.strip()
|
|
26
|
+
is_current = name.startswith("*")
|
|
27
|
+
name = name.lstrip("* ").strip()
|
|
28
|
+
if is_current:
|
|
29
|
+
current_branch = name
|
|
30
|
+
local_branches.append((name, is_current))
|
|
31
|
+
|
|
32
|
+
for line in remote_raw:
|
|
33
|
+
name = line.strip()
|
|
34
|
+
if "->" not in name:
|
|
35
|
+
remote_branches.append(name)
|
|
36
|
+
|
|
37
|
+
return current_branch, local_branches, remote_branches
|
|
38
|
+
|
|
39
|
+
def get_branch_info(branch):
|
|
40
|
+
first_commit = run_git_command(["log", "--reverse", "--format=%at", branch])
|
|
41
|
+
last_commit = run_git_command(["log", "-1", "--format=%at", branch])
|
|
42
|
+
last_msg = run_git_command(["log", "-1", "--format=%s", branch])
|
|
43
|
+
author = run_git_command(["log", "-1", "--format=%an", branch])
|
|
44
|
+
commit_count = run_git_command(["rev-list", "--count", branch])
|
|
45
|
+
|
|
46
|
+
def format_time(ts):
|
|
47
|
+
return datetime.fromtimestamp(int(ts)).strftime("%Y-%m-%d %H:%M:%S") if ts else "Unknown"
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
"created": format_time(first_commit.splitlines()[0]) if first_commit else "Unknown",
|
|
51
|
+
"last_commit": format_time(last_commit) if last_commit else "Unknown",
|
|
52
|
+
"last_msg": last_msg if last_msg else "N/A",
|
|
53
|
+
"author": author if author else "N/A",
|
|
54
|
+
"commits": commit_count if commit_count else "0"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
def print_branches_table(branches, branch_type="Local", current_branch=""):
|
|
58
|
+
table = Table(title=f"{branch_type} Branches", show_lines=True)
|
|
59
|
+
|
|
60
|
+
table.add_column("Branch", style="bold cyan")
|
|
61
|
+
table.add_column("Current", justify="center")
|
|
62
|
+
table.add_column("Created At")
|
|
63
|
+
table.add_column("Last Commit At")
|
|
64
|
+
table.add_column("Commits", justify="right")
|
|
65
|
+
table.add_column("Author")
|
|
66
|
+
table.add_column("Last Message", style="italic")
|
|
67
|
+
|
|
68
|
+
for name, *rest in branches:
|
|
69
|
+
is_current = rest[0] if rest else False
|
|
70
|
+
info = get_branch_info(name)
|
|
71
|
+
table.add_row(
|
|
72
|
+
name,
|
|
73
|
+
"✅" if is_current else "",
|
|
74
|
+
info["created"],
|
|
75
|
+
info["last_commit"],
|
|
76
|
+
info["commits"],
|
|
77
|
+
info["author"],
|
|
78
|
+
info["last_msg"]
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
console.print(table)
|
|
82
|
+
|
|
83
|
+
def print_help():
|
|
84
|
+
console.print("""
|
|
85
|
+
[bold cyan]Git Branch Viewer[/]
|
|
86
|
+
[bold]Usage:[/]
|
|
87
|
+
branchy [options]
|
|
88
|
+
|
|
89
|
+
[bold]Options:[/]
|
|
90
|
+
--help, -h Show this help message
|
|
91
|
+
-c, --creator Show creator details
|
|
92
|
+
""")
|
|
93
|
+
|
|
94
|
+
def print_creator():
|
|
95
|
+
console.print("""
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
.___ __
|
|
99
|
+
_____ ___ ___ _____ _____ __| _/ |__| ____ ____ ___________ ___ ______ ______________ _______ __ ____
|
|
100
|
+
\__ \ \ \/ // \\__ \ / __ | | |/ _ \ / \ / ____/\__ \ \ \/ /\ \/ / _ \_ __ \/ _ \ \/ // ___\
|
|
101
|
+
/ __ \_> <| Y Y \/ __ \_/ /_/ | | ( <_> ) | < <_| | / __ \_> < > < <_> ) | \( <_> ) /\ \___
|
|
102
|
+
(____ /__/\_ \__|_| (____ /\____ |/\__| |\____/|___| /\__ |(____ /__/\_ \/__/\_ \____/|__| \____/ \_/ \___ >
|
|
103
|
+
\/ \/ \/ \/ \/\______| \/ |__| \/ \/ \/ \/
|
|
104
|
+
|
|
105
|
+
👨💻 Created by: Axmadjon Qaxxorov
|
|
106
|
+
🛠 Command name: branchy
|
|
107
|
+
🔗 Taplink: https://taplink.cc/itsqaxxorov
|
|
108
|
+
""")
|
|
109
|
+
|
|
110
|
+
def main():
|
|
111
|
+
if len(sys.argv) > 1:
|
|
112
|
+
if sys.argv[1] in ['--help', '-h']:
|
|
113
|
+
print_help()
|
|
114
|
+
return
|
|
115
|
+
elif sys.argv[1] in ['-c', '--creator']:
|
|
116
|
+
print_creator()
|
|
117
|
+
return
|
|
118
|
+
else:
|
|
119
|
+
console.print("[bold red]❌ Invalid option! Use --help or -h for available options.[/]")
|
|
120
|
+
return
|
|
121
|
+
|
|
122
|
+
if not os.path.isdir(".git"):
|
|
123
|
+
console.print("[bold red]❌ This is not a Git repository.[/]")
|
|
124
|
+
return
|
|
125
|
+
|
|
126
|
+
current_branch, local_branches, remote_branches = get_branches()
|
|
127
|
+
print_branches_table(local_branches, "Local", current_branch)
|
|
128
|
+
|
|
129
|
+
remote_branch_tuples = [(name,) for name in remote_branches]
|
|
130
|
+
print_branches_table(remote_branch_tuples, "Remote")
|
|
131
|
+
|
|
132
|
+
if __name__ == "__main__":
|
|
133
|
+
main()
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: branchy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Git branch viewer CLI tool
|
|
5
|
+
Home-page: https://taplink.cc/itsqaxxorov
|
|
6
|
+
Author: Axmadjon Qaxxorov
|
|
7
|
+
License: MIT
|
|
8
|
+
Requires-Python: >=3.7
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: rich
|
|
11
|
+
Dynamic: home-page
|
|
12
|
+
Dynamic: requires-python
|
|
13
|
+
|
|
14
|
+
# 🌿 branchy – Beautiful Git Branch Viewer CLI
|
|
15
|
+
|
|
16
|
+
`branchy` is a lightweight and colorful CLI tool for exploring your local and remote Git branches with elegance.
|
|
17
|
+
|
|
18
|
+
[](https://pypi.org/project/branchy/)
|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ✨ Features
|
|
25
|
+
|
|
26
|
+
- 📍 Lists both local and remote branches separately
|
|
27
|
+
- 📅 Shows creation and latest commit times
|
|
28
|
+
- 👤 Displays commit author and number of commits
|
|
29
|
+
- 💬 Shows latest commit message
|
|
30
|
+
- 🌈 Rich-powered terminal output with colors and clean formatting
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 📦 Installation
|
|
35
|
+
|
|
36
|
+
*Install via PyPI:*
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
pip install branchy
|
|
40
|
+
```
|
|
41
|
+
**🚀 Usage Just run:**
|
|
42
|
+
|
|
43
|
+
```branchy```
|
|
44
|
+
|
|
45
|
+
Options:
|
|
46
|
+
```--help``` or ```-h``` – *Show help message*
|
|
47
|
+
|
|
48
|
+
*--creator or -c – Show tool creator info*
|
|
49
|
+
|
|
50
|
+
**👨💻 Author Axmadjon Qaxxorov**
|
|
51
|
+
|
|
52
|
+
**[🔗 Visit My Taplink](https://taplink.cc/itsqaxxorov)**
|
|
53
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
branchy/__init__.py
|
|
5
|
+
branchy/cli.py
|
|
6
|
+
branchy.egg-info/PKG-INFO
|
|
7
|
+
branchy.egg-info/SOURCES.txt
|
|
8
|
+
branchy.egg-info/dependency_links.txt
|
|
9
|
+
branchy.egg-info/entry_points.txt
|
|
10
|
+
branchy.egg-info/requires.txt
|
|
11
|
+
branchy.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rich
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
branchy
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "branchy"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Git branch viewer CLI tool"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.7"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Axmadjon Qaxxorov" }
|
|
9
|
+
]
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
dependencies = [
|
|
12
|
+
"rich"
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[project.scripts]
|
|
16
|
+
branchy = "branchy.cli:main"
|
branchy-0.1.0/setup.cfg
ADDED
branchy-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="branchy",
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
description="A beautiful CLI tool to explore Git branches with style.",
|
|
7
|
+
long_description=open("README.md", encoding="utf-8").read(),
|
|
8
|
+
long_description_content_type="text/markdown",
|
|
9
|
+
author="Axmadjon Qaxxorov",
|
|
10
|
+
url="https://taplink.cc/itsqaxxorov",
|
|
11
|
+
license="MIT",
|
|
12
|
+
packages=find_packages(),
|
|
13
|
+
python_requires=">=3.7",
|
|
14
|
+
install_requires=[
|
|
15
|
+
"rich"
|
|
16
|
+
],
|
|
17
|
+
entry_points={
|
|
18
|
+
"console_scripts": [
|
|
19
|
+
"branchy=branchy.cli:main",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
classifiers=[
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Environment :: Console",
|
|
27
|
+
"Topic :: Software Development :: Version Control :: Git",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
],
|
|
30
|
+
include_package_data=True,
|
|
31
|
+
)
|