{"thread":{"id":"8516","subject":"[PATCH] Port git-tag.sh to C.","startedAt":"2007-06-08T22:45:59Z","lastAt":"2007-06-13T00:27:04Z","messageCount":15,"participants":["Kristian Høgsberg","Carlos Rica","Junio C Hamano","Robin Rosenberg","Jeff King","Daniel Barkalow","Johannes Schindelin","Julian Phillips"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"44394","messageId":"11813427591137-git-send-email-krh@redhat.com","threadId":"8516","inReplyTo":null,"subject":"[PATCH] Port git-tag.sh to C.","fromName":"Kristian Høgsberg","fromEmail":"krh@redhat.com","sentAt":"2007-06-08T22:45:59Z","receivedAt":"2007-06-08T22:45:59Z","isPatch":true,"sender":{"key":"krh@redhat.com","avatar":"https://gravatar.com/avatar/763dee6f9594ac474f725b137a39565792928e583ddf59b32befc2907409027e?d=mp&s=160"},"body":"From: Kristian HÃ¸gsberg <krh@redhat.com>\n\nA more or less straight-forward port of git-tag.sh to C.\n\nSigned-off-by: Kristian HÃ¸gsberg <krh@redhat.com>\nCc: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\nOk, here's an updated version that passes the test suite.  Johannes, I\nleave it to you and jasam to merge the bits you find useful, but as\nfar as I see it, this conversion is complete, and there's enough other\nshell scripts to port.  My port doesn't pass jasam's test suite, it\nlooks like he is expecting the -l glob to be a regexp, but the\ngit-tag.sh I started from used shell globs.\n\nAnyways, it'd be nice if you or jasam could keep the list a little\nmore in the loop with the SoC changes, it is where most of the\ndevelopment happens, after all.  What's next on your list?\n\ncheers,\nKristian\n\n Makefile      |    3 +-\n builtin-tag.c |  371 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n builtin.h     |    1 +\n git-tag.sh    |  183 ----------------------------\n git.c         |    1 +\n 5 files changed, 375 insertions(+), 184 deletions(-)\n create mode 100644 builtin-tag.c\n delete mode 100755 git-tag.sh\n\ndiff --git a/Makefile b/Makefile\nindex 0f75955..bb1bed1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -205,7 +205,7 @@ SCRIPT_SH = \\\n \tgit-pull.sh git-rebase.sh \\\n \tgit-repack.sh git-request-pull.sh git-reset.sh \\\n \tgit-sh-setup.sh \\\n-\tgit-tag.sh git-verify-tag.sh \\\n+\tgit-verify-tag.sh \\\n \tgit-am.sh \\\n \tgit-merge.sh git-merge-stupid.sh git-merge-octopus.sh \\\n \tgit-merge-resolve.sh git-merge-ours.sh \\\n@@ -372,6 +372,7 @@ BUILTIN_OBJS = \\\n \tbuiltin-show-branch.o \\\n \tbuiltin-stripspace.o \\\n \tbuiltin-symbolic-ref.o \\\n+\tbuiltin-tag.o \\\n \tbuiltin-tar-tree.o \\\n \tbuiltin-unpack-objects.o \\\n \tbuiltin-update-index.o \\\ndiff --git a/builtin-tag.c b/builtin-tag.c\nnew file mode 100644\nindex 0000000..26035f5\n--- /dev/null\n+++ b/builtin-tag.c\n@@ -0,0 +1,371 @@\n+/*\n+ * Builtin \"git tag\"\n+ *\n+ * Copyright (c) 2007 Kristian HÃ¸gsberg <krh@redhat.com>\n+ * Based on git-tag.sh and mktag.c by Linus Torvalds.\n+ */\n+\n+#include \"cache.h\"\n+#include \"refs.h\"\n+#include \"commit.h\"\n+#include \"builtin.h\"\n+#include \"tag.h\"\n+#include \"run-command.h\"\n+\n+static const char builtin_tag_usage[] =\n+  \"git-tag [-n [<num>]] -l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg>] <tagname> [<head>]\";\n+\n+static char signingkey[1000];\n+\n+static int launch_editor(const char *path, const char *template,\n+\t\t\t  char *buffer, size_t size)\n+{\n+\tstruct child_process child;\n+\tconst char *editor;\n+\tconst char *args[3];\n+\tchar *eol;\n+\tint len, fd, blank_lines, i, j;\n+\n+\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);\n+\tif (fd < 0)\n+\t\tdie(\"could not create file %s.\", path);\n+\n+\tlen = strlen(template);\n+\twrite_or_die(fd, template, len);\n+\tclose(fd);\n+\n+\teditor = getenv(\"VISUAL\");\n+\tif (!editor)\n+\t\teditor = getenv(\"EDITOR\");\n+\tif (!editor)\n+\t\teditor = \"vi\";\n+\t    \n+\tmemset(&child, 0, sizeof(child));\n+\tchild.argv = args;\n+\targs[0] = editor;\n+\targs[1] = path;\n+\targs[2] = NULL;\n+\n+\tif (run_command(&child))\n+\t\tdie(\"could not launch editor %s.\", editor);\n+\n+\tfd = open(path, O_RDONLY, 0644);\n+\tif (fd == -1)\n+\t\tdie(\"could not read %s.\", path);\n+\tlen = read_in_full(fd, buffer, size);\n+\tif (len < 0)\n+\t\tdie(\"failed to read '%s', %m\", path);\n+\tclose(fd);\n+\n+\tblank_lines = 1;\n+\tfor (i = 0, j = 0; i < len; i++) {\n+\t\tif (blank_lines > 0 && buffer[i] == '#') {\n+\t\t\teol = strchr(buffer + i, '\\n');\n+\t\t\tif (!eol)\n+\t\t\t\tbreak;\n+\n+\t\t\ti = eol - buffer;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (buffer[i] == '\\n') {\n+\t\t\tblank_lines++;\n+\t\t\tif (blank_lines > 1)\n+\t\t\t\tcontinue;\n+\t\t} else {\n+\t\t\tif (blank_lines > 2)\n+\t\t\t\tbuffer[j++] = '\\n';\n+\t\t\tblank_lines = 0;\n+\t\t}\n+\n+\t\tbuffer[j++] = buffer[i];\n+\t}\n+\n+\tif (buffer[j - 1] != '\\n')\n+\t\tbuffer[j++] = '\\n';\n+\n+\tunlink(path);\n+\n+\treturn j;\n+}\n+\n+static int show_reference(const char *refname, const unsigned char *sha1,\n+\t\t\t  int flag, void *cb_data)\n+{\n+\tconst char *pattern = cb_data;\n+\n+\tif (pattern == NULL || !fnmatch(pattern, refname, 0))\n+\t\tprintf(\"%s\\n\", refname);\n+\n+\treturn 0;\n+}\n+\n+static int list_tags(const char *pattern)\n+{\n+\tfor_each_tag_ref(show_reference, (void *) pattern);\n+\n+\treturn 0;\n+}\n+\n+\n+static int delete_tags(const char **argv)\n+{\n+\tconst char **p;\n+\tchar ref[PATH_MAX];\n+\tint had_error = 0;\n+\tunsigned char sha1[20];\n+\n+\tfor (p = argv; *p; p++) {\n+\t\tif (snprintf(ref, sizeof ref, \"refs/tags/%s\", *p) > sizeof ref)\n+\t\t\tdie(\"tag name '%s' too long.\", *p);\n+\t\tif (!resolve_ref(ref, sha1, 1, NULL)) {\n+\t\t\tfprintf(stderr, \"tag '%s' not found.\\n\", *p);\n+\t\t\thad_error = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (!delete_ref(ref, sha1))\n+\t\t\tprintf(\"Deleted tag '%s'\\n\", *p);\n+\t}\n+\t\t\t\n+\treturn had_error;\n+}\n+\n+static int verify_tags(const char **argv)\n+{\n+\tconst char **p;\n+\tchar ref[PATH_MAX];\n+\tint had_error = 0;\n+\tunsigned char sha1[20];\n+\n+\tfor (p = argv; *p; p++) {\n+\t\tif (snprintf(ref, sizeof ref, \"refs/tags/%s\", *p) > sizeof ref)\n+\t\t\tdie(\"tag name '%s' too long.\", *p);\n+\n+\t\tif (!resolve_ref(ref, sha1, 1, NULL)) {\n+\t\t\tfprintf(stderr, \"tag '%s' not found.\\n\", *p);\n+\t\t\thad_error = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tprintf(\"FIXME: verify tag '%s'\\n\", *p);\n+\t}\n+\n+\treturn had_error;\n+}\n+\n+static int do_sign(char *buffer, size_t size, size_t max)\n+{\n+\tstruct child_process gpg;\n+\tconst char *args[5];\n+\tchar *bracket;\n+\tint len;\n+\n+\tif (signingkey[0] == '\\0') {\n+\t\tstrlcpy(signingkey, git_committer_info(1), sizeof signingkey);\n+\t\tbracket = strchr(signingkey, '>');\n+\t\tif (bracket)\n+\t\t\tbracket[1] = '\\0';\n+\t}\n+\n+\tmemset(&gpg, 0, sizeof(gpg));\n+\tgpg.argv = args;\n+\tgpg.in = -1;\n+\tgpg.out = -1;\n+\targs[0] = \"gpg\";\n+\targs[1] = \"-bsa\";\n+\targs[2] = \"-u\";\n+\targs[3] = signingkey;\n+\targs[4] = NULL;\n+\t\t\n+\tif (start_command(&gpg))\n+\t\tdie(\"could not run gpg.\");\n+\n+\twrite_or_die(gpg.in, buffer, size);\n+\tclose(gpg.in);\n+\tgpg.close_in = 0;\n+\tlen = read_in_full(gpg.out, buffer + size, max - size);\n+\n+\tfinish_command(&gpg);\n+\n+\treturn size + len;\n+}\n+\n+static const char tag_template[] =\n+\t\"\\n\"\n+\t\"#\\n\"\n+\t\"# Write a tag message\\n\"\n+\t\"#\\n\";\n+\n+static int git_tag_config(const char *var, const char *value)\n+{\n+\tif (!strcmp(var, \"user.signingkey\")) {\n+\t\tif (!value)\n+\t\t\tdie(\"user.signingkey without value\");\n+\t\tstrlcpy(signingkey, value, sizeof signingkey);\n+\t\treturn 0;\n+\t}\n+\n+\treturn git_default_config(var, value);\n+}\n+\n+static void create_tag(const unsigned char *object, const char *tag,\n+\t\t       const char *message, int sign, unsigned char *result)\n+{\n+\tenum object_type type;\n+\tchar buffer[4096];\n+\tint header, body, total;\n+\n+\ttype = sha1_object_info(object, NULL);\n+\tif (type <= 0)\n+\t    die(\"bad object type.\");\n+\n+\theader = snprintf(buffer, sizeof buffer,\n+\t\t\t  \"object %s\\n\"\n+\t\t\t  \"type %s\\n\"\n+\t\t\t  \"tag %s\\n\"\n+\t\t\t  \"tagger %s\\n\\n\",\n+\t\t\t  sha1_to_hex(object),\n+\t\t\t  typename(type),\n+\t\t\t  tag,\n+\t\t\t  git_committer_info(1));\n+\n+\tif (message == NULL)\n+\t\tbody = launch_editor(git_path(\"TAGMSG\"), tag_template,\n+\t\t\t\t     buffer + header, sizeof buffer - header);\n+\telse\n+\t\tbody = snprintf(buffer + header, sizeof buffer - header,\n+\t\t\t\t\"%s\\n\", message);\n+\n+\tif (body == 0)\n+\t\tdie(\"no tag message?\");\n+\n+\tif (header + body > sizeof buffer)\n+\t\tdie(\"tag message too big.\");\n+\n+\tif (sign)\n+\t\ttotal = do_sign(buffer, header + body, sizeof buffer);\n+\telse\n+\t\ttotal = header + body;\n+\n+\tif (write_sha1_file(buffer, total, tag_type, result) < 0)\n+\t\tdie(\"unable to write tag file\");\n+}\n+\n+int cmd_tag(int argc, const char **argv, const char *prefix)\n+{\n+\tunsigned char object[20], prev[20], result[20];\n+\tint annotate = 0, sign = 0, force = 0, lines = 0;\n+\tconst char *message = NULL;\n+\tchar ref[PATH_MAX];\n+\tconst char *object_ref, *tag;\n+\tint i, fd;\n+\tstruct ref_lock *lock;\n+\n+\tgit_config(git_tag_config);\n+\n+\tfor (i = 1; i < argc; i++) {\n+\t\tconst char *arg = argv[i];\n+\n+\t\tif (arg[0] != '-')\n+\t\t\tbreak;\n+\t\tif (!strcmp(arg, \"-a\")) {\n+\t\t\tannotate = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-s\")) {\n+\t\t\tannotate = 1;\n+\t\t\tsign = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-f\")) {\n+\t\t\tforce = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-n\")) {\n+\t\t\tif (i + 1 == argc || *argv[i + 1] == '-')\n+\t\t\t\t/* no argument */\n+\t\t\t\tlines = 1;\n+\t\t\telse\n+\t\t\t\t/* FIXME, fallback to 1 on invalid integer */\n+\t\t\t\tlines = atoi(argv[i + 1]);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-m\")) {\n+\t\t\tannotate = 1;\n+\t\t\ti++;\n+\t\t\tif  (i == argc)\n+\t\t\t\tdie(\"option -m needs an argument.\");\n+\t\t\tmessage = argv[i];\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-F\")) {\n+\t\t\tannotate = 1;\n+\t\t\ti++;\n+\t\t\tif  (i == argc)\n+\t\t\t\tdie(\"option -F needs an argument.\");\n+\n+\t\t\tfd = open(argv[i], O_RDONLY);\n+\t\t\tif (fd < 0)\n+\t\t\t\tdie(\"cannot open %s\", argv[1]);\n+\n+\t\t\tmessage = xmalloc(4096);\n+\t\t\tif (read_in_full(fd, (char *) message, 4096) < 0)\n+\t\t\t\tdie(\"cannot read %s\", argv[1]);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-u\")) {\n+\t\t\tannotate = 1;\n+\t\t\tsign = 1;\n+\t\t\ti++;\n+\t\t\tif  (i == argc)\n+\t\t\t\tdie(\"option -u needs an argument.\");\n+\t\t\tstrlcpy(signingkey, argv[i], sizeof signingkey);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"-l\")) {\n+\t\t\treturn list_tags(argv[i + 1]);\n+\t\t}\n+\t\tif (!strcmp(arg, \"-d\")) {\n+\t\t\treturn delete_tags(argv + i + 1);\n+\t\t}\n+\t\tif (!strcmp(arg, \"-v\")) {\n+\t\t\treturn verify_tags(argv + i + 1);\n+\t\t}\n+\t\tusage(builtin_tag_usage);\n+\t}\n+\n+\tif (i == argc)\n+\t\treturn list_tags(NULL);\n+\ttag = argv[i++];\n+\n+\tif (i < argc)\n+\t\tobject_ref = argv[i];\n+\telse\n+\t\tobject_ref = \"HEAD\";\n+\n+\tif (get_sha1(object_ref, object))\n+\t\tdie(\"Failed to resolve '%s' as a valid ref.\", object_ref);\n+\n+\tif (snprintf(ref, sizeof ref, \"refs/tags/%s\", tag) > sizeof ref)\n+\t\tdie(\"tag '%s' too long.\", tag);\n+\tif (check_ref_format(ref))\n+\t\tdie(\"'%s' is not a valid tag name.\", tag);\n+\tif (resolve_ref(ref, prev, 1, NULL)) {\n+\t\tif (!force)\n+\t\t\tdie(\"tag '%s' already exists\", tag);\n+\t} else {\n+\t\thashclr(prev);\n+\t}\n+\n+\tif (annotate)\n+\t\tcreate_tag(object, tag, message, sign, object);\n+\n+\tlock = lock_any_ref_for_update(ref, prev, 0);\n+\tif (!lock)\n+\t\tdie(\"%s: cannot lock the ref\", ref);\n+\tif (write_ref_sha1(lock, object, NULL) < 0)\n+\t\tdie(\"%s: cannot update the ref\", ref);\n+\n+\treturn 0;\n+}\ndiff --git a/builtin.h b/builtin.h\nindex 39290d1..91166e1 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -72,6 +72,7 @@ extern int cmd_show(int argc, const char **argv, const char *prefix);\n extern int cmd_show_branch(int argc, const char **argv, const char *prefix);\n extern int cmd_stripspace(int argc, const char **argv, const char *prefix);\n extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);\n+extern int cmd_tag(int argc, const char **argv, const char *prefix);\n extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);\n extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);\n extern int cmd_update_index(int argc, const char **argv, const char *prefix);\ndiff --git a/git-tag.sh b/git-tag.sh\ndeleted file mode 100755\nindex 37cee97..0000000\n--- a/git-tag.sh\n+++ /dev/null\n@@ -1,183 +0,0 @@\n-#!/bin/sh\n-# Copyright (c) 2005 Linus Torvalds\n-\n-USAGE='[-n [<num>]] -l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg>] <tagname> [<head>]'\n-SUBDIRECTORY_OK='Yes'\n-. git-sh-setup\n-\n-message_given=\n-annotate=\n-signed=\n-force=\n-message=\n-username=\n-list=\n-verify=\n-LINES=0\n-while case \"$#\" in 0) break ;; esac\n-do\n-    case \"$1\" in\n-    -a)\n-\tannotate=1\n-\t;;\n-    -s)\n-\tannotate=1\n-\tsigned=1\n-\t;;\n-    -f)\n-\tforce=1\n-\t;;\n-    -n)\n-        case $2 in\n-\t-*)\tLINES=1 \t# no argument\n-\t\t;;\n-\t*)\tshift\n-\t\tLINES=$(expr \"$1\" : '\\([0-9]*\\)')\n-\t\t[ -z \"$LINES\" ] && LINES=1 # 1 line is default when -n is used\n-\t\t;;\n-\tesac\n-\t;;\n-    -l)\n-\tlist=1\n-\tshift\n-\tPATTERN=\"$1\"\t# select tags by shell pattern, not re\n-\tgit rev-parse --symbolic --tags | sort |\n-\t    while read TAG\n-\t    do\n-\t        case \"$TAG\" in\n-\t\t*$PATTERN*) ;;\n-\t\t*)\t    continue ;;\n-\t\tesac\n-\t\t[ \"$LINES\" -le 0 ] && { echo \"$TAG\"; continue ;}\n-\t\tOBJTYPE=$(git cat-file -t \"$TAG\")\n-\t\tcase $OBJTYPE in\n-\t\ttag)\tANNOTATION=$(git cat-file tag \"$TAG\" |\n-\t\t\t\t       sed -e '1,/^$/d' \\\n-\t\t\t\t\t   -e '/^-----BEGIN PGP SIGNATURE-----$/Q' )\n-\t\t\tprintf \"%-15s %s\\n\" \"$TAG\" \"$ANNOTATION\" |\n-\t\t\t  sed -e '2,$s/^/    /' \\\n-\t\t\t      -e \"${LINES}q\"\n-\t\t\t;;\n-\t\t*)      echo \"$TAG\"\n-\t\t\t;;\n-\t\tesac\n-\t    done\n-\t;;\n-    -m)\n-    \tannotate=1\n-\tshift\n-\tmessage=\"$1\"\n-\tif test \"$#\" = \"0\"; then\n-\t    die \"error: option -m needs an argument\"\n-\telse\n-\t    message_given=1\n-\tfi\n-\t;;\n-    -F)\n-\tannotate=1\n-\tshift\n-\tif test \"$#\" = \"0\"; then\n-\t    die \"error: option -F needs an argument\"\n-\telse\n-\t    message=\"$(cat \"$1\")\"\n-\t    message_given=1\n-\tfi\n-\t;;\n-    -u)\n-\tannotate=1\n-\tsigned=1\n-\tshift\n-\tusername=\"$1\"\n-\t;;\n-    -d)\n-    \tshift\n-\thad_error=0\n-\tfor tag\n-\tdo\n-\t\tcur=$(git-show-ref --verify --hash -- \"refs/tags/$tag\") || {\n-\t\t\techo >&2 \"Seriously, what tag are you talking about?\"\n-\t\t\thad_error=1\n-\t\t\tcontinue\n-\t\t}\n-\t\tgit-update-ref -m 'tag: delete' -d \"refs/tags/$tag\" \"$cur\" || {\n-\t\t\thad_error=1\n-\t\t\tcontinue\n-\t\t}\n-\t\techo \"Deleted tag $tag.\"\n-\tdone\n-\texit $had_error\n-\t;;\n-    -v)\n-\tshift\n-\ttag_name=\"$1\"\n-\ttag=$(git-show-ref --verify --hash -- \"refs/tags/$tag_name\") ||\n-\t\tdie \"Seriously, what tag are you talking about?\"\n-\tgit-verify-tag -v \"$tag\"\n-\texit $?\n-\t;;\n-    -*)\n-        usage\n-\t;;\n-    *)\n-\tbreak\n-\t;;\n-    esac\n-    shift\n-done\n-\n-[ -n \"$list\" ] && exit 0\n-\n-name=\"$1\"\n-[ \"$name\" ] || usage\n-prev=0000000000000000000000000000000000000000\n-if git-show-ref --verify --quiet -- \"refs/tags/$name\"\n-then\n-    test -n \"$force\" || die \"tag '$name' already exists\"\n-    prev=`git rev-parse \"refs/tags/$name\"`\n-fi\n-shift\n-git-check-ref-format \"tags/$name\" ||\n-\tdie \"we do not like '$name' as a tag name.\"\n-\n-object=$(git-rev-parse --verify --default HEAD \"$@\") || exit 1\n-type=$(git-cat-file -t $object) || exit 1\n-tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1\n-\n-test -n \"$username\" ||\n-\tusername=$(git-repo-config user.signingkey) ||\n-\tusername=$(expr \"z$tagger\" : 'z\\(.*>\\)')\n-\n-trap 'rm -f \"$GIT_DIR\"/TAG_TMP* \"$GIT_DIR\"/TAG_FINALMSG \"$GIT_DIR\"/TAG_EDITMSG' 0\n-\n-if [ \"$annotate\" ]; then\n-    if [ -z \"$message_given\" ]; then\n-        ( echo \"#\"\n-          echo \"# Write a tag message\"\n-          echo \"#\" ) > \"$GIT_DIR\"/TAG_EDITMSG\n-        ${VISUAL:-${EDITOR:-vi}} \"$GIT_DIR\"/TAG_EDITMSG || exit\n-    else\n-        printf '%s\\n' \"$message\" >\"$GIT_DIR\"/TAG_EDITMSG\n-    fi\n-\n-    grep -v '^#' <\"$GIT_DIR\"/TAG_EDITMSG |\n-    git-stripspace >\"$GIT_DIR\"/TAG_FINALMSG\n-\n-    [ -s \"$GIT_DIR\"/TAG_FINALMSG -o -n \"$message_given\" ] || {\n-\techo >&2 \"No tag message?\"\n-\texit 1\n-    }\n-\n-    ( printf 'object %s\\ntype %s\\ntag %s\\ntagger %s\\n\\n' \\\n-\t\"$object\" \"$type\" \"$name\" \"$tagger\";\n-      cat \"$GIT_DIR\"/TAG_FINALMSG ) >\"$GIT_DIR\"/TAG_TMP\n-    rm -f \"$GIT_DIR\"/TAG_TMP.asc \"$GIT_DIR\"/TAG_FINALMSG\n-    if [ \"$signed\" ]; then\n-\tgpg -bsa -u \"$username\" \"$GIT_DIR\"/TAG_TMP &&\n-\tcat \"$GIT_DIR\"/TAG_TMP.asc >>\"$GIT_DIR\"/TAG_TMP ||\n-\tdie \"failed to sign the tag with GPG.\"\n-    fi\n-    object=$(git-mktag < \"$GIT_DIR\"/TAG_TMP)\n-fi\n-\n-git update-ref \"refs/tags/$name\" \"$object\" \"$prev\"\n-\ndiff --git a/git.c b/git.c\nindex 29b55a1..c9c20fb 100644\n--- a/git.c\n+++ b/git.c\n@@ -285,6 +285,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)\n \t\t{ \"show\", cmd_show, RUN_SETUP | USE_PAGER },\n \t\t{ \"stripspace\", cmd_stripspace },\n \t\t{ \"symbolic-ref\", cmd_symbolic_ref, RUN_SETUP },\n+\t\t{ \"tag\", cmd_tag, RUN_SETUP },\n \t\t{ \"tar-tree\", cmd_tar_tree },\n \t\t{ \"unpack-objects\", cmd_unpack_objects, RUN_SETUP },\n \t\t{ \"update-index\", cmd_update_index, RUN_SETUP },\n-- \n1.5.0.6\n"},{"id":"44425","messageId":"1b46aba20706081858u7f18d9b2o5602db43d396c19@mail.gmail.com","threadId":"8516","inReplyTo":"11813427591137-git-send-email-krh@redhat.com","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Carlos Rica","fromEmail":"jasampler@gmail.com","sentAt":"2007-06-09T01:58:32Z","receivedAt":"2007-06-09T01:58:32Z","isPatch":true,"sender":{"key":"jasampler@gmail.com","avatar":null},"body":"2007/6/9, Kristian Høgsberg <krh@redhat.com>:\n> Ok, here's an updated version that passes the test suite.  Johannes, I\n> leave it to you and jasam to merge the bits you find useful, but as\n> far as I see it, this conversion is complete, and there's enough other\n> shell scripts to port.  My port doesn't pass jasam's test suite, it\n> looks like he is expecting the -l glob to be a regexp, but the\n> git-tag.sh I started from used shell globs.\n\nThat's a good proposal! I agree with your version for matching tag names,\napart from the fact that the code is more compact and readable that way.\n\nI will review your code comparing it with mine and I will report\neverything I feel. However, my desire is to get builtin-tag.c and its\ntests t7400-tag.sh complete\nin a few days or less, so I would appreciate every other correction\nfrom you in order to get it ready faster.\n\n> Anyways, it'd be nice if you or jasam could keep the list a little\n> more in the loop with the SoC changes, it is where most of the\n> development happens, after all.  What's next on your list?\n\nYou're right, the development will be more open than now was, I\nusually ask questions in the IRC channel and obviously that's not the\nbest way to report my work to everybody.\n\nFeel free to choose the script which you need to get replaced first,\nor, depending on your urgency, you could ask me for one of them and I\nwould try to concentrate my efforts on it. Why do you started with\ngit-tag? For me, it was enough easy to begin with, perhaps you could\nhave other reasons.\n\nLooking forward to work with you on that,\n\nCarlos\n"},{"id":"44474","messageId":"7v7iqdf0gn.fsf@assigned-by-dhcp.cox.net","threadId":"8516","inReplyTo":"11813427591137-git-send-email-krh@redhat.com","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-09T18:26:48Z","receivedAt":"2007-06-09T18:26:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kristian Høgsberg <krh@redhat.com> writes:\n\n> Content-Type: TEXT/PLAIN; charset=ISO-8859-1\n>\n> From: Kristian HÃ¸gsberg <krh@redhat.com>\n>\n> A more or less straight-forward port of git-tag.sh to C.\n>\n> Signed-off-by: Kristian HÃ¸gsberg <krh@redhat.com>\n> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nI think your name in your commit message is in UTF-8 but munged your\nmail was mismarked as iso-8859-1.\n\n> +static int launch_editor(const char *path, const char *template,\n> +\t\t\t  char *buffer, size_t size)\n> +{\n\nIt would have been nicer to have this in editor.c or somesuch,\nas other commands will be redone in C in the future.\n\nWe could do the moving later, but the problem is that later is\nconditional: \"if we are lucky enough to remember that we already\nhave this function in builtin-tag when doing so\".\n\n> +\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);\n\nI would understand an argument to use 0666 (honor umask) or 0600\n(this is a temporary file and others have no business looking at\nit while an edit is in progress), but I cannot justify 0644.\n\n> +\tfd = open(path, O_RDONLY, 0644);\n\nOpen for reading with mode ;-)?\n\n> +\tif (fd == -1)\n> +\t\tdie(\"could not read %s.\", path);\n> +\tlen = read_in_full(fd, buffer, size);\n> +\tif (len < 0)\n> +\t\tdie(\"failed to read '%s', %m\", path);\n> +\tclose(fd);\n> +\n> +\tblank_lines = 1;\n> +\tfor (i = 0, j = 0; i < len; i++) {\n> ...\n> +\t}\n> +\n> +\tif (buffer[j - 1] != '\\n')\n> +\t\tbuffer[j++] = '\\n';\n> +\n> +\tunlink(path);\n> +\n> +\treturn j;\n> +}\n\nI really think this function needs to be refactored into three.\n\n * A generic \"spawn an editor with this initial seed template,\n   return the result of editing in memory and also give exit\n   status of the editor\" function that does not take path\n   parameter (instead perhaps mkstemp a temporary file on your\n   own);\n\n * A function that does what git-stripspace does in core;\n\n * A function for builtin-tag to use, that calls the above two\n   and uses the result (e.g. \"did the user kill the editor?\n   does the resulting buffer have any nonempty line?\") to decide\n   what it does.\n\n> +static void create_tag(const unsigned char *object, const char *tag,\n> +\t\t       const char *message, int sign, unsigned char *result)\n> +{\n> +\tenum object_type type;\n> +\tchar buffer[4096];\n> +\tint header, body, total;\n> +\n> +\ttype = sha1_object_info(object, NULL);\n> +\tif (type <= 0)\n> +\t    die(\"bad object type.\");\n> +\n> +\theader = snprintf(buffer, sizeof buffer,\n> +\t\t\t  \"object %s\\n\"\n> +\t\t\t  \"type %s\\n\"\n> +\t\t\t  \"tag %s\\n\"\n> +\t\t\t  \"tagger %s\\n\\n\",\n> +\t\t\t  sha1_to_hex(object),\n> +\t\t\t  typename(type),\n> +\t\t\t  tag,\n> +\t\t\t  git_committer_info(1));\n> +\n> +\tif (message == NULL)\n> +\t\tbody = launch_editor(git_path(\"TAGMSG\"), tag_template,\n> +\t\t\t\t     buffer + header, sizeof buffer - header);\n> +\telse\n> +\t\tbody = snprintf(buffer + header, sizeof buffer - header,\n> +\t\t\t\t\"%s\\n\", message);\n> +\n> +\tif (body == 0)\n> +\t\tdie(\"no tag message?\");\n> +\n> +\tif (header + body > sizeof buffer)\n> +\t\tdie(\"tag message too big.\");\n\nTwo issues:\n\n * It used to be a tag had limit of 8kB which was lifted some\n   time ago; now it is limited to 4kB.  Fixing this implies that\n   the \"launch editor and get results in core\" function I\n   mentioned above may need to realloc, and probably the buffer\n   is better passed as (char *, ulong) pair as done everywhere\n   else (although we know this is text so you can pass only a\n   pointer and have the user run strlen() when needed).\n\n * I do not see any validation on the value of \"tag\".  Do we want\n   to allow passing \"\" to it?  What about \"my\\ntag\"?\n"},{"id":"44512","messageId":"466B376D.8040303@redhat.com","threadId":"8516","inReplyTo":"7v7iqdf0gn.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Kristian Høgsberg","fromEmail":"krh@redhat.com","sentAt":"2007-06-09T23:27:41Z","receivedAt":"2007-06-09T23:27:41Z","isPatch":true,"sender":{"key":"krh@redhat.com","avatar":"https://gravatar.com/avatar/763dee6f9594ac474f725b137a39565792928e583ddf59b32befc2907409027e?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Kristian Høgsberg <krh@redhat.com> writes:\n> \n>> Content-Type: TEXT/PLAIN; charset=ISO-8859-1\n>>\n>> From: Kristian HÃ¸gsberg <krh@redhat.com>\n>>\n>> A more or less straight-forward port of git-tag.sh to C.\n>>\n>> Signed-off-by: Kristian HÃ¸gsberg <krh@redhat.com>\n>> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> \n> I think your name in your commit message is in UTF-8 but munged your\n> mail was mismarked as iso-8859-1.\n\nThat's odd both the email I cc'ed to my redhat.com address and the one I got \non gmail.com through the list have\n\n   Content-Type: text/plain; charset=utf-8\n\nand saving the raw message and asking /usr/bin/file, it tells me its\n\n   /home/krh/Desktop/hep: UTF-8 Unicode mail text\n\n>> +static int launch_editor(const char *path, const char *template,\n>> +\t\t\t  char *buffer, size_t size)\n>> +{\n> \n> It would have been nicer to have this in editor.c or somesuch,\n> as other commands will be redone in C in the future.\n> \n> We could do the moving later, but the problem is that later is\n> conditional: \"if we are lucky enough to remember that we already\n> have this function in builtin-tag when doing so\".\n\nYeah, true.  I did write it as a generally usable \"launch editor\" functions, \nbut I didn't want to move it until there was a second user.  Is there anything \nelse that git-commit that will use this, btw?\n\n>> +\tfd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0644);\n> \n> I would understand an argument to use 0666 (honor umask) or 0600\n> (this is a temporary file and others have no business looking at\n> it while an edit is in progress), but I cannot justify 0644.\n\nOh hehe, yeah, I didn't think much about the permission bits... 0666 sounds fine.\n\n>> +\tfd = open(path, O_RDONLY, 0644);\n> \n> Open for reading with mode ;-)?\n\nEven less thinking here :)\n\n>> +\tif (fd == -1)\n>> +\t\tdie(\"could not read %s.\", path);\n>> +\tlen = read_in_full(fd, buffer, size);\n>> +\tif (len < 0)\n>> +\t\tdie(\"failed to read '%s', %m\", path);\n>> +\tclose(fd);\n>> +\n>> +\tblank_lines = 1;\n>> +\tfor (i = 0, j = 0; i < len; i++) {\n>> ...\n>> +\t}\n>> +\n>> +\tif (buffer[j - 1] != '\\n')\n>> +\t\tbuffer[j++] = '\\n';\n>> +\n>> +\tunlink(path);\n>> +\n>> +\treturn j;\n>> +}\n> \n> I really think this function needs to be refactored into three.\n> \n>  * A generic \"spawn an editor with this initial seed template,\n>    return the result of editing in memory and also give exit\n>    status of the editor\" function that does not take path\n>    parameter (instead perhaps mkstemp a temporary file on your\n>    own);\n> \n>  * A function that does what git-stripspace does in core;\n> \n>  * A function for builtin-tag to use, that calls the above two\n>    and uses the result (e.g. \"did the user kill the editor?\n>    does the resulting buffer have any nonempty line?\") to decide\n>    what it does.\n\nand that last function should be useful for git-commit too, no?  The reason I \ndidn't split it up was that I don't see any use for the two parts on their \nown, and the functions is a total of 70 lines.  And wouldn't returning 0 bytes \nfor either an empty buffer or editor quit be sufficient?  Do we need to handle \nthe two cases differently?\n\n>> +static void create_tag(const unsigned char *object, const char *tag,\n>> +\t\t       const char *message, int sign, unsigned char *result)\n>> +{\n>> +\tenum object_type type;\n>> +\tchar buffer[4096];\n>> +\tint header, body, total;\n>> +\n>> +\ttype = sha1_object_info(object, NULL);\n>> +\tif (type <= 0)\n>> +\t    die(\"bad object type.\");\n>> +\n>> +\theader = snprintf(buffer, sizeof buffer,\n>> +\t\t\t  \"object %s\\n\"\n>> +\t\t\t  \"type %s\\n\"\n>> +\t\t\t  \"tag %s\\n\"\n>> +\t\t\t  \"tagger %s\\n\\n\",\n>> +\t\t\t  sha1_to_hex(object),\n>> +\t\t\t  typename(type),\n>> +\t\t\t  tag,\n>> +\t\t\t  git_committer_info(1));\n>> +\n>> +\tif (message == NULL)\n>> +\t\tbody = launch_editor(git_path(\"TAGMSG\"), tag_template,\n>> +\t\t\t\t     buffer + header, sizeof buffer - header);\n>> +\telse\n>> +\t\tbody = snprintf(buffer + header, sizeof buffer - header,\n>> +\t\t\t\t\"%s\\n\", message);\n>> +\n>> +\tif (body == 0)\n>> +\t\tdie(\"no tag message?\");\n>> +\n>> +\tif (header + body > sizeof buffer)\n>> +\t\tdie(\"tag message too big.\");\n> \n> Two issues:\n> \n>  * It used to be a tag had limit of 8kB which was lifted some\n>    time ago; now it is limited to 4kB.  Fixing this implies that\n>    the \"launch editor and get results in core\" function I\n>    mentioned above may need to realloc, and probably the buffer\n>    is better passed as (char *, ulong) pair as done everywhere\n>    else (although we know this is text so you can pass only a\n>    pointer and have the user run strlen() when needed).\n\nOh... read_pipe() reallocs... OK.  I took the limit from mktag.c and didn't \nrealize that the buffer could get realloced.  I did wonder about the xmalloc() \nfor a fixed buffer though...\n\n>  * I do not see any validation on the value of \"tag\".  Do we want\n>    to allow passing \"\" to it?  What about \"my\\ntag\"?\n\nI do\n\n         if (check_ref_format(ref))\n                 die(\"'%s' is not a valid tag name.\", tag);\n\non the ref, which is what git-tag.sh ends up doing, and it catches the two \nexamples you mention:\n\n[krh@dinky git]$ ./git tag \"hello\n > world\"\nfatal: 'hello\nworld' is not a valid tag name.\n[krh@dinky git]$ ./git tag \"\"\nfatal: '' is not a valid tag name.\n\nso I think it's fine.\n\nBut I think I'll leave it to Carlos to finish his builtin-tag work, and he can \ncherry pick the bits from my patch that work for him.  This was more of a \nfriday afternoon hacking sprint, for my part.\n\ncheers,\nKristian\n"},{"id":"44594","messageId":"200706101437.50441.robin.rosenberg.lists@dewire.com","threadId":"8516","inReplyTo":"466B376D.8040303@redhat.com","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-06-10T12:37:49Z","receivedAt":"2007-06-10T12:37:49Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndag 10 juni 2007 skrev Kristian Høgsberg:\n> Junio C Hamano wrote:\n> > Kristian Høgsberg <krh@redhat.com> writes:\n> > \n> >> Content-Type: TEXT/PLAIN; charset=ISO-8859-1\n> >>\n> >> From: Kristian HÃ¸gsberg <krh@redhat.com>\n> >>\n> >> A more or less straight-forward port of git-tag.sh to C.\n> >>\n> >> Signed-off-by: Kristian HÃ¸gsberg <krh@redhat.com>\n> >> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> > \n> > I think your name in your commit message is in UTF-8 but munged your\n> > mail was mismarked as iso-8859-1.\n> \n> That's odd both the email I cc'ed to my redhat.com address and the one I got \n> on gmail.com through the list have\n> \n>    Content-Type: text/plain; charset=utf-8\n> \n> and saving the raw message and asking /usr/bin/file, it tells me its\n> \n>    /home/krh/Desktop/hep: UTF-8 Unicode mail text\n\nMaybe Junio's mail server has a problem with the impliction of this header line? \n\n\"Content-Transfer-Encoding: 8bit\" ?\n\n-- robin\n"},{"id":"44644","messageId":"7vlker7aqv.fsf@assigned-by-dhcp.cox.net","threadId":"8516","inReplyTo":"200706101437.50441.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-10T21:36:24Z","receivedAt":"2007-06-10T21:36:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> söndag 10 juni 2007 skrev Kristian Høgsberg:\n>> Junio C Hamano wrote:\n>> > Kristian Høgsberg <krh@redhat.com> writes:\n>> > ...\n>> > I think your name in your commit message is in UTF-8 but munged your\n>> > mail was mismarked as iso-8859-1.\n>> \n>> That's odd both the email I cc'ed to my redhat.com address and the one I got \n>> on gmail.com through the list have\n>> \n>>    Content-Type: text/plain; charset=utf-8\n>> \n>> and saving the raw message and asking /usr/bin/file, it tells me its\n>> \n>>    /home/krh/Desktop/hep: UTF-8 Unicode mail text\n>\n> Maybe Junio's mail server has a problem with the impliction of this header line? \n>\n> \"Content-Transfer-Encoding: 8bit\" ?\n\nThe copy of Kristian's message gmane has says:\n\n\tContent-Type: TEXT/PLAIN; charset=ISO-8859-1\n\nI do not think it is just me.\n"},{"id":"44653","messageId":"20070610221306.GF27340@coredump.intra.peff.net","threadId":"8516","inReplyTo":"7v7iqdf0gn.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-06-10T22:13:06Z","receivedAt":"2007-06-10T22:13:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jun 09, 2007 at 11:26:48AM -0700, Junio C Hamano wrote:\n\n> > Signed-off-by: Kristian HÃ¸gsberg <krh@redhat.com>\n> I think your name in your commit message is in UTF-8 but munged your\n> mail was mismarked as iso-8859-1.\n\nThis is the same git-send-email bug that we fixed recently (missing\nMIME-Version header). Just look for the vger \"we munged your message\"\nheaders in the version you received.\n\n-Peff\n"},{"id":"44654","messageId":"7vzm375u7f.fsf@assigned-by-dhcp.cox.net","threadId":"8516","inReplyTo":"20070610221306.GF27340@coredump.intra.peff.net","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-10T22:19:00Z","receivedAt":"2007-06-10T22:19:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> This is the same git-send-email bug that we fixed recently (missing\n> MIME-Version header). Just look for the vger \"we munged your message\"\n> headers in the version you received.\n\nAhh.  You are right.  The message does have these:\n\n        X-Warning: Original message contained 8-bit characters, however during\n                   the SMTP transport session the receiving system did not announce\n                   capability of receiving 8-bit SMTP (RFC 1651-1653), and as this\n                   message does not have MIME headers (RFC 2045-2049) to enable\n                   encoding change, we had very little choice.\n        X-Warning: We ASSUME it is less harmful to add the MIME headers, and\n                   convert the text to Quoted-Printable, than not to do so,\n                   and to strip the message to 7-bits.. (RFC 1428 Appendix A)\n        X-Warning: We don't know what character set the user used, thus we had to\n                   write these MIME-headers with our local system default value.\n"},{"id":"44655","messageId":"20070610222229.GA28264@coredump.intra.peff.net","threadId":"8516","inReplyTo":"7vzm375u7f.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-06-10T22:22:29Z","receivedAt":"2007-06-10T22:22:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 10, 2007 at 03:19:00PM -0700, Junio C Hamano wrote:\n\n> > This is the same git-send-email bug that we fixed recently (missing\n> > MIME-Version header). Just look for the vger \"we munged your message\"\n> > headers in the version you received.\n> \n> Ahh.  You are right.  The message does have these:\n\nYes, it's easy for me to tell because I get his messages intact. :) Not\nto mention his X-Mailer mentions git-send-email 1.5.0.6.\n\nKristian, the fix is in git 1.5.1.5 and later, if it's not too much\ntrouble to upgrade.\n\n-Peff\n"},{"id":"44788","messageId":"Pine.LNX.4.64.0706112314300.5848@iabervon.org","threadId":"8516","inReplyTo":"1b46aba20706081858u7f18d9b2o5602db43d396c19@mail.gmail.com","subject":"Re: [PATCH] Port git-tag.sh to C.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-06-12T03:28:39Z","receivedAt":"2007-06-12T03:28:39Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sat, 9 Jun 2007, Carlos Rica wrote:\n\n> Feel free to choose the script which you need to get replaced first,\n> or, depending on your urgency, you could ask me for one of them and I\n> would try to concentrate my efforts on it. Why do you started with\n> git-tag? For me, it was enough easy to begin with, perhaps you could\n> have other reasons.\n\nIncidentally, I have been working on fetch, based on Julian Phillips's \nversion. I'm trying to split out the \"how do I communicate with remote \nrepositories\" code, and use it for pushing and ls-remote as well as fetch. \nI've got a bunch of not-for-official-history development that you should \nlook at if you try any of the remote-repository-access scripts.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"44831","messageId":"Pine.LNX.4.64.0706121341250.4059@racer.site","threadId":"8516","inReplyTo":"Pine.LNX.4.64.0706112314300.5848@iabervon.org","subject":"git-fetch, was Re: [PATCH] Port git-tag.sh to C.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-12T12:41:50Z","receivedAt":"2007-06-12T12:41:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 11 Jun 2007, Daniel Barkalow wrote:\n\n> On Sat, 9 Jun 2007, Carlos Rica wrote:\n> \n> > Feel free to choose the script which you need to get replaced first, \n> > or, depending on your urgency, you could ask me for one of them and I \n> > would try to concentrate my efforts on it. Why do you started with \n> > git-tag? For me, it was enough easy to begin with, perhaps you could \n> > have other reasons.\n> \n> Incidentally, I have been working on fetch, based on Julian Phillips's \n> version. I'm trying to split out the \"how do I communicate with remote \n> repositories\" code, and use it for pushing and ls-remote as well as \n> fetch. I've got a bunch of not-for-official-history development that you \n> should look at if you try any of the remote-repository-access scripts.\n\nHow about pushing them onto repo.or.cz as a fork of git.git?\n\nCiao,\nDscho\n"},{"id":"44832","messageId":"Pine.LNX.4.64.0706121427410.18585@reaper.quantumfyre.co.uk","threadId":"8516","inReplyTo":"Pine.LNX.4.64.0706121341250.4059@racer.site","subject":"Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C.","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-06-12T13:29:20Z","receivedAt":"2007-06-12T13:29:20Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Tue, 12 Jun 2007, Johannes Schindelin wrote:\n\n> Hi,\n>\n> On Mon, 11 Jun 2007, Daniel Barkalow wrote:\n>\n>> On Sat, 9 Jun 2007, Carlos Rica wrote:\n>>\n>>> Feel free to choose the script which you need to get replaced first,\n>>> or, depending on your urgency, you could ask me for one of them and I\n>>> would try to concentrate my efforts on it. Why do you started with\n>>> git-tag? For me, it was enough easy to begin with, perhaps you could\n>>> have other reasons.\n>>\n>> Incidentally, I have been working on fetch, based on Julian Phillips's\n>> version. I'm trying to split out the \"how do I communicate with remote\n>> repositories\" code, and use it for pushing and ls-remote as well as\n>> fetch. I've got a bunch of not-for-official-history development that you\n>> should look at if you try any of the remote-repository-access scripts.\n>\n> How about pushing them onto repo.or.cz as a fork of git.git?\n\nI'd quite like to see these changes too - since I haven't finished the \nfetch work yet, and I don't want to duplicate effort ;)\n\n(It seems that the closer I get to a working fetch the less time I spend \non it ... :$)\n\n-- \nJulian\n\n  ---\n    Old robot: I choose to believe what I was programmed to believe.\n"},{"id":"44845","messageId":"Pine.LNX.4.64.0706121237400.5848@iabervon.org","threadId":"8516","inReplyTo":"Pine.LNX.4.64.0706121427410.18585@reaper.quantumfyre.co.uk","subject":"Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-06-12T16:51:24Z","receivedAt":"2007-06-12T16:51:24Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 12 Jun 2007, Julian Phillips wrote:\n\n> On Tue, 12 Jun 2007, Johannes Schindelin wrote:\n> \n> > How about pushing them onto repo.or.cz as a fork of git.git?\n> \n> I'd quite like to see these changes too - since I haven't finished the fetch\n> work yet, and I don't want to duplicate effort ;)\n\nI'll put it up on my server this evening; I forgot to push the latest \nversion from my laptop to somewhere I can get it.\n\n> (It seems that the closer I get to a working fetch the less time I spend on it\n> ... :$)\n\nMy efforts have similarly stagnated, but the GSoC talk reminded me that a \nthird person could take over. Although the series I just posted adds \nbranch config parsing, which is helpful for making fetch clean, even if it \ndoesn't make it closer to working completely.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"44880","messageId":"Pine.LNX.4.64.0706121953080.5848@iabervon.org","threadId":"8516","inReplyTo":"Pine.LNX.4.64.0706121427410.18585@reaper.quantumfyre.co.uk","subject":"Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-06-12T23:55:25Z","receivedAt":"2007-06-12T23:55:25Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 12 Jun 2007, Julian Phillips wrote:\n\n> On Tue, 12 Jun 2007, Johannes Schindelin wrote:\n> \n> > Hi,\n> >\n> > On Mon, 11 Jun 2007, Daniel Barkalow wrote:\n> >\n> > > On Sat, 9 Jun 2007, Carlos Rica wrote:\n> > >\n> > > > Feel free to choose the script which you need to get replaced first,\n> > > > or, depending on your urgency, you could ask me for one of them and I\n> > > > would try to concentrate my efforts on it. Why do you started with\n> > > > git-tag? For me, it was enough easy to begin with, perhaps you could\n> > > > have other reasons.\n> > >\n> > > Incidentally, I have been working on fetch, based on Julian Phillips's\n> > > version. I'm trying to split out the \"how do I communicate with remote\n> > > repositories\" code, and use it for pushing and ls-remote as well as\n> > > fetch. I've got a bunch of not-for-official-history development that you\n> > > should look at if you try any of the remote-repository-access scripts.\n> >\n> > How about pushing them onto repo.or.cz as a fork of git.git?\n> \n> I'd quite like to see these changes too - since I haven't finished the fetch\n> work yet, and I don't want to duplicate effort ;)\n\nOkay, git://iabervon.org/~barkalow/git.git builtin-fetch.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"44881","messageId":"Pine.LNX.4.64.0706130126530.4059@racer.site","threadId":"8516","inReplyTo":"Pine.LNX.4.64.0706121953080.5848@iabervon.org","subject":"Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-13T00:27:04Z","receivedAt":"2007-06-13T00:27:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 12 Jun 2007, Daniel Barkalow wrote:\n\n> Okay, git://iabervon.org/~barkalow/git.git builtin-fetch.\n\nThanks!\n\nCiao,\nDscho\n"}]}