Johan Sorensen [off-list ref] writes:
On Thu, Aug 27, 2009 at 2:47 AM, Junio C Hamano [off-list ref] wrote:
quoted
After upload-pack successfully finishes its operation, post-upload-pack
hook can be called for logging purposes.
The hook is passed various pieces of information, one per line, from its
standard input. Currently the following items can be fed to the hook, but
more types of information may be added in the future:
want SHA-1::
40-byte hexadecimal object name the client asked to include in the
resulting pack. Can occur one or more times in the input.
have SHA-1::
40-byte hexadecimal object name the client asked to exclude from
the resulting pack, claiming to have them already. Can occur zero
or more times in the input.
time float::
Number of seconds spent for creating the packfile.
size decimal::
Size of the resulting packfile in bytes.
Neat. And feeding it lines gives more room for future additions.
I'd like to suggest the following line from the original patch:
full-pack integer::
1 if the request was considered a full clone, 0 if it was a
partial update (fetch)
If it is all "want" and no "have", it is clone or fetch into empty
repository. If additionaly "want"s cover all refs, it is a clone.
No need to pass this information: it can be derived.
Also, on a similar note; in the little git-daemon (a tiny fork+exec
server in ruby) included with Gitorious there's a geo-ip lookup based
on the client addr. It would be fun if the client ip could be passed
along to this hook as well, but that would require passing it along
all the way from before fetch-pack is invoked as far as I can see..?
Well, we can pass at least `client-ip`...
[please don't quote what is not needed]
--
Jakub Narebski
Poland
ShadeHawk on #git