summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5385f52)
raw | patch | inline | side by side (parent: 5385f52)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 14 Oct 2005 01:57:40 +0000 (18:57 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 15 Oct 2005 18:23:41 +0000 (11:23 -0700) |
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>
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>
git-fetch.sh | patch | blob | history | |
server-info.c | patch | blob | history | |
upload-pack.c | patch | blob | history |
diff --git a/git-fetch.sh b/git-fetch.sh
index 7c05880bcfca30426d03112c0967ada6f68305be..0cb1596f50c998ba1f4ac0e2049e1c18459fc5a8 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
then
taglist=$(git-ls-remote --tags "$remote" |
sed -e '
+ /\^{}$/d
s/^[^ ]* //
s/.*/&:&/')
if test "$#" -gt 1
diff --git a/server-info.c b/server-info.c
index 3c08a288db9fd36b637b8da854a63cfbdcaa03da..ba5359108deb4f010be366ef65974ec7db123098 100644 (file)
--- a/server-info.c
+++ b/server-info.c
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;
}
diff --git a/upload-pack.c b/upload-pack.c
index 83f5a35d2686401e9a70d7aafae07c88c7b6e936..21b4b8b7575dd3ceb2fdf40b5aa4b7483168ec1e 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
#include "cache.h"
#include "refs.h"
#include "pkt-line.h"
+#include "tag.h"
+#include "object.h"
static const char upload_pack_usage[] = "git-upload-pack <dir>";
static int send_ref(const char *refname, const unsigned char *sha1)
{
+ struct object *o = parse_object(sha1);
+
packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
+ if (o->type == tag_type) {
+ o = deref_tag(o);
+ packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
+ }
return 0;
}