• Kirill Smelkov's avatar
    xcommit_tree: Teach it to create commit without spawning `git commit-tree ...` · 3a7b390c
    Kirill Smelkov authored
    Because spawning separate process per 1 commit is slow.
    
    Libgit2 does not allow to create commits only knowing tree & parentv
    sha1s, but we can create commit objects by hand pretty easily - their format is
    
        tree <sha1>
        parent <parent1-sha1>
        parent <parent2-sha1>
        ...
        author user <email> date +offset
        committer user <email> date +offset
        LF
        message
    
    Time for pulling-in kirr/slapos.git
    
    before: 2.5s
    after:  0.9s
    
    NOTE AuthorInfo is changed to inherit from git.Signature (same fields
        and semantic)
    
    NOTE Since libgit2 default ident can fail, and does not look beyond
        user.name and user.email we do backup identity detection
        (user/hostname) - in similar way Git does - ourselves.
    3a7b390c
git-backup.go 31.7 KB