You are browsing as a guest. Sign up (or log in) to start making projects!

dagit

  • 5 Devlogs
  • 13 Total hours

Visualize your Git repository in your terminal!

Ship #1 Changes requested

DAGIT SHIP1

I have built a terminal TUI git visualizer that beautifully displays your git repository on the terminal.

Challenging part

Dagit has four small sections [left panel/visualizer/status panel/logs]. I first thought there would be no resizing issues because I’m using bubble-tea and built all there sections’ skeletons, as bubble-tea doesn’t automatically handle the resize event(got to know later). I manually tried to fix it in my own broken ways and found somewhat of a solution that feels and looks good

A Breakdown of the project

  • dagit refuses to launch if we don’t open it inside a git repo.
  • We fetch all the data by running git commands.
  • Currently in the left panel we have the following information:
* Repo name
* The repo's owner name 
* Current branch 
* The url of the remote
  • In the vizualizer:
* hash of the commit 
* Reference 
* the committer name 
* The time of the commit
* We also beautify the graph and show it in this section
  • Log section:
* Hash of commit 
* Commit message
* Committer name 
  • Status panel:
* Modified, staged files are shown here
  • The user can toggle between the visualizer and the status panel using v

  • The user can also choose between my predefined tick rates[500ms/1s/3s/5s/10s]. By default the tick rate is set to 1sec

Proud

  • Of how quickly I have understood the git docs and used it to build this project that makes git look so much better for the newbies.

  • Also that I have finally made a project that is not very complicated for the user to use like gos was. lmao

  • Also handling resize events was a bit of headache and it feels so much better now. I feel proud because of that too :shy

Do we need to set something before?

  • No, but if you wanna install it using go, you need to have go installed :)

  • Note: The releases page only has a darwin(macos) and linux version. So I recommend using wsl on windows to enjoy the beauty of dagit

Installation

  • the simplest way to install dagit is using the AUR:
yay -S dagit-bin
  • Using go:
go install github.com/lxsh-S/dagit@latest
  • You can also install it from the github releases page (Make sure you get the latest version)
  • 5 devlogs
  • 13h
Try project → See source code →
Open comments for this post

2h 25m 14s logged

DAGIT DEVLOG 5

yoo once again!

I’ve worked on the features I’ve been delaying and let’s see the progress

Progress Overview

  • I first worked on the idea i got yesterday A status panel to see staged/modified files

  • Then I tried to work on scrollbars in the git log and the visualizer but I failed to do so I just scrapped it completely and reset the repo to the after status panel state

  • After scrapping that, I worked on the tick rate selection Intervals of time at which we update the data displayed in the TUI

DETAIL

  • The status panel idea had come when I was surfing git hub and was just looking at lazygit (A far better project than dagit btw). I saw the same panel there and thought of adding it here because it would make more sense, although dagit is different from lazygit (dagit is only trying to visualze git not become a workflow)

  • The scrollbars were out of my league I already knew that but still gave a try. I dont think I would be giving up on the idea. I’ll just watch some tutorials on bubbletea and scrollbars specifically before working on it again

  • At first, I thought I would make the tick rate selector a separate panel where we would just scroll through different intervals of time, but as I consider myself lazy I just thought of adding it in such a way that instead of scrolling we change the tick rate with the press of buttons. Although the max tickrate is already small(10sec) I recommend using 1sec on small projects

0
0
145
Open comments for this post

2h 49m 51s logged

DAGIT DEVLOG 4

Yoo!
I’ve made soo many updates and the resizing /clipping issues are still eating my brain like bugs :crying: :crying:

Progress overview

  • Decreased the sizes of reference being displayed also truncated lines in the gitlog so that the vertical clipping stops

  • I completely styled the UI using lipgloss and it looks soo much better now :yay: :yay: :yay: :yay: :yay:

  • Added highlighting to the head of the repo that pops a little more

  • Refactored the old way of refreshing the data

  • Refactored the code to increase readability

Explain

  • The git logs were looking odd because when the commit messages were long , the log that should only take the space of one line was now also taking space in the second line. So we fixed it using truncateMessages() function

  • As we are pushig to multiple tags . The reference also gets long and causes a clipping issue again. So we again simply dosent let the refs be that long[But the current implementation can cause the line to break suddenly that may not look good all the time]-

// Stop 'refs' being too long
if lipgloss.Width(refs) > 30 {
	refs = refs[:27] + "..."
}
  • And as dagit is a live visualizer, I removed the old way of refreshing the data[clicking [r] to refresh]. Now what we do is use tea.Tick and the time library to refresh the data every 1 second.

Issues that can be caused

  • We are currently refreshing data every second that can put a lot more load on the system when used inside a big repository, So in infuture I’m gonna work to give the user a way to choose the tick Rate

What im gonna work on now

  • Scrollbar for gitlog and also visualizer
  • A tick rate selector
  • File status panel that can be toggled with the visualizer
  • A way to search for different repo’s in the user’s computer and jumping between them(something like the nvim feature of finding files) –im not really sure of this :confuse:
2
0
157
Open comments for this post

43m 36s logged

DAGIT DEVLOG 3

Yay!
we have got the release workflow up and running

What we are doing

  • what we do is make new binaries name dagit-linux-amd64.tar.gz and dagit-darwin-arm64.tar.gz
    and push them to our releases page with the tag given while pushing to the repo

  • We also push to the AUR!! :yay: . So all the I use arch btw people can download it easily :larp:

Installation

  • AUR

yay -S dagit-bin
  • Run in a github repo ,ie paste->dagit
  • Github releases

  • go to the releases page and download the binaries zip, extract it and run in a github repo
0
0
75
Open comments for this post

3h 34m 2s logged

DAGIT DEVLOG 2

We’ve improved the TUI soo much!! :yay:

What I’ve done

  • Got gitlog working with hash, commit message and the contibuter
  • Made a somewhat good looking git visualizer and fixed the horizontal and vertical border issue caused by big lines (reference mainly)
  • Styled the git visualizer with charm’s lipgloss
  • Fixed border issues in the footer and git log too
  • Also made dagit resize when the user makes the terminal window larger but idk why it doesnt work when the terminal window is shortened
  • I also added a resize keybindr to reload the data in the TUI so that the user does not need to stop it and run again for it to update to latest info

Issues faced

I haven’t faced any big issue in particular but figuring out resizing is the only thing that eats my brain

Where I spent the most time

I have spent the most time making the visualizer, lemme explain a little of it’s woking !!

  • First we fetch the git log graph from git and then we spread the graph by using SpreadGraph function in graph.go to make it look a little better
  • Then we get 15 of the graph lines into out TUI and then render it using lipgloss [Man charm’s tool are soo cool and make CLI/TUI look soo good]. Although we don’t see all the 15 lines as we dont have a scroll feature for now

What we are going to do

  • Style it
  • Fetch number of commits done to the repo and display it
  • Add scrollbar to git visualizer
    _ Also add scrollbar to git log -Not sure

What I currently feel

When I was planning to make dagit, I felt it’ll be different and will attract people towards it but it’s not upto my expectation.
I thinking to adding some feature that will make more people use it

0
0
84
Open comments for this post

3h 0m 31s logged

DAGIT DEVLOG 1

(BTW WHOEVER ADDED EMOJIS OPTION SHOULD BE PROMOTED :smirk-hole: )
Hii,
I’m making a TUI application that beautifully visualizes your GitHub repo inside your terminal!!

Note -> This devlog is a compilation of 2 days of work that I’ll explain

What I have done

DAY 1:

I started working on dagit with first:

  • Checking if the current directory is a git repo or not
  • If yes, we first fetch the repo name along with
  • owner of the repo
  • the remote url of current repo
  • current branch
    Lmao, this was all I did on day 1

DAY 2

Today the fun began :evil:

  • I started working on the TUI section
  • I started with a simple bubble tea list TUI to remember the simple things that I had forgot in these many days
  • Then I used bubbletea to render the left panel containing the the data we fetched from day one but I realised that this is messed up cuz I wont be able to make different sections for the visualizer and the git log history
  • When I searched for a fix I saw lipgloss and then integrated it with our current setup
  • I used lip gloss to make diffferent sections for our TUI. The sections that I currently want in the TUI left panel/middle(visualizer)/ bottom(git log) along with the footer like nvim
  • But :crying: I forgot about the resizing problem and idk anything about how I’m going to fix it like other TUI’s do so I’m donna leave it like tat for now

What I’m gonna do

  • Make it look prettier
  • Get the git log because it’s gonna be easier than the visualizer
  • Make my shit code look a little better
0
0
102

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…