Skip to content
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
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ go.work.sum
.env

# Editor/IDE
# .idea/
# .vscode/
.idea/
.vscode/

gogit
gitx
gitx.exe
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# gogit
# gitx
A TUI Helper for learning git (VCS)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/bakayu/gogit
module github.com/gitxtui/gitx

go 1.23

Expand Down
15 changes: 15 additions & 0 deletions internal/git/git.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package git

import (
"os/exec"
)

// GetStatus executes `git status` and returns its output as a string.
func GetStatus() (string, error) {
cmd := exec.Command("git", "status")
output, err := cmd.CombinedOutput()
if err != nil {
return string(output), err
}
return string(output), nil
}
34 changes: 34 additions & 0 deletions internal/tui/tui.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package tui

import (
"github.com/gitxtui/gitx/internal/git"
"github.com/rivo/tview"
)

// App represents the main application
type App struct {
*tview.Application
}

// NewApp creates and configures the main tview application
func NewApp() *App {
// Get git status
status, err := git.GetStatus()
if err != nil {
// If git command fails, return error
status = err.Error()
}

// Create TUI components
textView := tview.NewTextView().
SetText(status).
SetScrollable(true)

textView.SetBorder(true).SetTitle("Git Status")

app := tview.NewApplication().
SetRoot(textView, true).
SetFocus(textView)

return &App{app}
}
12 changes: 0 additions & 12 deletions main.go

This file was deleted.

Loading