I'd like to know how to check if something is committed to a repository through git. The idea is to take the committed files into a code review tool.
+7
A:
You want a hook that pushes the new code into the code review tool: http://www.kernel.org/pub/software/scm/git/docs/githooks.html
Aaron Maenpaa
2009-05-06 02:30:38
A:
Perhaps the simplest would be to run git-count-objects and see when the number of objects increases. Poll every 5 minutes or as you see fit.
$ git count-objects -v
count: 13
size: 568
in-pack: 48
packs: 1
prune-packable: 0
garbage: 0
"count" is unpacked, "in-pack" is packed, so "count"+"in-pack" should increase with a commit by at least one.
Or use a hook.
Colin Burnett
2009-05-06 02:30:59
git count-objects only counts unpacked objects, so isn't reliable for something like this: if push sends enough objects, the server will just keep the pack.
araqnid
2009-05-06 12:52:29
And the -v flag will take care of that issue.
Colin Burnett
2009-05-06 15:20:15
You could also poll `git rev-parse HEAD` and see if it changes
dbr
2009-05-06 15:32:56