Coder Social home page Coder Social logo

ogl's Introduction

Build Status

Ogl

The prettiest git log graph in town!

Demo

Why

We all love the terminal. git log --graph is cool, but it can get really hard to read.

Installation

The easiest way is to get the single binary (available in releases page).

Install with a single command:

On Linux

$ sudo curl -sL https://github.com/onilton/ogl/releases/download/v0.0.2/ogl-linux.tar | tar x -C /usr/local/bin/

Or with wget:

$ sudo wget -qO- https://github.com/onilton/ogl/releases/download/v0.0.2/ogl-linux.tar | tar x -C /usr/local/bin/

On MacOS

$ curl -sL https://github.com/onilton/ogl/releases/download/v0.0.2/ogl-macos.tar | tar x -C /usr/local/bin/

Or with wget:

$ wget -qO- https://github.com/onilton/ogl/releases/download/v0.0.2/ogl-macos.tar | tar x -C /usr/local/bin/

Config file

You can change some settings like colors in ~/.ogl. An example config:

####################                                                                                                                                                     
#Example Config
#################### 

# Seed is used to get a random color. We usually use the color from
# git log --graph itself but sometimes a color isn't provided so
# we need to choose a random color
#seed=3

# The graph/line style: "squared" "dual" "heavy" "default" (or "rounded")
style=rounded

# This fixes some column sizes. 
#unlimited-fields=false 
#subject.width=60
#author.width=15
#date.width=15

# Field colors
#subject.color=15
#author.color=66
#date.color=237

# Hide consecutive date and author
#hide-consecutive=true

# Align commit messages
#align-messages=false

# Number of columns to give up aligning commits
# When graph is too wide it can get hard to read commits
# even in pieces where it is not that wide yet
#max-align-messages=70

# Enable unicode icons for branch/ref names
#unicode-icons=true

# Personalize branch/ref icons
#icon.origin="🐱  "
#icon.tag="⚑ "
#icon.local="⌨  "
#icon.head="✓"

# Customize commit bullet 
#icon.commit.bullet="◦"
#icon.commit.childless="◦"

TO-DO

  • This was made as proof of concept, so the code needs a lot of love to become prettier
  • More customizations
  • Use other libs when they become available to scala-native
  • Tests!!
  • Packaging?
  • It is fast. But if possible, make it (even) faster
  • Not tested in Mac OS X yet. #4 Thanks @justinpitts !

Questions

  • Why scala? - Because I like it! :) To be honest I started with a prototype in python, but after facing some performance issues, and trying a little bit with cython, I decided to try scala-native.
  • Wow, that scala code is ugly! - Unfortunately, idiomatic scala code is not that fast, and I tried to do that best possible to keep the time down. If you know how to improve the code without affecting performance, send a PR! :)

ogl's People

Contributors

onilton avatar aint avatar karelcemus avatar

Stargazers

Luke Simmons avatar Simeon Rumyannikov avatar Ignacio Baca Moreno-Torres avatar  avatar Luis Alberto avatar sam bacha avatar ebigram avatar Lais Arena avatar Zensharp avatar Jason avatar Abhay Gupta avatar Morgan Craft avatar Sarsa Murmu avatar Jahir Fiquitiva avatar Corbin Crutchley avatar Emily Marigold Klassen avatar tg-z avatar Adam Wagner avatar Ernest Wong avatar Kevin Hu avatar Hank Lin avatar  avatar  avatar Abdul Qabiz avatar Will O'Brien avatar Adriano Gil avatar hulucc avatar Somya Dashora avatar Gary Oberbrunner avatar Vitaly Lavrov avatar Angelo Lakra avatar Hugo van Rijswijk avatar iAnt avatar Szymon Borecki avatar  avatar Luiz avatar  avatar Gabriel Francisco avatar Alexey Alekhin avatar Frederico Honório avatar Jorge avatar Felix Schüler avatar Simer avatar Jagdeep Singh avatar Cris Maciel avatar Filippo Mariotti avatar Angel Ortega (he/they) avatar Anastasios Skarlatidis avatar Sam avatar 李国辉 avatar Michael Wright avatar Michael Steinkogler avatar Guillaume Gelin avatar  avatar Sanket Patil avatar  avatar Igor Antonov avatar Bill Goldsworthy avatar Makoto Miyagawa avatar Sergey Melnychuk avatar Alex Barros avatar Thiago Melo avatar Fernanda Guimarães avatar Andriy Plokhotnyuk avatar Yan avatar Maxim Schuwalow avatar Denis Oliveira avatar Todd Edwards avatar He-Pin(kerr) avatar  avatar Sean Flanigan avatar David Gidwani avatar Pierre Kisters avatar Maria Rabyk avatar Ilya avatar Ruslans Tarasovs avatar Luis avatar  avatar Josh avatar Abdelhakim mouslih avatar Øyvind Raddum Berg avatar Marcelo da Silva Gomes avatar

Watchers

Filippo Mariotti avatar James Cloos avatar Andriy Plokhotnyuk avatar  avatar

ogl's Issues

Use different colors in light mode vs. dark

In a white-background terminal, it can be very hard to see some of the randomly-generated branch colors:
image
It would be great if ogl could only pick "darkish" colors (luma < 0.8, for example) in light mode. Similarly, only pick lightish colors (luma > 0.3) in dark mode. Or maybe just always constrain the luma to 0.3..0.8 if that's easier.

Add "two line" mode to show commit msg on 2nd line

Thanks for ogl, I'm using it all the time now and I love it!
The only thing I'm missing is sometimes it truncates branch info that I need.

I use something like this for my git ll config:

alias.ll=log -10 --graph --date-order --format=twolines
pretty.twolines=tformat:%h %an, %cr: %d%n. . . . %w(70,0,8)%s

% git ll
* d3694b9 Gary, 4 minutes ago:  (HEAD -> master, origin/feature/assembly-param, feature/assembly-param)
| . . . . Only warn on errors loading unknown params from db
* f03d361 Gary, 5 minutes ago:
| . . . . Use mutations to set assembly param choices & value
* 8da8df4 Gary, 5 minutes ago:
| . . . . Add default assembly as proper Param, with store
* 5aee3b8 Gary , 5 minutes ago:
| . . . . Add ability to set default assembly, & show model name & title
*   1cebe2e Gary, 9 minutes ago:  (origin/master)
|\  . . . . Merge branch 'feature/fullscreen-mode' into 'master'
| * 4424c44 Mmmm, 20 hours ago:  (origin/feature/fullscreen-mode)
|/  . . . . Add a button for entering/exiting fullscreen mode
*   8dc2f90 Gary, 22 hours ago:
|\  . . . . Merge branch 'upgrade/front-end-packages' into 'master'
| * a437c10 Mmmm, 23 hours ago:  (origin/upgrade/front-end-packages, upgrade/front-end-packages)   | | . . . . Fix problem with Chrome crashes while running e2e tests

the nice thing about this is you can see all the branches that each commit is part of, even if the branch names are long. Any chance you could add a "two-line" mode like this, but with the amazing prettiness that OGL has?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.