func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } showIndex(f) return }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } err = go4git.Zlib(f, os.Stdout) if err != nil { panic(err) } }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } _, t, err := go4git.ReadObjectType(f) if err != nil { panic(err) } fmt.Fprintf(os.Stdout, "Type:%s\n", t) }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } tree, err := go4git.ParseTree(f) if err != nil { panic(err) } fmt.Fprintf(os.Stdout, "%s\n", tree) }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } b, err := go4git.GenSHA1(f, *objType) if err != nil { panic(err) } fmt.Fprintf(os.Stdout, "%s", b) }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() cmt, err := go4git.ParseCommit(f) if err != nil { fmt.Fprintln(os.Stderr, "ERROR:", err) return } fmt.Fprintln(os.Stdout, cmt) }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } if *size { showSize(f) return } if len(*hash) > 0 { showHashObject(f) return } showAllIndex(f) }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { panic(err) } packFile := f.Name() fileName = packFile idxName := packFile[:len(packFile)-4] + "idx" inIdx, err := os.Open(idxName) if err != nil { panic(err) } if *offset != -1 { p, err := go4git.ReadPackedObjectAtOffset(*offset, f, inIdx) if err != nil { panic(err) } if *header { fmt.Printf("Details of Object at offset [%d] \n", *offset) fmt.Printf(" Type: %s\n", p.Type) fmt.Printf(" HashOfRef: %s\n", go4git.Byte2String(p.HashOfRef)) fmt.Printf(" RefOffset: %d\n", p.RefOffset) fmt.Printf(" Size: %d\n", p.Size) fmt.Printf(" StartOffset: %d\n", p.StartOffset) fmt.Printf(" ActualType: %s\n", p.ActualType) fmt.Printf(" Hash: %s\n", go4git.Byte2String(p.Hash)) fmt.Printf(" RefLevel: %d\n", p.RefLevel) fmt.Printf(" BaseHash: %s\n", go4git.Byte2String(p.BaseHash)) if *data { fmt.Printf(" ---Data(starts below):---\n") } } if *data { fmt.Printf("%s", p.Data) } return } if *verifyPack { showVerifyPack(f, inIdx) fmt.Printf("%s: ok\n", packFile) return } }
func main() { flag.Parse() f, err := go4git.GetArgInputFile() if err != nil { fmt.Fprintln(os.Stderr, "ERROR:", err) return } tag, err := go4git.ParseTag(f) if err != nil { fmt.Fprintln(os.Stderr, "ERROR:", err) } fmt.Fprintln(os.Stdout, tag) }