1

I want to download (via curl or AJAX) the HEAD revision of a file in a Git repository. GitWeb is already installed.

I can get the formatted source code: http://server1.local/?p=Project&a=blob&f=Path/To/File.html

However, this does not seem to work when I use blob_plain as the value for "a"; blob_plain requires a hash in a "h" parameter - but I want to refer to the newest version of the file, not a specific one.

Is there something that needs to be configured? Am I using the right URL schema?

GreenIcicle
  • 458
  • 2
  • 9

1 Answers1

1

Which gitweb version?

Because it works for me. When I can access

http://localhost/cgi-bin/gitweb.cgi/git.git?a=blob;f=builtin/annotate.c

i can also access

http://localhost/cgi-bin/gitweb.cgi/git.git?a=blob_plain;f=builtin/annotate.c



You can always try to give HEAD as argument to 'hb', i.e.

http://server1.local/?p=Project&a=blob&f=Path/To/File.html&hb=HEAD
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230
  • That what was I thought - but the server gives me an HTTP 500 when I combined blob_plain with h=HEAD... I've got an appointment with the admin tomorrow, let's see what he says. – GreenIcicle May 31 '11 at 14:20
  • @GreenIcicle: I am very sorry, it should be **'hb'** (hash *base*), not 'h' (fixed now)... assuming that given file is present in HEAD (but if 'blob' action works, then it should be present). BTW it is important _which_ of HTTP 500 responses was that (error message shown on page). – Jakub Narębski May 31 '11 at 20:25