mfdeph / gitiles

Automatically exported from code.google.com/p/gitiles
0 stars 0 forks source link

Add JSON output and support for all refs/ to +refs #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The current refs listing provided by +refs appears to be limited to refs/heads/ 
and refs/tags/, and doesn't support JSON output. It would be useful to also be 
able to list other refs/. Maybe +refs could default to the current listing, but 
could be extended with an 'ls-remote'-style filter pattern as the path. If the 
JSON output could also include the commit hash of each ref, like ls-remote, 
that would be perfect.

For instance, https://chromium.googlesource.com/external/msysgit/git/+refs only 
shows the branches that we copy into refs/heads/ but there are actually a lot 
more branches that are mirrored from upstream into refs/remotes/upstream/, so 
to get all upstream branches:
https://chromium.googlesource.com/external/msysgit/git/+refs/remotes/upstream/*

or all 'master' branches (both refs/heads/ and refs/remotes/upstream/):
https://chromium.googlesource.com/external/msysgit/git/+refs/*/master

(FWIW, this is needed by some Chrome scripts which currently shell out to a 
local git to run ls-remote, which prevents us from running those scripts on 
appengine.)

Original issue reported on code.google.com by mmoss@chromium.org on 27 Feb 2014 at 5:08

GoogleCodeExporter commented 9 years ago
Already available with format=TEXT:
$ curl -s 
'https://chromium.googlesource.com/external/msysgit/git/+refs?format=TEXT' | 
grep -c refs/remotes
36

I guess we could do JSON if you really want.

Original comment by dborowitz@google.com on 27 Feb 2014 at 5:30

GoogleCodeExporter commented 9 years ago
Ah, thanks, I didn't try that format. That's sufficient for my purposes.

Original comment by mmoss@chromium.org on 27 Feb 2014 at 5:45

GoogleCodeExporter commented 9 years ago
Works great. Feel free to close.

Original comment by mmoss@chromium.org on 27 Feb 2014 at 6:47

GoogleCodeExporter commented 9 years ago
I'll leave this bug open as the description is still accurate, we have neither 
JSON output nor a way to list all refs from the HTML view :)

Original comment by dborowitz@google.com on 27 Feb 2014 at 6:54