{"thread":{"id":"39586","subject":"[PATCH v2 1/7] bisect : correction of typo","startedAt":"2015-06-10T16:24:26Z","lastAt":"2015-06-22T13:47:34Z","messageCount":9,"participants":["Antoine Delaite","Junio C Hamano","Matthieu Moy","Louis-Alexandre Stuber"],"isPatch":true,"patchVersion":2,"patchTotal":7},"messages":[{"id":"263497","messageId":"1433953472-32572-1-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":null,"subject":"[PATCH v2 1/7] bisect : correction of typo","fromName":"Antoine Delaite","fromEmail":"antoine.delaite@ensimag.grenoble-inp.fr","sentAt":"2015-06-10T16:24:26Z","receivedAt":"2015-06-10T16:24:26Z","isPatch":true,"sender":{"key":"antoine.delaite@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12510393?v=4"},"body":"\nSigned-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>\n---\n bisect.c                    |    2 +-\n t/t6030-bisect-porcelain.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 10f5e57..de92953 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -743,7 +743,7 @@ static void handle_bad_merge_base(void)\n \n \tfprintf(stderr, \"Some good revs are not ancestor of the bad rev.\\n\"\n \t\t\"git bisect cannot work properly in this case.\\n\"\n-\t\t\"Maybe you mistake good and bad revs?\\n\");\n+\t\t\"Maybe you mistook good and bad revs?\\n\");\n \texit(1);\n }\n \ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 06b4868..9e2c203 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -362,7 +362,7 @@ test_expect_success 'bisect starting with a detached HEAD' '\n test_expect_success 'bisect errors out if bad and good are mistaken' '\n \tgit bisect reset &&\n \ttest_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&\n-\tgrep \"mistake good and bad\" rev_list_error &&\n+\tgrep \"mistook good and bad\" rev_list_error &&\n \tgit bisect reset\n '\n \n-- \n1.7.1\n"},{"id":"263498","messageId":"1433953472-32572-2-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":"1433953472-32572-1-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","subject":"[PATCH v2 2/7] bisect: replace hardcoded \"bad|good\" by variables","fromName":"Antoine Delaite","fromEmail":"antoine.delaite@ensimag.grenoble-inp.fr","sentAt":"2015-06-10T16:24:27Z","receivedAt":"2015-06-10T16:24:27Z","isPatch":true,"sender":{"key":"antoine.delaite@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12510393?v=4"},"body":"To add new tags like old/new and have keywords less confusing, the\nfirst step is to avoid hardcoding the keywords.\n\nThe default mode is still bad/good.\n\nSigned-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>\nSigned-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>\nSigned-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr>\nSigned-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr>\nSigned-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>\nSigned-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr>\nSigned-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\n bisect.c      |   49 ++++++++++++++++++++++++++++++++-----------------\n git-bisect.sh |   57 +++++++++++++++++++++++++++++++--------------------------\n 2 files changed, 63 insertions(+), 43 deletions(-)\n mode change 100755 => 100644 git-bisect.sh\n\ndiff --git a/bisect.c b/bisect.c\nindex de92953..eb2f555 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -21,6 +21,9 @@ static const char *argv_checkout[] = {\"checkout\", \"-q\", NULL, \"--\", NULL};\n static const char *argv_show_branch[] = {\"show-branch\", NULL, NULL};\n static const char *argv_update_ref[] = {\"update-ref\", \"--no-deref\", \"BISECT_HEAD\", NULL, NULL};\n \n+static const char *name_bad;\n+static const char *name_good;\n+\n /* Remember to update object flag allocation in object.h */\n #define COUNTED\t\t(1u<<16)\n \n@@ -403,10 +406,14 @@ struct commit_list *find_bisection(struct commit_list *list,\n static int register_ref(const char *refname, const unsigned char *sha1,\n \t\t\tint flags, void *cb_data)\n {\n-\tif (!strcmp(refname, \"bad\")) {\n+\tchar good_prefix[256];\n+\tstrcpy(good_prefix, name_good);\n+\tstrcat(good_prefix, \"-\");\n+\n+\tif (!strcmp(refname, name_bad)) {\n \t\tcurrent_bad_oid = xmalloc(sizeof(*current_bad_oid));\n \t\thashcpy(current_bad_oid->hash, sha1);\n-\t} else if (starts_with(refname, \"good-\")) {\n+\t} else if (starts_with(refname, good_prefix)) {\n \t\tsha1_array_append(&good_revs, sha1);\n \t} else if (starts_with(refname, \"skip-\")) {\n \t\tsha1_array_append(&skipped_revs, sha1);\n@@ -634,7 +641,7 @@ static void exit_if_skipped_commits(struct commit_list *tried,\n \t\treturn;\n \n \tprintf(\"There are only 'skip'ped commits left to test.\\n\"\n-\t       \"The first bad commit could be any of:\\n\");\n+\t       \"The first %s commit could be any of:\\n\", name_bad);\n \tprint_commit_list(tried, \"%s\\n\", \"%s\\n\");\n \tif (bad)\n \t\tprintf(\"%s\\n\", oid_to_hex(bad));\n@@ -732,18 +739,21 @@ static void handle_bad_merge_base(void)\n \tif (is_expected_rev(current_bad_oid)) {\n \t\tchar *bad_hex = oid_to_hex(current_bad_oid);\n \t\tchar *good_hex = join_sha1_array_hex(&good_revs, ' ');\n-\n-\t\tfprintf(stderr, \"The merge base %s is bad.\\n\"\n-\t\t\t\"This means the bug has been fixed \"\n-\t\t\t\"between %s and [%s].\\n\",\n-\t\t\tbad_hex, bad_hex, good_hex);\n-\n+\t\tif (!strcmp(name_bad, \"bad\")) {\n+\t\t\tfprintf(stderr, \"The merge base %s is bad.\\n\"\n+\t\t\t\t\"This means the bug has been fixed \"\n+\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\tbad_hex, bad_hex, good_hex);\n+\t\t} else {\n+\t\t\tdie(\"BUG: terms %s/%s not managed\", name_bad, name_good);\n+\t\t}\n \t\texit(3);\n \t}\n \n-\tfprintf(stderr, \"Some good revs are not ancestor of the bad rev.\\n\"\n+\tfprintf(stderr, \"Some %s revs are not ancestor of the %s rev.\\n\"\n \t\t\"git bisect cannot work properly in this case.\\n\"\n-\t\t\"Maybe you mistook good and bad revs?\\n\");\n+\t\t\"Maybe you mistook %s and %s revs?\\n\",\n+\t\tname_good, name_bad, name_good, name_bad);\n \texit(1);\n }\n \n@@ -755,10 +765,10 @@ static void handle_skipped_merge_base(const unsigned char *mb)\n \n \twarning(\"the merge base between %s and [%s] \"\n \t\t\"must be skipped.\\n\"\n-\t\t\"So we cannot be sure the first bad commit is \"\n+\t\t\"So we cannot be sure the first %s commit is \"\n \t\t\"between %s and %s.\\n\"\n \t\t\"We continue anyway.\",\n-\t\tbad_hex, good_hex, mb_hex, bad_hex);\n+\t\tbad_hex, good_hex, name_bad, mb_hex, bad_hex);\n \tfree(good_hex);\n }\n \n@@ -839,7 +849,7 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)\n \tint fd;\n \n \tif (!current_bad_oid)\n-\t\tdie(\"a bad revision is needed\");\n+\t\tdie(\"a %s revision is needed\", name_bad);\n \n \t/* Check if file BISECT_ANCESTORS_OK exists. */\n \tif (!stat(filename, &st) && S_ISREG(st.st_mode))\n@@ -905,6 +915,8 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \tconst unsigned char *bisect_rev;\n \tchar bisect_rev_hex[GIT_SHA1_HEXSZ + 1];\n \n+\tname_bad=\"bad\";\n+\tname_good=\"good\";\n \tif (read_bisect_refs())\n \t\tdie(\"reading bisect refs failed\");\n \n@@ -926,8 +938,10 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \t\t */\n \t\texit_if_skipped_commits(tried, NULL);\n \n-\t\tprintf(\"%s was both good and bad\\n\",\n-\t\t       oid_to_hex(current_bad_oid));\n+\t\tprintf(\"%s was both %s and %s\\n\",\n+\t\t       oid_to_hex(current_bad_oid),\n+\t\t       name_good,\n+\t\t       name_bad);\n \t\texit(1);\n \t}\n \n@@ -942,7 +956,8 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \n \tif (!hashcmp(bisect_rev, current_bad_oid->hash)) {\n \t\texit_if_skipped_commits(tried, current_bad_oid);\n-\t\tprintf(\"%s is the first bad commit\\n\", bisect_rev_hex);\n+\t\tprintf(\"%s is the first %s commit\\n\", bisect_rev_hex,\n+\t\t\tname_bad);\n \t\tshow_diff_tree(prefix, revs.commits->item);\n \t\t/* This means the bisection process succeeded. */\n \t\texit(10);\ndiff --git a/git-bisect.sh b/git-bisect.sh\nold mode 100755\nnew mode 100644\nindex ae3fec2..ce6412f\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -32,6 +32,8 @@ OPTIONS_SPEC=\n \n _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\n+NAME_BAD=bad\n+NAME_GOOD=good\n \n bisect_head()\n {\n@@ -100,8 +102,8 @@ bisect_start() {\n \t\t\t\tbreak\n \t\t\t}\n \t\t\tcase $bad_seen in\n-\t\t\t0) state='bad' ; bad_seen=1 ;;\n-\t\t\t*) state='good' ;;\n+\t\t\t0) state=$NAME_BAD ; bad_seen=1 ;;\n+\t\t\t*) state=$NAME_GOOD ;;\n \t\t\tesac\n \t\t\teval=\"$eval bisect_write '$state' '$rev' 'nolog' &&\"\n \t\t\tshift\n@@ -184,9 +186,12 @@ bisect_write() {\n \trev=\"$2\"\n \tnolog=\"$3\"\n \tcase \"$state\" in\n-\t\tbad)\t\ttag=\"$state\" ;;\n-\t\tgood|skip)\ttag=\"$state\"-\"$rev\" ;;\n-\t\t*)\t\tdie \"$(eval_gettext \"Bad bisect_write argument: \\$state\")\" ;;\n+\t\t\"$NAME_BAD\")\n+\t\t\ttag=\"$state\" ;;\n+\t\t\"$NAME_GOOD\"|skip)\n+\t\t\ttag=\"$state\"-\"$rev\" ;;\n+\t\t*)\n+\t\t\tdie \"$(eval_gettext \"Bad bisect_write argument: \\$state\")\" ;;\n \tesac\n \tgit update-ref \"refs/bisect/$tag\" \"$rev\" || exit\n \techo \"# $state: $(git show-branch $rev)\" >>\"$GIT_DIR/BISECT_LOG\"\n@@ -230,12 +235,12 @@ bisect_state() {\n \tcase \"$#,$state\" in\n \t0,*)\n \t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n-\t1,bad|1,good|1,skip)\n+\t1,\"$NAME_BAD\"|1,\"$NAME_GOOD\"|1,skip)\n \t\trev=$(git rev-parse --verify $(bisect_head)) ||\n \t\t\tdie \"$(gettext \"Bad rev input: $(bisect_head)\")\"\n \t\tbisect_write \"$state\" \"$rev\"\n \t\tcheck_expected_revs \"$rev\" ;;\n-\t2,bad|*,good|*,skip)\n+\t2,\"$NAME_BAD\"|*,\"$NAME_GOOD\"|*,skip)\n \t\tshift\n \t\thash_list=''\n \t\tfor rev in \"$@\"\n@@ -249,8 +254,8 @@ bisect_state() {\n \t\t\tbisect_write \"$state\" \"$rev\"\n \t\tdone\n \t\tcheck_expected_revs $hash_list ;;\n-\t*,bad)\n-\t\tdie \"$(gettext \"'git bisect bad' can take only one argument.\")\" ;;\n+\t*,\"$NAME_BAD\")\n+\t\tdie \"$(eval_gettext \"'git bisect \\$NAME_BAD' can take only one argument.\")\" ;;\n \t*)\n \t\tusage ;;\n \tesac\n@@ -259,21 +264,21 @@ bisect_state() {\n \n bisect_next_check() {\n \tmissing_good= missing_bad=\n-\tgit show-ref -q --verify refs/bisect/bad || missing_bad=t\n-\ttest -n \"$(git for-each-ref \"refs/bisect/good-*\")\" || missing_good=t\n+\tgit show-ref -q --verify refs/bisect/$NAME_BAD || missing_bad=t\n+\ttest -n \"$(git for-each-ref \"refs/bisect/$NAME_GOOD-*\")\" || missing_good=t\n \n \tcase \"$missing_good,$missing_bad,$1\" in\n \t,,*)\n-\t\t: have both good and bad - ok\n+\t\t: have both $NAME_GOOD and $NAME_BAD - ok\n \t\t;;\n \t*,)\n \t\t# do not have both but not asked to fail - just report.\n \t\tfalse\n \t\t;;\n-\tt,,good)\n+\tt,,\"$NAME_GOOD\")\n \t\t# have bad but not good.  we could bisect although\n \t\t# this is less optimum.\n-\t\tgettextln \"Warning: bisecting only with a bad commit.\" >&2\n+\t\teval_gettextln \"Warning: bisecting only with a \\$NAME_BAD commit.\" >&2\n \t\tif test -t 0\n \t\tthen\n \t\t\t# TRANSLATORS: Make sure to include [Y] and [n] in your\n@@ -283,7 +288,7 @@ bisect_next_check() {\n \t\t\tread yesno\n \t\t\tcase \"$yesno\" in [Nn]*) exit 1 ;; esac\n \t\tfi\n-\t\t: bisect without good...\n+\t\t: bisect without $NAME_GOOD...\n \t\t;;\n \t*)\n \n@@ -307,7 +312,7 @@ bisect_auto_next() {\n bisect_next() {\n \tcase \"$#\" in 0) ;; *) usage ;; esac\n \tbisect_autostart\n-\tbisect_next_check good\n+\tbisect_next_check $NAME_GOOD\n \n \t# Perform all bisection computation, display and checkout\n \tgit bisect--helper --next-all $(test -f \"$GIT_DIR/BISECT_HEAD\" && echo --no-checkout)\n@@ -316,18 +321,18 @@ bisect_next() {\n \t# Check if we should exit because bisection is finished\n \tif test $res -eq 10\n \tthen\n-\t\tbad_rev=$(git show-ref --hash --verify refs/bisect/bad)\n+\t\tbad_rev=$(git show-ref --hash --verify refs/bisect/$NAME_BAD)\n \t\tbad_commit=$(git show-branch $bad_rev)\n-\t\techo \"# first bad commit: $bad_commit\" >>\"$GIT_DIR/BISECT_LOG\"\n+\t\techo \"# first $NAME_BAD commit: $bad_commit\" >>\"$GIT_DIR/BISECT_LOG\"\n \t\texit 0\n \telif test $res -eq 2\n \tthen\n \t\techo \"# only skipped commits left to test\" >>\"$GIT_DIR/BISECT_LOG\"\n-\t\tgood_revs=$(git for-each-ref --format=\"%(objectname)\" \"refs/bisect/good-*\")\n-\t\tfor skipped in $(git rev-list refs/bisect/bad --not $good_revs)\n+\t\tgood_revs=$(git for-each-ref --format=\"%(objectname)\" \"refs/bisect/$NAME_GOOD-*\")\n+\t\tfor skipped in $(git rev-list refs/bisect/$NAME_BAD --not $good_revs)\n \t\tdo\n \t\t\tskipped_commit=$(git show-branch $skipped)\n-\t\t\techo \"# possible first bad commit: $skipped_commit\" >>\"$GIT_DIR/BISECT_LOG\"\n+\t\t\techo \"# possible first $NAME_BAD commit: $skipped_commit\" >>\"$GIT_DIR/BISECT_LOG\"\n \t\tdone\n \t\texit $res\n \tfi\n@@ -421,7 +426,7 @@ bisect_replay () {\n \t\tstart)\n \t\t\tcmd=\"bisect_start $rev\"\n \t\t\teval \"$cmd\" ;;\n-\t\tgood|bad|skip)\n+\t\t$NAME_GOOD|$NAME_BAD|skip)\n \t\t\tbisect_write \"$command\" \"$rev\" ;;\n \t\t*)\n \t\t\tdie \"$(gettext \"?? what are you talking about?\")\" ;;\n@@ -455,9 +460,9 @@ exit code \\$res from '\\$command' is < 0 or >= 128\" >&2\n \t\t\tstate='skip'\n \t\telif [ $res -gt 0 ]\n \t\tthen\n-\t\t\tstate='bad'\n+\t\t\tstate=\"$NAME_BAD\"\n \t\telse\n-\t\t\tstate='good'\n+\t\t\tstate=\"$NAME_GOOD\"\n \t\tfi\n \n \t\t# We have to use a subshell because \"bisect_state\" can exit.\n@@ -466,7 +471,7 @@ exit code \\$res from '\\$command' is < 0 or >= 128\" >&2\n \n \t\tcat \"$GIT_DIR/BISECT_RUN\"\n \n-\t\tif sane_grep \"first bad commit could be any of\" \"$GIT_DIR/BISECT_RUN\" \\\n+\t\tif sane_grep \"first $NAME_BAD commit could be any of\" \"$GIT_DIR/BISECT_RUN\" \\\n \t\t\t>/dev/null\n \t\tthen\n \t\t\tgettextln \"bisect run cannot continue any more\" >&2\n@@ -480,7 +485,7 @@ exit code \\$res from '\\$command' is < 0 or >= 128\" >&2\n \t\t\texit $res\n \t\tfi\n \n-\t\tif sane_grep \"is the first bad commit\" \"$GIT_DIR/BISECT_RUN\" >/dev/null\n+\t\tif sane_grep \"is the first $NAME_BAD commit\" \"$GIT_DIR/BISECT_RUN\" >/dev/null\n \t\tthen\n \t\t\tgettextln \"bisect run success\"\n \t\t\texit 0;\n-- \n1.7.1\n"},{"id":"263499","messageId":"1433953472-32572-3-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":"1433953472-32572-1-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","subject":"[PATCH v2 3/7] bisect: simplify the addition of new bisect terms","fromName":"Antoine Delaite","fromEmail":"antoine.delaite@ensimag.grenoble-inp.fr","sentAt":"2015-06-10T16:24:28Z","receivedAt":"2015-06-10T16:24:28Z","isPatch":true,"sender":{"key":"antoine.delaite@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12510393?v=4"},"body":"We create a file BISECT_TERMS in the repository .git to be read during a\nbisection. The fonctions to be changed if we add new terms are quite\nfew.\nIn git-bisect.sh :\n\tcheck_and_set_terms\n\tbisect_voc\nIn bisect.c :\n\thandle_bad_merge_base\n\nSigned-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>\nSigned-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>\nSigned-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr>\nSigned-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr>\nSigned-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>\nSigned-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr>\nSigned-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\n bisect.c      |   33 +++++++++++++++++++++++++--\n git-bisect.sh |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++-----\n 2 files changed, 90 insertions(+), 9 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex eb2f555..827d2f3 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -745,7 +745,10 @@ static void handle_bad_merge_base(void)\n \t\t\t\t\"between %s and [%s].\\n\",\n \t\t\t\tbad_hex, bad_hex, good_hex);\n \t\t} else {\n-\t\t\tdie(\"BUG: terms %s/%s not managed\", name_bad, name_good);\n+\t\t\tfprintf(stderr, \"The merge base %s is %s.\\n\"\n+\t\t\t\t\"This means the first commit marked %s is \"\n+\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\tbad_hex, name_bad, name_bad, bad_hex, good_hex);\n \t\t}\n \t\texit(3);\n \t}\n@@ -900,6 +903,31 @@ static void show_diff_tree(const char *prefix, struct commit *commit)\n }\n \n /*\n+ * The terms used for this bisect session are stored in\n+ * BISECT_TERMS: it can be bad/good or new/old.\n+ * We read them and store them to adapt the messages\n+ * accordingly. Default is bad/good.\n+ */\n+void read_bisect_terms(void)\n+{\n+\tstruct strbuf str = STRBUF_INIT;\n+\tconst char *filename = git_path(\"BISECT_TERMS\");\n+\tFILE *fp = fopen(filename, \"r\");\n+\n+\tif (!fp) {\n+\t\tdie(\"could not read file '%s': %s\", filename,\n+\t\t\tstrerror(errno));\n+\t} else {\n+\t\tstrbuf_getline(&str, fp, '\\n');\n+\t\tname_bad = strbuf_detach(&str, NULL);\n+\t\tstrbuf_getline(&str, fp, '\\n');\n+\t\tname_good = strbuf_detach(&str, NULL);\n+\t}\n+\tstrbuf_release(&str);\n+\tfclose(fp);\n+}\n+\n+/*\n  * We use the convention that exiting with an exit code 10 means that\n  * the bisection process finished successfully.\n  * In this case the calling shell script should exit 0.\n@@ -915,8 +943,7 @@ int bisect_next_all(const char *prefix, int no_checkout)\n \tconst unsigned char *bisect_rev;\n \tchar bisect_rev_hex[GIT_SHA1_HEXSZ + 1];\n \n-\tname_bad=\"bad\";\n-\tname_good=\"good\";\n+\tread_bisect_terms();\n \tif (read_bisect_refs())\n \t\tdie(\"reading bisect refs failed\");\n \ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex ce6412f..d63b4b0 100644\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -77,6 +77,9 @@ bisect_start() {\n \torig_args=$(git rev-parse --sq-quote \"$@\")\n \tbad_seen=0\n \teval=''\n+\t# start_bad_good is used to detect if we did a \n+\t# 'git bisect start bad_rev good_rev'\n+\tstart_bad_good=0\n \tif test \"z$(git rev-parse --is-bare-repository)\" != zfalse\n \tthen\n \t\tmode=--no-checkout\n@@ -101,6 +104,9 @@ bisect_start() {\n \t\t\t\tdie \"$(eval_gettext \"'\\$arg' does not appear to be a valid revision\")\"\n \t\t\t\tbreak\n \t\t\t}\n+\n+\t\t\tstart_bad_good=1\n+\n \t\t\tcase $bad_seen in\n \t\t\t0) state=$NAME_BAD ; bad_seen=1 ;;\n \t\t\t*) state=$NAME_GOOD ;;\n@@ -172,6 +178,11 @@ bisect_start() {\n \t} &&\n \tgit rev-parse --sq-quote \"$@\" >\"$GIT_DIR/BISECT_NAMES\" &&\n \teval \"$eval true\" &&\n+\tif test $start_bad_good -eq 1 && test ! -s \"$GIT_DIR/BISECT_TERMS\"\n+\tthen\n+\t\techo \"$NAME_BAD\" >\"$GIT_DIR/BISECT_TERMS\" &&\n+\t\techo \"$NAME_GOOD\" >>\"$GIT_DIR/BISECT_TERMS\"\n+\tfi &&\n \techo \"git bisect start$orig_args\" >>\"$GIT_DIR/BISECT_LOG\" || exit\n \t#\n \t# Check if we can proceed to the next bisect state.\n@@ -232,6 +243,7 @@ bisect_skip() {\n bisect_state() {\n \tbisect_autostart\n \tstate=$1\n+\tcheck_and_set_terms $state\n \tcase \"$#,$state\" in\n \t0,*)\n \t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n@@ -291,15 +303,17 @@ bisect_next_check() {\n \t\t: bisect without $NAME_GOOD...\n \t\t;;\n \t*)\n-\n+\t\tbad_syn=$(bisect_voc bad)\n+\t\tgood_syn=$(bisect_voc good)\n \t\tif test -s \"$GIT_DIR/BISECT_START\"\n \t\tthen\n-\t\t\tgettextln \"You need to give me at least one good and one bad revision.\n-(You can use \\\"git bisect bad\\\" and \\\"git bisect good\\\" for that.)\" >&2\n+\n+\t\t\teval_gettextln \"You need to give me at least one \\$bad_syn and one \\$good_syn revision.\n+(You can use \\\"git bisect \\$bad_syn\\\" and \\\"git bisect \\$good_syn\\\" for that.)\" >&2\n \t\telse\n-\t\t\tgettextln \"You need to start by \\\"git bisect start\\\".\n-You then need to give me at least one good and one bad revision.\n-(You can use \\\"git bisect bad\\\" and \\\"git bisect good\\\" for that.)\" >&2\n+\t\t\teval_gettextln \"You need to start by \\\"git bisect start\\\".\n+You then need to give me at least one \\$good_syn and one \\$bad_syn revision.\n+(You can use \\\"git bisect \\$bad_syn\\\" and \\\"git bisect \\$good_syn\\\" for that.)\" >&2\n \t\tfi\n \t\texit 1 ;;\n \tesac\n@@ -402,6 +416,7 @@ bisect_clean_state() {\n \trm -f \"$GIT_DIR/BISECT_LOG\" &&\n \trm -f \"$GIT_DIR/BISECT_NAMES\" &&\n \trm -f \"$GIT_DIR/BISECT_RUN\" &&\n+\trm -f \"$GIT_DIR/BISECT_TERMS\" &&\n \t# Cleanup head-name if it got left by an old version of git-bisect\n \trm -f \"$GIT_DIR/head-name\" &&\n \tgit update-ref -d --no-deref BISECT_HEAD &&\n@@ -422,6 +437,8 @@ bisect_replay () {\n \t\t\trev=\"$command\"\n \t\t\tcommand=\"$bisect\"\n \t\tfi\n+\t\tget_terms\n+\t\tcheck_and_set_terms \"$command\"\n \t\tcase \"$command\" in\n \t\tstart)\n \t\t\tcmd=\"bisect_start $rev\"\n@@ -499,11 +516,48 @@ bisect_log () {\n \tcat \"$GIT_DIR/BISECT_LOG\"\n }\n \n+get_terms () {\n+\tif test -s \"$GIT_DIR/BISECT_TERMS\"\n+\tthen\n+\t\tNAME_BAD=\"$(sed -n 1p \"$GIT_DIR/BISECT_TERMS\")\"\n+\t\tNAME_GOOD=\"$(sed -n 2p \"$GIT_DIR/BISECT_TERMS\")\"\n+\tfi\n+}\n+\n+check_and_set_terms () {\n+\tcmd=\"$1\"\n+\tcase \"$cmd\" in\n+\tbad|good)\n+\t\tif test -s \"$GIT_DIR/BISECT_TERMS\" && test \"$cmd\" != \"$NAME_BAD\" && test \"$cmd\" != \"$NAME_GOOD\"\n+\t\tthen\n+\t\t\tdie \"$(eval_gettext \"Invalid command: you're currently in a \\$NAME_BAD/\\$NAME_GOOD bisect.\")\"\n+\t\tfi\n+\t\tcase \"$cmd\" in\n+\t\tbad|good)\n+\t\t\tif ! test -s \"$GIT_DIR/BISECT_TERMS\"\n+\t\t\tthen\n+\t\t\t\techo \"bad\" >\"$GIT_DIR/BISECT_TERMS\" &&\n+\t\t\t\techo \"good\" >>\"$GIT_DIR/BISECT_TERMS\"\n+\t\t\tfi\n+\t\t\tNAME_BAD=\"bad\"\n+\t\t\tNAME_GOOD=\"good\" ;;\n+\t\tesac ;;\n+\tesac\n+}\n+\n+bisect_voc () {\n+\tcase \"$1\" in\n+\tbad) echo \"bad\" ;;\n+\tgood) echo \"good\" ;;\n+\tesac\n+}\n+\n case \"$#\" in\n 0)\n \tusage ;;\n *)\n \tcmd=\"$1\"\n+\tget_terms\n \tshift\n \tcase \"$cmd\" in\n \thelp)\n-- \n1.7.1\n"},{"id":"263500","messageId":"1433953472-32572-4-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":"1433953472-32572-1-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","subject":"[PATCH v2 4/7] bisect: add the terms old/new","fromName":"Antoine Delaite","fromEmail":"antoine.delaite@ensimag.grenoble-inp.fr","sentAt":"2015-06-10T16:24:29Z","receivedAt":"2015-06-10T16:24:29Z","isPatch":true,"sender":{"key":"antoine.delaite@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12510393?v=4"},"body":"When not looking for a regression during a bisect but for a fix or a\nchange in another given property, it can be confusing to use 'good'\nand 'bad'.\n\nThis patch introduce `git bisect new` and `git bisect old` as an\nalternative to 'bad' and good': the commits which have a certain\nproperty must be marked as `new` and the ones which do not as `old`.\n\nThe output will be the first commit after the change in the property.\nDuring a new/old bisect session you cannot use bad/good commands and\nvice-versa.\n\n`git bisect replay` works fine for old/new bisect sessions.\n\nSome commands are still not available for old/new:\n\n     * git bisect start [<new> [<old>...]] is not possible: the\n       commits will be treated as bad and good.\n     * git rev-list --bisect does not treat the revs/bisect/new and\n       revs/bisect/old-SHA1 files.\n     * git bisect visualize seem to work partially: the tags are\n       displayed correctly but the tree is not limited to the bisect\n       section.\n\nRelated discussions:\n\n\t- http://thread.gmane.org/gmane.comp.version-control.git/86063\n\t\tintroduced bisect fix unfixed to find fix.\n\t- http://thread.gmane.org/gmane.comp.version-control.git/182398\n\t\tdiscussion around bisect yes/no or old/new.\n\t- http://thread.gmane.org/gmane.comp.version-control.git/199758\n\t\tlast discussion and reviews\n\nSigned-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>\nSigned-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>\nSigned-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr>\nSigned-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr>\nSigned-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>\nSigned-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr>\nSigned-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n---\n Documentation/git-bisect.txt |   48 ++++++++++++++++++++++++++++++++++++++++-\n bisect.c                     |   11 +++++++--\n git-bisect.sh                |   30 +++++++++++++++++--------\n t/t6030-bisect-porcelain.sh  |   38 +++++++++++++++++++++++++++++++++\n 4 files changed, 112 insertions(+), 15 deletions(-)\n\ndiff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt\nindex 4cb52a7..3c3021a 100644\n--- a/Documentation/git-bisect.txt\n+++ b/Documentation/git-bisect.txt\n@@ -18,8 +18,8 @@ on the subcommand:\n \n  git bisect help\n  git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<paths>...]\n- git bisect bad [<rev>]\n- git bisect good [<rev>...]\n+ git bisect (bad|new) [<rev>]\n+ git bisect (good|old) [<rev>...]\n  git bisect skip [(<rev>|<range>)...]\n  git bisect reset [<commit>]\n  git bisect visualize\n@@ -104,6 +104,35 @@ For example, `git bisect reset HEAD` will leave you on the current\n bisection commit and avoid switching commits at all, while `git bisect\n reset bisect/bad` will check out the first bad revision.\n \n+\n+Alternative terms: bisect new and bisect old\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+If you are not at ease with the terms \"bad\" and \"good\", perhaps\n+because you are looking for the commit that introduced a fix, you can\n+alternatively use \"new\" and \"old\" instead.\n+But note that you cannot mix \"bad\" and good\" with \"new\" and \"old\".\n+\n+------------------------------------------------\n+git bisect new [<rev>]\n+------------------------------------------------\n+\n+Marks the commit as new, e.g. \"the bug is no longer there\", if you are looking\n+for a commit that fixed a bug, or \"the feature that used to work is now broken\n+at this point\", if you are looking for a commit that introduced a bug.\n+It is the equivalent of \"git bisect bad [<rev>]\".\n+\n+------------------------------------------------\n+git bisect old [<rev>...]\n+------------------------------------------------\n+\n+Marks the commit as old, as the opposite of 'git bisect new'.\n+It is the equivalent of \"git bisect good [<rev>...]\".\n+\n+You must run `git bisect start` without commits as argument and run\n+`git bisect new <rev>`/`git bisect old <rev>...` after to add the\n+commits.\n+\n Bisect visualize\n ~~~~~~~~~~~~~~~~\n \n@@ -379,6 +408,21 @@ In this case, when 'git bisect run' finishes, bisect/bad will refer to a commit\n has at least one parent whose reachable graph is fully traversable in the sense\n required by 'git pack objects'.\n \n+* Look for a fix instead of a regression in the code\n++\n+------------\n+$ git bisect start\n+$ git bisect new HEAD    # current commit is marked as new\n+$ git bisect old HEAD~10 # the tenth commit from now is marked as old\n+------------\n++\n+Let's consider the last commit has a given property, and that we are looking\n+for the commit which introduced this property. For each commit the bisection\n+guide us to, we will test if the property is present. If it is we will mark\n+the commit as new with 'git bisect new', otherwise we will mark it as old.\n+At the end of the bisect session, the result will be the first new commit (e.g\n+the first one with the property).\n+\n \n SEE ALSO\n --------\ndiff --git a/bisect.c b/bisect.c\nindex 827d2f3..eaa85b6 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -744,6 +744,11 @@ static void handle_bad_merge_base(void)\n \t\t\t\t\"This means the bug has been fixed \"\n \t\t\t\t\"between %s and [%s].\\n\",\n \t\t\t\tbad_hex, bad_hex, good_hex);\n+\t\t} else if (!strcmp(name_bad, \"new\")) {\n+\t\t\tfprintf(stderr, \"The merge base %s is new.\\n\"\n+\t\t\t\t\"The property has changed \"\n+\t\t\t\t\"between %s and [%s].\\n\",\n+\t\t\t\tbad_hex, bad_hex, good_hex);\n \t\t} else {\n \t\t\tfprintf(stderr, \"The merge base %s is %s.\\n\"\n \t\t\t\t\"This means the first commit marked %s is \"\n@@ -776,11 +781,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)\n }\n \n /*\n- * \"check_merge_bases\" checks that merge bases are not \"bad\".\n+ * \"check_merge_bases\" checks that merge bases are not \"bad\" (or \"new\").\n  *\n- * - If one is \"bad\", it means the user assumed something wrong\n+ * - If one is \"bad\" (or \"new\"), it means the user assumed something wrong\n  * and we must exit with a non 0 error code.\n- * - If one is \"good\", that's good, we have nothing to do.\n+ * - If one is \"good\" (or \"old\"), that's good, we have nothing to do.\n  * - If one is \"skipped\", we can't know but we should warn.\n  * - If we don't know, we should check it out and ask the user to test.\n  */\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex d63b4b0..c012f5d 100644\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -1,14 +1,16 @@\n #!/bin/sh\n \n-USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'\n+USAGE='[help|start|bad|good|new|old|skip|next|reset|visualize|replay|log|run]'\n LONG_USAGE='git bisect help\n \tprint this long help message.\n git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]\n \treset bisect state and start bisection.\n-git bisect bad [<rev>]\n-\tmark <rev> a known-bad revision.\n-git bisect good [<rev>...]\n-\tmark <rev>... known-good revisions.\n+git bisect (bad|new) [<rev>]\n+\tmark <rev> a known-bad revision/\n+\t\ta revision after change in a given property.\n+git bisect (good|old) [<rev>...]\n+\tmark <rev>... known-good revisions/\n+\t\trevisions before change in a given property.\n git bisect skip [(<rev>|<range>)...]\n \tmark <rev>... untestable revisions.\n git bisect next\n@@ -288,7 +290,7 @@ bisect_next_check() {\n \t\tfalse\n \t\t;;\n \tt,,\"$NAME_GOOD\")\n-\t\t# have bad but not good.  we could bisect although\n+\t\t# have bad (or new) but not good (or old).  we could bisect although\n \t\t# this is less optimum.\n \t\teval_gettextln \"Warning: bisecting only with a \\$NAME_BAD commit.\" >&2\n \t\tif test -t 0\n@@ -527,7 +529,7 @@ get_terms () {\n check_and_set_terms () {\n \tcmd=\"$1\"\n \tcase \"$cmd\" in\n-\tbad|good)\n+\tbad|good|new|old)\n \t\tif test -s \"$GIT_DIR/BISECT_TERMS\" && test \"$cmd\" != \"$NAME_BAD\" && test \"$cmd\" != \"$NAME_GOOD\"\n \t\tthen\n \t\t\tdie \"$(eval_gettext \"Invalid command: you're currently in a \\$NAME_BAD/\\$NAME_GOOD bisect.\")\"\n@@ -541,14 +543,22 @@ check_and_set_terms () {\n \t\t\tfi\n \t\t\tNAME_BAD=\"bad\"\n \t\t\tNAME_GOOD=\"good\" ;;\n+\t\tnew|old)\n+\t\t\tif ! test -s \"$GIT_DIR/BISECT_TERMS\"\n+\t\t\tthen\n+\t\t\t\techo \"new\" >\"$GIT_DIR/BISECT_TERMS\" &&\n+\t\t\t\techo \"old\" >>\"$GIT_DIR/BISECT_TERMS\"\n+\t\t\tfi\n+\t\t\tNAME_BAD=\"new\"\n+\t\t\tNAME_GOOD=\"old\" ;;\n \t\tesac ;;\n \tesac\n }\n \n bisect_voc () {\n \tcase \"$1\" in\n-\tbad) echo \"bad\" ;;\n-\tgood) echo \"good\" ;;\n+\tbad) echo \"bad|old\" ;;\n+\tgood) echo \"good|new\" ;;\n \tesac\n }\n \n@@ -564,7 +574,7 @@ case \"$#\" in\n \t\tgit bisect -h ;;\n \tstart)\n \t\tbisect_start \"$@\" ;;\n-\tbad|good)\n+\tbad|good|new|old)\n \t\tbisect_state \"$cmd\" \"$@\" ;;\n \tskip)\n \t\tbisect_skip \"$@\" ;;\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 9e2c203..2f2143b 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -759,4 +759,42 @@ test_expect_success '\"git bisect bad HEAD\" behaves as \"git bisect bad\"' '\n \tgit bisect reset\n '\n \n+test_expect_success 'bisect starts with only one new' '\n+\tgit bisect reset &&\n+\tgit bisect start &&\n+\tgit bisect new $HASH4 &&\n+\tgit bisect next\n+'\n+\n+test_expect_success 'bisect does not start with only one old' '\n+\tgit bisect reset &&\n+\tgit bisect start &&\n+\tgit bisect old $HASH1 &&\n+\ttest_must_fail git bisect next\n+'\n+\n+test_expect_success 'bisect start with one new and old' '\n+\tgit bisect reset &&\n+\tgit bisect start &&\n+\tgit bisect old $HASH1 &&\n+\tgit bisect new $HASH4 &&\n+\tgit bisect new &&\n+\tgit bisect new >bisect_result &&\n+\tgrep \"$HASH2 is the first new commit\" bisect_result &&\n+\tgit bisect log > log_to_replay.txt &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect replay with old and new' '\n+\tgit bisect replay log_to_replay.txt > bisect_result &&\n+\tgrep \"$HASH2 is the first new commit\" bisect_result &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect cannot mix old/new and good/bad' '\n+\tgit bisect start &&\n+\tgit bisect bad $HASH4 &&\n+\ttest_must_fail git bisect old $HASH1\n+'\n+\n test_done\n-- \n1.7.1\n"},{"id":"263532","messageId":"xmqqoakni8da.fsf@gitster.dls.corp.google.com","threadId":"39586","inReplyTo":"1433953472-32572-4-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","subject":"Re: [PATCH v2 4/7] bisect: add the terms old/new","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-10T21:03:29Z","receivedAt":"2015-06-10T21:03:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr> writes:\n\n> Related discussions:\n>\n> \t- http://thread.gmane.org/gmane.comp.version-control.git/86063\n> \t\tintroduced bisect fix unfixed to find fix.\n> \t- http://thread.gmane.org/gmane.comp.version-control.git/182398\n> \t\tdiscussion around bisect yes/no or old/new.\n> \t- http://thread.gmane.org/gmane.comp.version-control.git/199758\n> \t\tlast discussion and reviews\n\nHmph, recent reviews and discussions we had here do not count?\n\nI do agree with Matthieu's review on the last round, which is still\nnot quite addressed in this round.  The current code only supports\ngood/bad and this series merely adds another hardcoded pair old/new,\nwhich is disappointing, given that this is a very good opportunity\nto place an infrastructure to allow other pairs like unfixed/fixed\nbuilding on top of the most generic old/new.\n"},{"id":"263594","messageId":"vpq1thi465i.fsf@anie.imag.fr","threadId":"39586","inReplyTo":"1433953472-32572-2-git-send-email-antoine.delaite@ensimag.grenoble-inp.fr","subject":"Re: [PATCH v2 2/7] bisect: replace hardcoded \"bad|good\" by variables","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-11T15:27:21Z","receivedAt":"2015-06-11T15:27:21Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr> writes:\n\n> -\tif (!strcmp(refname, \"bad\")) {\n> +\tchar good_prefix[256];\n> +\tstrcpy(good_prefix, name_good);\n> +\tstrcat(good_prefix, \"-\");\n\nYou are silently adding a restriction here: name_good must be small\nenough to fit in a 256-bytes array. It's not a terrible restriction, but\nwhat may happen if you break it is a real issue.\n\nEither you have to enforce this restriction somewhere, or you should not\nhave the restriction at all. I'd vote for the second. strbuf is your\nfriend here.\n\n> @@ -259,21 +264,21 @@ bisect_state() {\n>  \n>  bisect_next_check() {\n>  \tmissing_good= missing_bad=\n> -\tgit show-ref -q --verify refs/bisect/bad || missing_bad=t\n> -\ttest -n \"$(git for-each-ref \"refs/bisect/good-*\")\" || missing_good=t\n> +\tgit show-ref -q --verify refs/bisect/$NAME_BAD || missing_bad=t\n> +\ttest -n \"$(git for-each-ref \"refs/bisect/$NAME_GOOD-*\")\" || missing_good=t\n\nThere are other restrictions here: $NAME_BAD must be an acceptable ref\nname, and you're not quoting $NAME_BAD hence it must not contain shell\nmeta-characters (The requirements for ref names almost imply that, but\n'foo/bar{a,b}' is accepted and will trigger some expansion if your\n/bin/sh is bash for example).\n\nBeing an acceptable ref name is a constraint you have to check (Junio\nalready mentionned check-ref-format). I think quoting variables makes\nsense too.\n\n> @@ -421,7 +426,7 @@ bisect_replay () {\n>  \t\tstart)\n>  \t\t\tcmd=\"bisect_start $rev\"\n>  \t\t\teval \"$cmd\" ;;\n> -\t\tgood|bad|skip)\n> +\t\t$NAME_GOOD|$NAME_BAD|skip)\n\n$NAME_GOOD and $NAME_BAD need quoting if you're not sure they don't\ncontain shell metacharacters.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"263812","messageId":"230275426.551398.1434282670067.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":"xmqqoakni8da.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2 4/7] bisect: add the terms old/new","fromName":"Louis-Alexandre Stuber","fromEmail":"stuberl@ensimag.grenoble-inp.fr","sentAt":"2015-06-14T11:51:10Z","receivedAt":"2015-06-14T11:51:10Z","isPatch":true,"sender":{"key":"stuberl@ensimag.grenoble-inp.fr","avatar":null},"body":"I agree this makes no sense hardcoding old/new once bisect terms is\nconsiderred. It would have been a lot better if we had started\nimplementing bisect terms immediatly (but we thought old/new would\nalready be an appreciable step for most of users).\n"},{"id":"264509","messageId":"134997869.703022.1434976943783.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39586","inReplyTo":"vpq1thi465i.fsf@anie.imag.fr","subject":"[PATCH v2 2/7] bisect: replace hardcoded \"bad|good\" by variables","fromName":"Antoine Delaite","fromEmail":"antoine.delaite@ensimag.grenoble-inp.fr","sentAt":"2015-06-22T12:42:23Z","receivedAt":"2015-06-22T12:42:23Z","isPatch":true,"sender":{"key":"antoine.delaite@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12510393?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote: \n\n>Being an acceptable ref name is a constraint you have to check (Junio \n>already mentionned check-ref-format). I think quoting variables makes \n>sense too \n\nI don't get how 'git check-ref-format' works exactly. It says it needs \nat least one slash in the ref name. So it would not be good for bisect \nterms.\nThen do we take the same format as branches ? \n( i.e 'git check-ref-format --branch' )\n\nThanks.\n"},{"id":"264512","messageId":"vpqvbefc0sp.fsf@anie.imag.fr","threadId":"39586","inReplyTo":"134997869.703022.1434976943783.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [PATCH v2 2/7] bisect: replace hardcoded \"bad|good\" by variables","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-22T13:47:34Z","receivedAt":"2015-06-22T13:47:34Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote: \n>\n>>Being an acceptable ref name is a constraint you have to check (Junio \n>>already mentionned check-ref-format). I think quoting variables makes \n>>sense too \n>\n> I don't get how 'git check-ref-format' works exactly. It says it needs \n> at least one slash in the ref name. So it would not be good for bisect \n> terms.\n\nAt some point, refs/bisect/$good and refs/bisect/$bad-$sha1 will become\nrefs, so you should check refs/bisect/$good and refs/bisect/$bad with\ncheck-ref-format (I think the -$sha1 suffix will be accepted by\nconstruction).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}