Skip to content

jshawl/abcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abcd

A Better Console Diff

CLI

abcd [--staged] [treeish]

opens a pager, watches for changes, and updates the diff

Library

package main

import (
    "encoding/json"
    "fmt"
    "os"

    abcd "github.com/jshawl/abcd"
)

func main() {
    cmd := exec.Command("git", "diff")
    stdout, err := cmd.Output()
    diff := abcd.ParseDiff(string(stdout))

    diffJson, _ := json.MarshalIndent(diff, "", "    ")
    fmt.Println(string(diffJson))
}