{"thread":{"id":"34799","subject":"[PATCH 0/9] transport-helper: updates","startedAt":"2013-08-29T15:23:19Z","lastAt":"2013-09-23T02:41:29Z","messageCount":20,"participants":["Felipe Contreras","Junio C Hamano","Richard Hansen"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"226168","messageId":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":null,"subject":"[PATCH 0/9] transport-helper: updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:19Z","receivedAt":"2013-08-29T15:23:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nHere are the patches that allow transport helpers to be completely transparent;\nrenaming branches, deleting them, custom refspecs, --force, --dry-run,\nreporting forced update, everything works.\n\nSome of these were were sent before and rejected without a reason, but here\nthey are again in case anybody is interested.\n\nFelipe Contreras (9):\n  transport-helper: add 'force' to 'export' helpers\n  transport-helper: check for 'forced update' message\n  fast-export: improve argument parsing\n  fast-export: add new --refspec option\n  transport-helper: add support for old:new refspec\n  fast-import: add support to delete refs\n  fast-export: add support to delete refs\n  transport-helper: add support to delete branches\n  transport-helper: don't update refs in dry-run\n\n Documentation/git-fast-export.txt |  4 ++++\n Documentation/git-fast-import.txt |  3 +++\n builtin/fast-export.c             | 47 ++++++++++++++++++++++++++++++++++++++-\n fast-import.c                     | 13 ++++++++---\n t/t5801-remote-helpers.sh         | 10 ++++++++-\n t/t9300-fast-import.sh            | 18 +++++++++++++++\n t/t9350-fast-export.sh            | 18 +++++++++++++++\n transport-helper.c                | 42 ++++++++++++++++++++++++----------\n 8 files changed, 138 insertions(+), 17 deletions(-)\n\n-- \n1.8.4-fc\n"},{"id":"226169","messageId":"1377789808-2213-2-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/9] transport-helper: add 'force' to 'export' helpers","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:20Z","receivedAt":"2013-08-29T15:23:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Otherwise they cannot know when to force the push or not (other than\nhacks).\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n transport-helper.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..62051a6 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -814,6 +814,9 @@ static int push_refs_with_export(struct transport *transport,\n \t\t\tdie(\"helper %s does not support dry-run\", data->name);\n \t}\n \n+\tif (flags & TRANSPORT_PUSH_FORCE)\n+\t\tset_helper_option(transport, \"force\", \"true\");\n+\n \thelper = get_helper(transport);\n \n \twrite_constant(helper->in, \"export\\n\");\n-- \n1.8.4-fc\n"},{"id":"226170","messageId":"1377789808-2213-3-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/9] transport-helper: check for 'forced update' message","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:21Z","receivedAt":"2013-08-29T15:23:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So the remote-helpers can tell us when a forced push was needed.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n transport-helper.c | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 62051a6..95dd72e 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -630,7 +630,7 @@ static int push_update_ref_status(struct strbuf *buf,\n \t\t\t\t   struct ref *remote_refs)\n {\n \tchar *refname, *msg;\n-\tint status;\n+\tint status, forced = 0;\n \n \tif (!prefixcmp(buf->buf, \"ok \")) {\n \t\tstatus = REF_STATUS_OK;\n@@ -683,6 +683,11 @@ static int push_update_ref_status(struct strbuf *buf,\n \t\t\tfree(msg);\n \t\t\tmsg = NULL;\n \t\t}\n+\t\telse if (!strcmp(msg, \"forced update\")) {\n+\t\t\tforced = 1;\n+\t\t\tfree(msg);\n+\t\t\tmsg = NULL;\n+\t\t}\n \t}\n \n \tif (*ref)\n@@ -704,6 +709,7 @@ static int push_update_ref_status(struct strbuf *buf,\n \t}\n \n \t(*ref)->status = status;\n+\t(*ref)->forced_update = forced;\n \t(*ref)->remote_status = msg;\n \treturn !(status == REF_STATUS_OK);\n }\n-- \n1.8.4-fc\n"},{"id":"226171","messageId":"1377789808-2213-4-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 3/9] fast-export: improve argument parsing","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:22Z","receivedAt":"2013-08-29T15:23:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't want to pass arguments specific to fast-export to\nsetup_revisions.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/fast-export.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 8e19058..91114f4 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -694,8 +694,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \trevs.topo_order = 1;\n \trevs.show_source = 1;\n \trevs.rewrite_parents = 1;\n+\targc = parse_options(argc, argv, prefix, options, fast_export_usage,\n+\t\t\tPARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN);\n \targc = setup_revisions(argc, argv, &revs, NULL);\n-\targc = parse_options(argc, argv, prefix, options, fast_export_usage, 0);\n \tif (argc > 1)\n \t\tusage_with_options (fast_export_usage, options);\n \n-- \n1.8.4-fc\n"},{"id":"226172","messageId":"1377789808-2213-5-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 4/9] fast-export: add new --refspec option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:23Z","receivedAt":"2013-08-29T15:23:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So that we can covert the exported ref names.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-fast-export.txt |  4 ++++\n builtin/fast-export.c             | 30 ++++++++++++++++++++++++++++++\n t/t9350-fast-export.sh            |  7 +++++++\n 3 files changed, 41 insertions(+)\n\ndiff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\nindex 85f1f30..221506b 100644\n--- a/Documentation/git-fast-export.txt\n+++ b/Documentation/git-fast-export.txt\n@@ -105,6 +105,10 @@ marks the same across runs.\n \tin the commit (as opposed to just listing the files which are\n \tdifferent from the commit's first parent).\n \n+--refspec::\n+\tApply the specified refspec to each ref exported. Multiple of them can\n+\tbe specified.\n+\n [<git-rev-list-args>...]::\n \tA list of arguments, acceptable to 'git rev-parse' and\n \t'git rev-list', that specifies the specific objects and references\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 91114f4..7f314f0 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -17,6 +17,7 @@\n #include \"utf8.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n+#include \"remote.h\"\n \n static const char *fast_export_usage[] = {\n \tN_(\"git fast-export [rev-list-opts]\"),\n@@ -30,6 +31,8 @@ static int fake_missing_tagger;\n static int use_done_feature;\n static int no_data;\n static int full_tree;\n+static struct refspec *refspecs;\n+static int refspecs_nr;\n \n static int parse_opt_signed_tag_mode(const struct option *opt,\n \t\t\t\t     const char *arg, int unset)\n@@ -502,6 +505,15 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info,\n \t\tif (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1)\n \t\t\tcontinue;\n \n+\t\tif (refspecs) {\n+\t\t\tchar *private;\n+\t\t\tprivate = apply_refspecs(refspecs, refspecs_nr, full_name);\n+\t\t\tif (private) {\n+\t\t\t\tfree(full_name);\n+\t\t\t\tfull_name = private;\n+\t\t\t}\n+\t\t}\n+\n \t\tswitch (e->item->type) {\n \t\tcase OBJ_COMMIT:\n \t\t\tcommit = (struct commit *)e->item;\n@@ -661,6 +673,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \tstruct commit *commit;\n \tchar *export_filename = NULL, *import_filename = NULL;\n \tuint32_t lastimportid;\n+\tstruct string_list refspecs_list;\n \tstruct option options[] = {\n \t\tOPT_INTEGER(0, \"progress\", &progress,\n \t\t\t    N_(\"show progress after <n> objects\")),\n@@ -681,6 +694,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \t\tOPT_BOOLEAN(0, \"use-done-feature\", &use_done_feature,\n \t\t\t     N_(\"Use the done feature to terminate the stream\")),\n \t\tOPT_BOOL(0, \"no-data\", &no_data, N_(\"Skip output of blob data\")),\n+\t\tOPT_STRING_LIST(0, \"refspec\", &refspecs_list, N_(\"refspec\"),\n+\t\t\t     N_(\"Apply refspec to exported refs\")),\n \t\tOPT_END()\n \t};\n \n@@ -700,6 +715,19 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \tif (argc > 1)\n \t\tusage_with_options (fast_export_usage, options);\n \n+\tif (refspecs_list.nr) {\n+\t\tconst char *refspecs_str[refspecs_list.nr];\n+\t\tint i;\n+\n+\t\tfor (i = 0; i < refspecs_list.nr; i++)\n+\t\t\trefspecs_str[i] = refspecs_list.items[i].string;\n+\n+\t\trefspecs_nr = refspecs_list.nr;\n+\t\trefspecs = parse_fetch_refspec(refspecs_nr, refspecs_str);\n+\n+\t\tstring_list_clear(&refspecs_list, 1);\n+\t}\n+\n \tif (use_done_feature)\n \t\tprintf(\"feature done\\n\");\n \n@@ -734,5 +762,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \tif (use_done_feature)\n \t\tprintf(\"done\\n\");\n \n+\tfree_refspec(refspecs_nr, refspecs);\n+\n \treturn 0;\n }\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 34c2d8f..dc6666f 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -504,4 +504,11 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'use refspec' '\n+\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n+\t\tgrep \"^commit \" | sort | uniq > actual &&\n+\techo \"commit refs/heads/foobar\" > expected &&\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.4-fc\n"},{"id":"226173","messageId":"1377789808-2213-6-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 5/9] transport-helper: add support for old:new refspec","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:24Z","receivedAt":"2013-08-29T15:23:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"By using fast-export's new --refspec option.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t5801-remote-helpers.sh |  2 +-\n transport-helper.c        | 13 ++++++++++---\n 2 files changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8c4c539..8e2dd9f 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -87,7 +87,7 @@ test_expect_success 'push new branch by name' '\n \tcompare_refs local HEAD server refs/heads/new-name\n '\n \n-test_expect_failure 'push new branch with old:new refspec' '\n+test_expect_success 'push new branch with old:new refspec' '\n \t(cd local &&\n \t git push origin new-name:new-refspec\n \t) &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 95dd72e..c7135ef 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -809,7 +809,7 @@ static int push_refs_with_export(struct transport *transport,\n \tstruct ref *ref;\n \tstruct child_process *helper, exporter;\n \tstruct helper_data *data = transport->data;\n-\tstruct string_list revlist_args = STRING_LIST_INIT_NODUP;\n+\tstruct string_list revlist_args = STRING_LIST_INIT_DUP;\n \tstruct strbuf buf = STRBUF_INIT;\n \n \tif (!data->refspecs)\n@@ -848,8 +848,13 @@ static int push_refs_with_export(struct transport *transport,\n \t\t\tdie(\"remote-helpers do not support ref deletion\");\n \n \t\tif (ref->peer_ref) {\n-\t\t\tif (strcmp(ref->peer_ref->name, ref->name))\n-\t\t\t\tdie(\"remote-helpers do not support old:new syntax\");\n+\t\t\tif (strcmp(ref->name, ref->peer_ref->name)) {\n+\t\t\t\tstruct strbuf buf = STRBUF_INIT;\n+\t\t\t\tstrbuf_addf(&buf, \"%s:%s\", ref->peer_ref->name, ref->name);\n+\t\t\t\tstring_list_append(&revlist_args, \"--refspec\");\n+\t\t\t\tstring_list_append(&revlist_args, buf.buf);\n+\t\t\t\tstrbuf_release(&buf);\n+\t\t\t}\n \t\t\tstring_list_append(&revlist_args, ref->peer_ref->name);\n \t\t}\n \t}\n@@ -857,6 +862,8 @@ static int push_refs_with_export(struct transport *transport,\n \tif (get_exporter(transport, &exporter, &revlist_args))\n \t\tdie(\"Couldn't run fast-export\");\n \n+\tstring_list_clear(&revlist_args, 1);\n+\n \tif (finish_command(&exporter))\n \t\tdie(\"Error while running fast-export\");\n \tpush_update_refs_status(data, remote_refs);\n-- \n1.8.4-fc\n"},{"id":"226174","messageId":"1377789808-2213-7-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 6/9] fast-import: add support to delete refs","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:25Z","receivedAt":"2013-08-29T15:23:25Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-fast-import.txt |  3 +++\n fast-import.c                     | 13 ++++++++++---\n t/t9300-fast-import.sh            | 18 ++++++++++++++++++\n 3 files changed, 31 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt\nindex bf1a02a..fe5c952 100644\n--- a/Documentation/git-fast-import.txt\n+++ b/Documentation/git-fast-import.txt\n@@ -483,6 +483,9 @@ Marks must be declared (via `mark`) before they can be used.\n * Any valid Git SHA-1 expression that resolves to a commit.  See\n   ``SPECIFYING REVISIONS'' in linkgit:gitrevisions[7] for details.\n \n+* The special null SHA-1 (40 zeros) specifices that the branch is to be\n+  removed.\n+\n The special case of restarting an incremental import from the\n current branch value should be written as:\n ----\ndiff --git a/fast-import.c b/fast-import.c\nindex 23f625f..b6be7a7 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -248,6 +248,7 @@ struct branch {\n \tuintmax_t last_commit;\n \tuintmax_t num_notes;\n \tunsigned active : 1;\n+\tunsigned delete : 1;\n \tunsigned pack_id : PACK_ID_BITS;\n \tunsigned char sha1[20];\n };\n@@ -1674,10 +1675,13 @@ static int update_branch(struct branch *b)\n \tstruct ref_lock *lock;\n \tunsigned char old_sha1[20];\n \n-\tif (is_null_sha1(b->sha1))\n-\t\treturn 0;\n \tif (read_ref(b->name, old_sha1))\n \t\thashclr(old_sha1);\n+\tif (is_null_sha1(b->sha1)) {\n+\t\tif (b->delete)\n+\t\t\tdelete_ref(b->name, old_sha1, 0);\n+\t\treturn 0;\n+\t}\n \tlock = lock_any_ref_for_update(b->name, old_sha1, 0);\n \tif (!lock)\n \t\treturn error(\"Unable to lock %s\", b->name);\n@@ -2604,8 +2608,11 @@ static int parse_from(struct branch *b)\n \t\t\tfree(buf);\n \t\t} else\n \t\t\tparse_from_existing(b);\n-\t} else if (!get_sha1(from, b->sha1))\n+\t} else if (!get_sha1(from, b->sha1)) {\n \t\tparse_from_existing(b);\n+\t\tif (is_null_sha1(b->sha1))\n+\t\t\tb->delete = 1;\n+\t}\n \telse\n \t\tdie(\"Invalid ref name or SHA1 expression: %s\", from);\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex ac6f3b6..0150aa6 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -2934,4 +2934,22 @@ test_expect_success 'S: ls with garbage after sha1 must fail' '\n \ttest_i18ngrep \"space after tree-ish\" err\n '\n \n+test_expect_success 'T: delete branch' '\n+\tgit branch to-delete &&\n+\tgit fast-import <<-EOF &&\n+\treset refs/heads/to-delete\n+\tfrom 0000000000000000000000000000000000000000\n+\tEOF\n+\ttest_must_fail git rev-parse --verify refs/heads/to-delete\n+'\n+\n+test_expect_success 'T: empty reset doesnt delete branch' '\n+\tgit branch not-to-delete &&\n+\tgit fast-import <<-EOF &&\n+\treset refs/heads/not-to-delete\n+\tEOF\n+\tgit show-ref &&\n+\tgit rev-parse --verify refs/heads/not-to-delete\n+'\n+\n test_done\n-- \n1.8.4-fc\n"},{"id":"226175","messageId":"1377789808-2213-8-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 7/9] fast-export: add support to delete refs","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:26Z","receivedAt":"2013-08-29T15:23:26Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/fast-export.c  | 14 ++++++++++++++\n t/t9350-fast-export.sh | 11 +++++++++++\n 2 files changed, 25 insertions(+)\n\ndiff --git a/builtin/fast-export.c b/builtin/fast-export.c\nindex 7f314f0..9b728ca 100644\n--- a/builtin/fast-export.c\n+++ b/builtin/fast-export.c\n@@ -665,6 +665,19 @@ static void import_marks(char *input_file)\n \tfclose(f);\n }\n \n+static void handle_deletes(void)\n+{\n+\tint i;\n+\tfor (i = 0; i < refspecs_nr; i++) {\n+\t\tstruct refspec *refspec = &refspecs[i];\n+\t\tif (*refspec->src)\n+\t\t\tcontinue;\n+\n+\t\tprintf(\"reset %s\\nfrom %s\\n\\n\",\n+\t\t\trefspec->dst, sha1_to_hex(null_sha1));\n+\t}\n+}\n+\n int cmd_fast_export(int argc, const char **argv, const char *prefix)\n {\n \tstruct rev_info revs;\n@@ -755,6 +768,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)\n \t}\n \n \thandle_tags_and_duplicates(&extra_refs);\n+\thandle_deletes();\n \n \tif (export_filename && lastimportid != last_idnum)\n \t\texport_marks(export_filename);\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex dc6666f..ea6c96c 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -511,4 +511,15 @@ test_expect_success 'use refspec' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'delete refspec' '\n+\tgit branch to-delete &&\n+\tgit fast-export --refspec :refs/heads/to-delete to-delete ^to-delete > actual &&\n+\tcat > expected <<-EOF &&\n+\treset refs/heads/to-delete\n+\tfrom 0000000000000000000000000000000000000000\n+\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.4-fc\n"},{"id":"226176","messageId":"1377789808-2213-9-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 8/9] transport-helper: add support to delete branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:27Z","receivedAt":"2013-08-29T15:23:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"For remote-helpers that use 'export' to push.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t5801-remote-helpers.sh |  8 ++++++++\n transport-helper.c        | 11 ++++++-----\n 2 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8e2dd9f..a66a4e3 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -94,6 +94,14 @@ test_expect_success 'push new branch with old:new refspec' '\n \tcompare_refs local HEAD server refs/heads/new-refspec\n '\n \n+test_expect_success 'push delete branch' '\n+\t(cd local &&\n+\t git push origin :new-name\n+\t) &&\n+\ttest_must_fail git --git-dir=\"server/.git\" \\\n+\t rev-parse --verify refs/heads/new-name\n+'\n+\n test_expect_success 'cloning without refspec' '\n \tGIT_REMOTE_TESTGIT_REFSPEC=\"\" \\\n \tgit clone \"testgit::${PWD}/server\" local2 2>error &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex c7135ef..5490796 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport *transport,\n \t\t}\n \t\tfree(private);\n \n-\t\tif (ref->deletion)\n-\t\t\tdie(\"remote-helpers do not support ref deletion\");\n-\n \t\tif (ref->peer_ref) {\n \t\t\tif (strcmp(ref->name, ref->peer_ref->name)) {\n \t\t\t\tstruct strbuf buf = STRBUF_INIT;\n-\t\t\t\tstrbuf_addf(&buf, \"%s:%s\", ref->peer_ref->name, ref->name);\n+\t\t\t\tif (!ref->deletion)\n+\t\t\t\t\tstrbuf_addf(&buf, \"%s:%s\", ref->peer_ref->name, ref->name);\n+\t\t\t\telse\n+\t\t\t\t\tstrbuf_addf(&buf, \":%s\", ref->name);\n \t\t\t\tstring_list_append(&revlist_args, \"--refspec\");\n \t\t\t\tstring_list_append(&revlist_args, buf.buf);\n \t\t\t\tstrbuf_release(&buf);\n \t\t\t}\n-\t\t\tstring_list_append(&revlist_args, ref->peer_ref->name);\n+\t\t\tif (!ref->deletion)\n+\t\t\t\tstring_list_append(&revlist_args, ref->peer_ref->name);\n \t\t}\n \t}\n \n-- \n1.8.4-fc\n"},{"id":"226177","messageId":"1377789808-2213-10-git-send-email-felipe.contreras@gmail.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 9/9] transport-helper: don't update refs in dry-run","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T15:23:28Z","receivedAt":"2013-08-29T15:23:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The remote helper namespace should not be updated.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n transport-helper.c | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 5490796..9bbf209 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -715,7 +715,8 @@ static int push_update_ref_status(struct strbuf *buf,\n }\n \n static void push_update_refs_status(struct helper_data *data,\n-\t\t\t\t    struct ref *remote_refs)\n+\t\t\t\t    struct ref *remote_refs,\n+\t\t\t\t    int flags)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \tstruct ref *ref = remote_refs;\n@@ -729,7 +730,7 @@ static void push_update_refs_status(struct helper_data *data,\n \t\tif (push_update_ref_status(&buf, &ref, remote_refs))\n \t\t\tcontinue;\n \n-\t\tif (!data->refspecs)\n+\t\tif (flags & TRANSPORT_PUSH_DRY_RUN || !data->refspecs)\n \t\t\tcontinue;\n \n \t\t/* propagate back the update to the remote namespace */\n@@ -799,7 +800,7 @@ static int push_refs_with_push(struct transport *transport,\n \tsendline(data, &buf);\n \tstrbuf_release(&buf);\n \n-\tpush_update_refs_status(data, remote_refs);\n+\tpush_update_refs_status(data, remote_refs, flags);\n \treturn 0;\n }\n \n@@ -867,7 +868,7 @@ static int push_refs_with_export(struct transport *transport,\n \n \tif (finish_command(&exporter))\n \t\tdie(\"Error while running fast-export\");\n-\tpush_update_refs_status(data, remote_refs);\n+\tpush_update_refs_status(data, remote_refs, flags);\n \treturn 0;\n }\n \n-- \n1.8.4-fc\n"},{"id":"226248","messageId":"xmqqwqn42tgb.fsf@gitster.dls.corp.google.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 0/9] transport-helper: updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T19:22:12Z","receivedAt":"2013-08-29T19:22:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> Some of these were were sent before and rejected without a\n> reason,...\n\nEarlier, you were asked to leave because many constructive criticism\nor suggestion for improvement to your patches in reviews led to\nstubborn resistance, ended up wasting everybody's time and left a\nbad atmosphere on the list.\n\nIt seems that Matthew is trying to see if you can work better with\nothers than before after a break, but I personally am not hopeful\nyet and do not want to waste my/our time on flamewars like we saw in\nthe past.\n\nSo I'll look at these and may pick patches that are obviously and\ntrivially good, but will refrain from asking clarifications and\nsuggesting improvements, etc. on other patches that I suspect will\nend up wasting the time of people again.  Do not take silence from\nme as a silent agreement.\n"},{"id":"226249","messageId":"CAMP44s2jG8aD66uhiB9a0HYGro1p7yHkMJ4+XmzQD+a6f42QhA@mail.gmail.com","threadId":"34799","inReplyTo":"xmqqwqn42tgb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 0/9] transport-helper: updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T19:26:40Z","receivedAt":"2013-08-29T19:26:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Aug 29, 2013 at 2:22 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> Some of these were were sent before and rejected without a\n>> reason,...\n>\n> Earlier, you were asked to leave because many constructive criticism\n> or suggestion for improvement to your patches in reviews led to\n> stubborn resistance, ended up wasting everybody's time and left a\n> bad atmosphere on the list.\n>\n> It seems that Matthew is trying to see if you can work better with\n> others than before after a break, but I personally am not hopeful\n> yet and do not want to waste my/our time on flamewars like we saw in\n> the past.\n>\n> So I'll look at these and may pick patches that are obviously and\n> trivially good, but will refrain from asking clarifications and\n> suggesting improvements, etc. on other patches that I suspect will\n> end up wasting the time of people again.  Do not take silence from\n> me as a silent agreement.\n\nIf you do not pick these patches, the only one that looses is the Git\nproject and its users.\n\n-- \nFelipe Contreras\n"},{"id":"228042","messageId":"523F9E34.8030805@bbn.com","threadId":"34799","inReplyTo":"1377789808-2213-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 0/9] transport-helper: updates","fromName":"Richard Hansen","fromEmail":"rhansen@bbn.com","sentAt":"2013-09-23T01:49:40Z","receivedAt":"2013-09-23T01:49:40Z","isPatch":true,"sender":{"key":"rhansen@rhansen.org","avatar":null},"body":"On 2013-08-29 11:23, Felipe Contreras wrote:\n> Here are the patches that allow transport helpers to be completely transparent;\n> renaming branches, deleting them, custom refspecs, --force, --dry-run,\n> reporting forced update, everything works.\n\nWhat is the status of these patches?\n\nI would like to be able to 'git push old:new' and 'git push -f' to a\nbzr repo, and these are a prerequisite.  I imagine changes to\ngit-remote-bzr will also be required; I'm willing write up such\nchanges to git-remote-bzr, but only if there's interest in picking up\nthis patch series.\n\nThanks,\nRichard\n"},{"id":"228043","messageId":"523F9E79.8070602@bbn.com","threadId":"34799","inReplyTo":"1377789808-2213-9-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 8/9] transport-helper: add support to delete branches","fromName":"Richard Hansen","fromEmail":"rhansen@bbn.com","sentAt":"2013-09-23T01:50:49Z","receivedAt":"2013-09-23T01:50:49Z","isPatch":true,"sender":{"key":"rhansen@rhansen.org","avatar":null},"body":"On 2013-08-29 11:23, Felipe Contreras wrote:\n> For remote-helpers that use 'export' to push.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  t/t5801-remote-helpers.sh |  8 ++++++++\n>  transport-helper.c        | 11 ++++++-----\n>  2 files changed, 14 insertions(+), 5 deletions(-)\n> \n[...]\n> diff --git a/transport-helper.c b/transport-helper.c\n> index c7135ef..5490796 100644\n> --- a/transport-helper.c\n> +++ b/transport-helper.c\n> @@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport *transport,\n>  \t\t}\n>  \t\tfree(private);\n>  \n> -\t\tif (ref->deletion)\n> -\t\t\tdie(\"remote-helpers do not support ref deletion\");\n> -\n\nThe above deleted lines actually appear twice in transport-helper.c due\nto an incorrect merge conflict resolution in\n99d9ec090677c925c534001f01cbaf303a31cb82.  The other copy of those lines should\nalso be deleted:\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 859131f..bbf4e7c 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -874,9 +874,6 @@ static int push_refs_with_export(struct transport *transport,\n \t\tchar *private;\n \t\tunsigned char sha1[20];\n\n-\t\tif (ref->deletion)\n-\t\t\tdie(\"remote-helpers do not support ref deletion\");\n-\n \t\tprivate = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);\n \t\tif (private && !get_sha1(private, sha1)) {\n \t\t\tstrbuf_addf(&buf, \"^%s\", private);\n"},{"id":"228044","messageId":"523FA07C.9040909@bbn.com","threadId":"34799","inReplyTo":"1377789808-2213-5-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 4/9] fast-export: add new --refspec option","fromName":"Richard Hansen","fromEmail":"rhansen@bbn.com","sentAt":"2013-09-23T01:59:24Z","receivedAt":"2013-09-23T01:59:24Z","isPatch":true,"sender":{"key":"rhansen@rhansen.org","avatar":null},"body":"On 2013-08-29 11:23, Felipe Contreras wrote:\n> So that we can covert the exported ref names.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  Documentation/git-fast-export.txt |  4 ++++\n>  builtin/fast-export.c             | 30 ++++++++++++++++++++++++++++++\n>  t/t9350-fast-export.sh            |  7 +++++++\n>  3 files changed, 41 insertions(+)\n> \n> diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\n> index 85f1f30..221506b 100644\n> --- a/Documentation/git-fast-export.txt\n> +++ b/Documentation/git-fast-export.txt\n> @@ -105,6 +105,10 @@ marks the same across runs.\n>  \tin the commit (as opposed to just listing the files which are\n>  \tdifferent from the commit's first parent).\n>  \n> +--refspec::\n> +\tApply the specified refspec to each ref exported. Multiple of them can\n> +\tbe specified.\n> +\n\nDo you mean '--refspec=<refspec>' and/or '--refspec <refspec>'?\n\nHow are the multiple refspecs specified?  Space/comma/colon separated\nlist?  Or multiple '--refspec' arguments with one refspec per '--refspec'?\n\n> diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\n> index 34c2d8f..dc6666f 100755\n> --- a/t/t9350-fast-export.sh\n> +++ b/t/t9350-fast-export.sh\n> @@ -504,4 +504,11 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> +test_expect_success 'use refspec' '\n> +\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n> +\t\tgrep \"^commit \" | sort | uniq > actual &&\n> +\techo \"commit refs/heads/foobar\" > expected &&\n> +\ttest_cmp expected actual\n> +'\n> +\n>  test_done\n> \n\nI think it'd be good to add a test for multiple refspecs.\n\n-Richard\n"},{"id":"228045","messageId":"523fa84970494_57ae47e7441217@nysa.mail","threadId":"34799","inReplyTo":"523F9E34.8030805@bbn.com","subject":"Re: [PATCH 0/9] transport-helper: updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-23T02:32:41Z","receivedAt":"2013-09-23T02:32:41Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Richard Hansen wrote:\n> On 2013-08-29 11:23, Felipe Contreras wrote:\n> > Here are the patches that allow transport helpers to be completely transparent;\n> > renaming branches, deleting them, custom refspecs, --force, --dry-run,\n> > reporting forced update, everything works.\n> \n> What is the status of these patches?\n\nAsk Junio. All the valid feedback has been addressed, there's no reason not to\napply them.\n\n> I would like to be able to 'git push old:new' and 'git push -f' to a\n> bzr repo, and these are a prerequisite.  I imagine changes to\n> git-remote-bzr will also be required; I'm willing write up such\n> changes to git-remote-bzr, but only if there's interest in picking up\n> this patch series.\n\nThere's no need to modify git-remote-bzr, if theese patches are applied,\nold:new would work for all remote-helpers.\n\n-- \nFelipe Contreras\n"},{"id":"228046","messageId":"523fa8aca96e2_57ae47e74413df@nysa.mail","threadId":"34799","inReplyTo":"523F9E79.8070602@bbn.com","subject":"Re: [PATCH 8/9] transport-helper: add support to delete branches","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-23T02:34:20Z","receivedAt":"2013-09-23T02:34:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Richard Hansen wrote:\n> On 2013-08-29 11:23, Felipe Contreras wrote:\n> > For remote-helpers that use 'export' to push.\n> > \n> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> > ---\n> >  t/t5801-remote-helpers.sh |  8 ++++++++\n> >  transport-helper.c        | 11 ++++++-----\n> >  2 files changed, 14 insertions(+), 5 deletions(-)\n> > \n> [...]\n> > diff --git a/transport-helper.c b/transport-helper.c\n> > index c7135ef..5490796 100644\n> > --- a/transport-helper.c\n> > +++ b/transport-helper.c\n> > @@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport *transport,\n> >  \t\t}\n> >  \t\tfree(private);\n> >  \n> > -\t\tif (ref->deletion)\n> > -\t\t\tdie(\"remote-helpers do not support ref deletion\");\n> > -\n> \n> The above deleted lines actually appear twice in transport-helper.c due\n> to an incorrect merge conflict resolution in\n> 99d9ec090677c925c534001f01cbaf303a31cb82.  The other copy of those lines should\n> also be deleted:\n> \n> diff --git a/transport-helper.c b/transport-helper.c\n> index 859131f..bbf4e7c 100644\n> --- a/transport-helper.c\n> +++ b/transport-helper.c\n> @@ -874,9 +874,6 @@ static int push_refs_with_export(struct transport *transport,\n>  \t\tchar *private;\n>  \t\tunsigned char sha1[20];\n> \n> -\t\tif (ref->deletion)\n> -\t\t\tdie(\"remote-helpers do not support ref deletion\");\n> -\n>  \t\tprivate = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);\n>  \t\tif (private && !get_sha1(private, sha1)) {\n>  \t\t\tstrbuf_addf(&buf, \"^%s\", private);\n\nRight.\n\n-- \nFelipe Contreras\n"},{"id":"228048","messageId":"523fa8de6a048_57ae47e7441437@nysa.mail","threadId":"34799","inReplyTo":"523FA07C.9040909@bbn.com","subject":"Re: [PATCH 4/9] fast-export: add new --refspec option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-23T02:35:10Z","receivedAt":"2013-09-23T02:35:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Richard Hansen wrote:\n> On 2013-08-29 11:23, Felipe Contreras wrote:\n> > So that we can covert the exported ref names.\n> > \n> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> > ---\n> >  Documentation/git-fast-export.txt |  4 ++++\n> >  builtin/fast-export.c             | 30 ++++++++++++++++++++++++++++++\n> >  t/t9350-fast-export.sh            |  7 +++++++\n> >  3 files changed, 41 insertions(+)\n> > \n> > diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\n> > index 85f1f30..221506b 100644\n> > --- a/Documentation/git-fast-export.txt\n> > +++ b/Documentation/git-fast-export.txt\n> > @@ -105,6 +105,10 @@ marks the same across runs.\n> >  \tin the commit (as opposed to just listing the files which are\n> >  \tdifferent from the commit's first parent).\n> >  \n> > +--refspec::\n> > +\tApply the specified refspec to each ref exported. Multiple of them can\n> > +\tbe specified.\n> > +\n> \n> Do you mean '--refspec=<refspec>' and/or '--refspec <refspec>'?\n\nI mean --refspec refspec1 --refspec refspec2.\n\n> > diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\n> > index 34c2d8f..dc6666f 100755\n> > --- a/t/t9350-fast-export.sh\n> > +++ b/t/t9350-fast-export.sh\n> > @@ -504,4 +504,11 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n> >  \ttest_cmp expected actual\n> >  '\n> >  \n> > +test_expect_success 'use refspec' '\n> > +\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n> > +\t\tgrep \"^commit \" | sort | uniq > actual &&\n> > +\techo \"commit refs/heads/foobar\" > expected &&\n> > +\ttest_cmp expected actual\n> > +'\n> > +\n> >  test_done\n> > \n> \n> I think it'd be good to add a test for multiple refspecs.\n\nMaybe. If these patches were to actually be applied.\n\n-- \nFelipe Contreras\n"},{"id":"228049","messageId":"523fa9df8ed1b_5c910e3e801fa@nysa.mail","threadId":"34799","inReplyTo":"523FAA59.6040200@bbn.com","subject":"Re: [PATCH 1/9] transport-helper: add 'force' to 'export' helpers","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-23T02:39:27Z","receivedAt":"2013-09-23T02:39:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Richard Hansen wrote:\n> On 2013-08-29 11:23, Felipe Contreras wrote:\n> > Otherwise they cannot know when to force the push or not (other than\n> > hacks).\n> > \n> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> > ---\n> >  transport-helper.c | 3 +++\n> >  1 file changed, 3 insertions(+)\n> > \n> > diff --git a/transport-helper.c b/transport-helper.c\n> > index 63cabc3..62051a6 100644\n> > --- a/transport-helper.c\n> > +++ b/transport-helper.c\n> > @@ -814,6 +814,9 @@ static int push_refs_with_export(struct transport *transport,\n> >  \t\t\tdie(\"helper %s does not support dry-run\", data->name);\n> >  \t}\n> >  \n> > +\tif (flags & TRANSPORT_PUSH_FORCE)\n> > +\t\tset_helper_option(transport, \"force\", \"true\");\n> \n> Should the return value of set_helper_option() be checked?\n\nYeah, it would make sense. I guess we want to die() if the user does\n'git push -f' and the remote helper doesn't support that.\n\n> Also, should there be a #define TRANS_OPT_FORCE \"force\" with\n\nI don't see the point of that. Defines are useful when you want to change the\nvalue string, so you don't have to change the string everywhere, but we\ndefinitely don't want to do that, as that would break backwards compatibility,\nso TRANS_OPT_KEEP would always be \"keep\" so it's just a way to tire our\nfingers.\n\n> TRANS_OPT_FORCE added to boolean_options[]?\n\nI don't see how that would help us, the only thing that would achieve is to map:\n\n\n  set_helper_option(transport, \"force\", 1);\n\nto\n\n  set_helper_option(transport, \"force\", \"true\");\n\nBut we are already doing that.\n\nMoreover, the code is already doing something similar for all the other options.\n\n  set_helper_option(t, \"progress\", t->progress ? \"true\" : \"false\");\n  set_helper_option(t, \"verbosity\", buf);\n  set_helper_option(transport, \"servpath\", exec);\n  set_helper_option(transport, \"dry-run\", \"true\");\n\n-- \nFelipe Contreras\n"},{"id":"228047","messageId":"523FAA59.6040200@bbn.com","threadId":"34799","inReplyTo":"1377789808-2213-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/9] transport-helper: add 'force' to 'export' helpers","fromName":"Richard Hansen","fromEmail":"rhansen@bbn.com","sentAt":"2013-09-23T02:41:29Z","receivedAt":"2013-09-23T02:41:29Z","isPatch":true,"sender":{"key":"rhansen@rhansen.org","avatar":null},"body":"On 2013-08-29 11:23, Felipe Contreras wrote:\n> Otherwise they cannot know when to force the push or not (other than\n> hacks).\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  transport-helper.c | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/transport-helper.c b/transport-helper.c\n> index 63cabc3..62051a6 100644\n> --- a/transport-helper.c\n> +++ b/transport-helper.c\n> @@ -814,6 +814,9 @@ static int push_refs_with_export(struct transport *transport,\n>  \t\t\tdie(\"helper %s does not support dry-run\", data->name);\n>  \t}\n>  \n> +\tif (flags & TRANSPORT_PUSH_FORCE)\n> +\t\tset_helper_option(transport, \"force\", \"true\");\n\nShould the return value of set_helper_option() be checked?\n\nAlso, should there be a #define TRANS_OPT_FORCE \"force\" with\nTRANS_OPT_FORCE added to boolean_options[]?\n\nThanks,\nRichard\n"}]}