summaryrefslogtreecommitdiff
path: root/server-info.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-14 01:57:40 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-15 18:23:41 (GMT)
commitf6b42a81fd97a55dec0766685aac722a838a11a6 (patch)
treee28da137e465b5caa12ba6b05aae9fe4dc4b46c8 /server-info.c
parent5385f52da80be0d01fda45be586eb186c2be83ee (diff)
downloadgit-f6b42a81fd97a55dec0766685aac722a838a11a6.zip
git-f6b42a81fd97a55dec0766685aac722a838a11a6.tar.gz
git-f6b42a81fd97a55dec0766685aac722a838a11a6.tar.bz2
Show peeled onion from upload-pack and server-info.
This updates git-ls-remote to show SHA1 names of objects that are referred by tags, in the "ref^{}" notation. This would make git-findtags (without -t flag) almost trivial. git-peek-remote . | sed -ne "s:^$target "'refs/tags/\(.*\)^{}$:\1:p' Also Pasky could do: git-ls-remote --tags $remote | sed -ne 's:\( refs/tags/.*\)^{}$:\1:p' to find out what object each of the remote tags refers to, and if he has one locally, run "git-fetch $remote tag $tagname" to automatically catch up with the upstream tags. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'server-info.c')
-rw-r--r--server-info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/server-info.c b/server-info.c
index 3c08a28..ba53591 100644
--- a/server-info.c
+++ b/server-info.c
@@ -9,7 +9,14 @@ static FILE *info_ref_fp;
static int add_info_ref(const char *path, const unsigned char *sha1)
{
+ struct object *o = parse_object(sha1);
+
fprintf(info_ref_fp, "%s %s\n", sha1_to_hex(sha1), path);
+ if (o->type == tag_type) {
+ o = deref_tag(o);
+ fprintf(info_ref_fp, "%s %s^{}\n",
+ sha1_to_hex(o->sha1), path);
+ }
return 0;
}