On Thu, 31 Mar 2016 00:10:50 -0700 (PDT)
Sebastian Tarach <star...@gmail.com> wrote:
> In the company I work for I was requested to write script/app that
> would retrieve all diffs in the past month for each author and put
> them in separate files. I was quite surprised when I found out I
> can't do that remotely but I have clone the repository first. Well
> it's not a big deal for our ~12 repos but it is a bit time consuming.
> Obviously in such case ls-remote was no help. We have such script for
> SVN and obviously do to it's centralized nature such this is
> possible. Therefore I'm wondering did I miss something? Maybe it
> actually is possible but I didn't do my research right?
No, it's not possible with plain Git. The reason is that different
repositories "talk to each other" only to exchange their histories, and
the protocol to do this is only concerned with effectively (in time and
space) figuring out what bits of that history is missing in the
receiving repository compared to that in the sending one, extracting
it, packing and transferring. Remote queries involving history
traversals are not supported by the Git wire protocol.
You're correct in that the centralized nature of Subversion
repositories helps: since the client's snapshot of the repository
contains only a single server's revision (or even a part of it),
all queries about the repository have to be answered by the server and
hence must be supported by its wire protocol.
With Git, each repository is local, and there is no server (what you
call "the server" when talking about Git repositories is merely a
convention / policy having nothing to do with Git).
Basically I see two approaches to alleviate your problem:
1) Make locally available clones of the repos you have to measure
and make sure they are synchronized with their "reference" sources
Then running your script against them will require only a small
amount of history transferred -- to make the repos up-to-date.
2) Execute your script on the server.
This might sound counter-intuitively but the so-called "bare" repos
typically used to keep "shared" repos (those located on "the server")
perfectly support all history traversal commands such as `git log`
(and `git rev-list` which powers it), `git diff` etc.
So I'd either write a simple CGI application or would make that
script executable via an SSH session. The actual details depend on
your exact configuration.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.