{"thread":{"id":"28022","subject":"[PATCH v17 0/7] bisect: Add support for --no-checkout option","startedAt":"2011-08-04T12:00:56Z","lastAt":"2011-09-08T01:23:25Z","messageCount":12,"participants":["Jon Seymour","Christian Couder","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":17,"patchTotal":7},"messages":[{"id":"172921","messageId":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":null,"subject":"[PATCH v17 0/7] bisect: Add support for --no-checkout option","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:00:56Z","receivedAt":"2011-08-04T12:00:56Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Motivation\n==========\nFor some bisection tasks, checking out the commit at each stage of the bisection process is unecessary or undesirable.\n\nThis series adds support for a --no-checkout option to git-bisect.\n\nIf specified on a start command, --no-checkout causes 'git bisect' to update BISECT_HEAD at each stage of the bisection process instead of checking out the commit at that point. \n\nOne application of the --no-checkout option is to find, within a partially damaged repository, a commit that has at least one parent whose graph is fully reachable in the sense of 'git pack-objects'.\n\nFor example:\n\n\tgit bisect start BISECT_HEAD <some-known-good-commit> <boundary-commits> --no-checkout\n\tgit bisect run sh -c '\n\t       GOOD=$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&\n\t       git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&\n\t       git pack-objects --stdout >/dev/null <tmp.$$\n\t       rc=$?\n\t       rm -f tmp.$$\n\t       test $rc = 0'\n\n<some-known-good-commit> is a known good commit, for which the test passes.\n<boundary-commits> are commits chosen to prevent the bisection visiting missing or corrupt commit objects.\n\nAssuming this git bisect run completes successfully, bisect/bad will refer to a commit which has at least one parent that is fully reachable in the sense of 'git pack-objects'.\n\nPatch Synopsis\n==============\n\nRemediation\n-----------\nPatch 1/7 changes existing behaviour in the case that an invalid revision argument is supplied to 'git bisect start'. In particular, in this case, bisection state is neither created or modified if argument validation fails. Previously, existing bisection state would be cleared even if the revision arguments were subsequently determined to be invalid. \t\n\nPatch 2/7 remediates a potential flaw that might hide a failure in a chain of pasted statements.\n\nPatch 3/7 adds a test which documents the existing behaviour of git bisect in the presence of tree damage.\n\nNew Function\n------------\nPatch 4/7 modifies the C code that supports bisection.\nPatch 5/7 modifies porcelain to enable option exposed by 4/7.\nPatch 6/7 adds some tests.\nPatch 7/7 adds some documentation.\n\nRevision History\n----------------\nv17:\n\tRemoved 2 trailing semi-colons.\n\tFix errors found by Junio in documented example and test.\n\tFixed instances of \"; then\" in new and modified code.\nv16:\n\tUse --no-def with update-ref -d. \n\tEnsure update-ref BISECT_HEAD is created after BISECT_START and destroyed before BISECT_START. (Christian Couder)\n\tdash compatability (Jonathan Nieder).\n\tDocumentation and test tweaks (Junio Hamano).\nv15:\n\tFixed reset behaviour in --no-checkout case. Added one test for same.\n\tSimplified implementation so that no-checkout mode is inferred by presence of \n\t$GIT_DIR/BISECT_HEAD eliminating the need for a separate BISECT_MODE control file.\n\tPatch 8/8 from v13/14 was redistributed and squashed into earlier commits.\n\tStyle and documentation edits based on feedback from Christian Coulder.\nv14:\n\tReverted --bisect-mode aspect of v13 change so C code matches v11.\nv13:\n\tFollowing suggestions from Junio:\n\t * Replaced BISECT_NO_CHECKOUT control file with BISECT_MODE. \n\t * Changed name of internal option on bisect--helper from --no-checkout to --bisect-mode=checkout|update-ref.\n\t * Changed --no-checkout bisections to update BISECT_HEAD instead of HEAD.\t\nv11:\n\tRemoved support for --update-ref=<ref>, per Junio's preference.\nv10:\n\tChanged the way deferred statements are connected. Reverted some whitespace minimization.\nv8:\n\tFurther feedback from Christian Couder. Support --update-ref <ref>.\nv6: \n\tThis series includes numerous improvements suggested by Christian Couder.\nReworks: \n\t\"bisect: allow git bisect to be used with repos containing damaged trees.\" \n\tReplaced --ignore-checkout-failure with --no-checkout option suggested by Junio.\n\nFuture series\n-------------\n* Implement full support for bisection in bare repositories.\n* Fix whitespace, \"; then\" issues in git-bisect.h (patch that applies on v17 is available).\n\nJon Seymour (7):\n  bisect: move argument parsing before state modification.\n  bisect: use && to connect statements that are deferred with eval.\n  bisect: add tests to document expected behaviour in presence of\n    broken trees.\n  bisect: introduce support for --no-checkout option.\n  bisect: introduce --no-checkout support into porcelain.\n  bisect: add tests for the --no-checkout option.\n  bisect: add documentation for --no-checkout option.\n\n Documentation/git-bisect.txt |   32 +++++++++-\n bisect.c                     |   33 +++++++---\n bisect.h                     |    2 +-\n builtin/bisect--helper.c     |    7 ++-\n git-bisect.sh                |  116 +++++++++++++++++++++-------------\n t/t6030-bisect-porcelain.sh  |  144 +++++++++++++++++++++++++++++++++++++++++-\n 6 files changed, 271 insertions(+), 63 deletions(-)\n\n-- \n1.7.6.353.g50d6f\n"},{"id":"172922","messageId":"1312459263-16911-2-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 1/7] bisect: move argument parsing before state modification.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:00:57Z","receivedAt":"2011-08-04T12:00:57Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Currently 'git bisect start' modifies some state prior to checking\nthat its arguments are valid.\n\nThis change moves argument validation before state modification\nwith the effect that state modification does not occur\nunless argument validations succeeds.\n\nAn existing test is changed to check that new bisect state\nis not created if arguments are invalid.\n\nA new test is added to check that existing bisect state\nis not modified if arguments are invalid.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n git-bisect.sh               |   66 +++++++++++++++++++++---------------------\n t/t6030-bisect-porcelain.sh |   14 +++++++--\n 2 files changed, 44 insertions(+), 36 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex b2186a8..20f6dd5 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -60,6 +60,39 @@ bisect_autostart() {\n \n bisect_start() {\n \t#\n+\t# Check for one bad and then some good revisions.\n+\t#\n+\thas_double_dash=0\n+\tfor arg; do\n+\t    case \"$arg\" in --) has_double_dash=1; break ;; esac\n+\tdone\n+\torig_args=$(git rev-parse --sq-quote \"$@\")\n+\tbad_seen=0\n+\teval=''\n+\twhile [ $# -gt 0 ]; do\n+\t    arg=\"$1\"\n+\t    case \"$arg\" in\n+\t    --)\n+\t\tshift\n+\t\tbreak\n+\t\t;;\n+\t    *)\n+\t\trev=$(git rev-parse -q --verify \"$arg^{commit}\") || {\n+\t\t    test $has_double_dash -eq 1 &&\n+\t\t\tdie \"$(eval_gettext \"'\\$arg' does not appear to be a valid revision\")\"\n+\t\t    break\n+\t\t}\n+\t\tcase $bad_seen in\n+\t\t0) state='bad' ; bad_seen=1 ;;\n+\t\t*) state='good' ;;\n+\t\tesac\n+\t\teval=\"$eval bisect_write '$state' '$rev' 'nolog'; \"\n+\t\tshift\n+\t\t;;\n+\t    esac\n+\tdone\n+\n+\t#\n \t# Verify HEAD.\n \t#\n \thead=$(GIT_DIR=\"$GIT_DIR\" git symbolic-ref -q HEAD) ||\n@@ -98,39 +131,6 @@ bisect_start() {\n \tbisect_clean_state || exit\n \n \t#\n-\t# Check for one bad and then some good revisions.\n-\t#\n-\thas_double_dash=0\n-\tfor arg; do\n-\t    case \"$arg\" in --) has_double_dash=1; break ;; esac\n-\tdone\n-\torig_args=$(git rev-parse --sq-quote \"$@\")\n-\tbad_seen=0\n-\teval=''\n-\twhile [ $# -gt 0 ]; do\n-\t    arg=\"$1\"\n-\t    case \"$arg\" in\n-\t    --)\n-\t\tshift\n-\t\tbreak\n-\t\t;;\n-\t    *)\n-\t\trev=$(git rev-parse -q --verify \"$arg^{commit}\") || {\n-\t\t    test $has_double_dash -eq 1 &&\n-\t\t\tdie \"$(eval_gettext \"'\\$arg' does not appear to be a valid revision\")\"\n-\t\t    break\n-\t\t}\n-\t\tcase $bad_seen in\n-\t\t0) state='bad' ; bad_seen=1 ;;\n-\t\t*) state='good' ;;\n-\t\tesac\n-\t\teval=\"$eval bisect_write '$state' '$rev' 'nolog'; \"\n-\t\tshift\n-\t\t;;\n-\t    esac\n-\tdone\n-\n-\t#\n \t# Change state.\n \t# In case of mistaken revs or checkout error, or signals received,\n \t# \"bisect_auto_next\" below may exit or misbehave.\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex b5063b6..b3d1b14 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -138,15 +138,23 @@ test_expect_success 'bisect start: back in good branch' '\n \tgrep \"* other\" branch.output > /dev/null\n '\n \n-test_expect_success 'bisect start: no \".git/BISECT_START\" if junk rev' '\n-\tgit bisect start $HASH4 $HASH1 -- &&\n-\tgit bisect good &&\n+test_expect_success 'bisect start: no \".git/BISECT_START\" created if junk rev' '\n+\tgit bisect reset &&\n \ttest_must_fail git bisect start $HASH4 foo -- &&\n \tgit branch > branch.output &&\n \tgrep \"* other\" branch.output > /dev/null &&\n \ttest_must_fail test -e .git/BISECT_START\n '\n \n+test_expect_success 'bisect start: existing \".git/BISECT_START\" not modified if junk rev' '\n+\tgit bisect start $HASH4 $HASH1 -- &&\n+\tgit bisect good &&\n+\tcp .git/BISECT_START saved &&\n+\ttest_must_fail git bisect start $HASH4 foo -- &&\n+\tgit branch > branch.output &&\n+\tgrep \"* (no branch)\" branch.output > /dev/null &&\n+\ttest_cmp saved .git/BISECT_START\n+'\n test_expect_success 'bisect start: no \".git/BISECT_START\" if mistaken rev' '\n \tgit bisect start $HASH4 $HASH1 -- &&\n \tgit bisect good &&\n-- \n1.7.6.353.g50d6f\n"},{"id":"172923","messageId":"1312459263-16911-3-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 2/7] bisect: use && to connect statements that are deferred with eval.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:00:58Z","receivedAt":"2011-08-04T12:00:58Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Christian Couder pointed out that the existing eval strategy\nswallows an initial non-zero return. Using && to connect\nthe statements should fix this.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n git-bisect.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 20f6dd5..a44ffe1 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -86,7 +86,7 @@ bisect_start() {\n \t\t0) state='bad' ; bad_seen=1 ;;\n \t\t*) state='good' ;;\n \t\tesac\n-\t\teval=\"$eval bisect_write '$state' '$rev' 'nolog'; \"\n+\t\teval=\"$eval bisect_write '$state' '$rev' 'nolog' &&\"\n \t\tshift\n \t\t;;\n \t    esac\n@@ -145,7 +145,7 @@ bisect_start() {\n \t#\n \techo \"$start_head\" >\"$GIT_DIR/BISECT_START\" &&\n \tgit rev-parse --sq-quote \"$@\" >\"$GIT_DIR/BISECT_NAMES\" &&\n-\teval \"$eval\" &&\n+\teval \"$eval true\" &&\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-- \n1.7.6.353.g50d6f\n"},{"id":"172924","messageId":"1312459263-16911-4-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 3/7] bisect: add tests to document expected behaviour in presence of broken trees.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:00:59Z","receivedAt":"2011-08-04T12:00:59Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"If the repo is broken, we expect bisect to fail.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n t/t6030-bisect-porcelain.sh |   48 +++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 48 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex b3d1b14..9ae2de8 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -581,5 +581,53 @@ test_expect_success 'erroring out when using bad path parameters' '\n '\n \n #\n+# This creates a broken branch which cannot be checked out because\n+# the tree created has been deleted.\n #\n+# H1-H2-H3-H4-H5-H6-H7  <--other\n+#            \\\n+#             S5-S6'-S7'-S8'-S9  <--broken\n+#\n+# Commits marked with ' have a missing tree.\n+#\n+test_expect_success 'broken branch creation' '\n+\tgit bisect reset &&\n+\tgit checkout -b broken $HASH4 &&\n+\tgit tag BROKEN_HASH4 $HASH4 &&\n+\tadd_line_into_file \"5(broken): first line on a broken branch\" hello2 &&\n+\tgit tag BROKEN_HASH5 &&\n+\tmkdir missing &&\n+\t:> missing/MISSING &&\n+\tgit add missing/MISSING &&\n+\tgit commit -m \"6(broken): Added file that will be deleted\"\n+\tgit tag BROKEN_HASH6 &&\n+\tadd_line_into_file \"7(broken): second line on a broken branch\" hello2 &&\n+\tgit tag BROKEN_HASH7 &&\n+\tadd_line_into_file \"8(broken): third line on a broken branch\" hello2 &&\n+\tgit tag BROKEN_HASH8 &&\n+\tgit rm missing/MISSING &&\n+\tgit commit -m \"9(broken): Remove missing file\"\n+\tgit tag BROKEN_HASH9 &&\n+\trm .git/objects/39/f7e61a724187ab767d2e08442d9b6b9dab587d\n+'\n+\n+echo \"\" > expected.ok\n+cat > expected.missing-tree.default <<EOF\n+fatal: unable to read tree 39f7e61a724187ab767d2e08442d9b6b9dab587d\n+EOF\n+\n+test_expect_success 'bisect fails if tree is broken on start commit' '\n+\tgit bisect reset &&\n+\ttest_must_fail git bisect start BROKEN_HASH7 BROKEN_HASH4 2>error.txt &&\n+\ttest_cmp expected.missing-tree.default error.txt\n+'\n+\n+test_expect_success 'bisect fails if tree is broken on trial commit' '\n+\tgit bisect reset &&\n+\ttest_must_fail git bisect start BROKEN_HASH9 BROKEN_HASH4 2>error.txt &&\n+\tgit reset --hard broken &&\n+\tgit checkout broken &&\n+\ttest_cmp expected.missing-tree.default error.txt\n+'\n+\n test_done\n-- \n1.7.6.353.g50d6f\n"},{"id":"172925","messageId":"1312459263-16911-5-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 4/7] bisect: introduce support for --no-checkout option.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:01:00Z","receivedAt":"2011-08-04T12:01:00Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"If --no-checkout is specified, then the bisection process uses:\n\n\tgit update-ref --no-deref HEAD <trial>\n\nat each trial instead of:\n\n\tgit checkout <trial>\n\nImproved-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n bisect.c                 |   33 ++++++++++++++++++++++-----------\n bisect.h                 |    2 +-\n builtin/bisect--helper.c |    7 +++++--\n 3 files changed, 28 insertions(+), 14 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex dd7e8ed..c7b7d79 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -24,6 +24,7 @@ struct argv_array {\n \n 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 /* bits #0-15 in revision.h */\n \n@@ -707,16 +708,23 @@ static void mark_expected_rev(char *bisect_rev_hex)\n \t\tdie(\"closing file %s: %s\", filename, strerror(errno));\n }\n \n-static int bisect_checkout(char *bisect_rev_hex)\n+static int bisect_checkout(char *bisect_rev_hex, int no_checkout)\n {\n \tint res;\n \n \tmark_expected_rev(bisect_rev_hex);\n \n \targv_checkout[2] = bisect_rev_hex;\n-\tres = run_command_v_opt(argv_checkout, RUN_GIT_CMD);\n-\tif (res)\n-\t\texit(res);\n+\tif (no_checkout) {\n+\t\targv_update_ref[3] = bisect_rev_hex;\n+\t\tif (run_command_v_opt(argv_update_ref, RUN_GIT_CMD))\n+\t\t\tdie(\"update-ref --no-deref HEAD failed on %s\",\n+\t\t\t    bisect_rev_hex);\n+\t} else {\n+\t\tres = run_command_v_opt(argv_checkout, RUN_GIT_CMD);\n+\t\tif (res)\n+\t\t\texit(res);\n+\t}\n \n \targv_show_branch[1] = bisect_rev_hex;\n \treturn run_command_v_opt(argv_show_branch, RUN_GIT_CMD);\n@@ -788,7 +796,7 @@ static void handle_skipped_merge_base(const unsigned char *mb)\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  */\n-static void check_merge_bases(void)\n+static void check_merge_bases(int no_checkout)\n {\n \tstruct commit_list *result;\n \tint rev_nr;\n@@ -806,7 +814,7 @@ static void check_merge_bases(void)\n \t\t\thandle_skipped_merge_base(mb);\n \t\t} else {\n \t\t\tprintf(\"Bisecting: a merge base must be tested\\n\");\n-\t\t\texit(bisect_checkout(sha1_to_hex(mb)));\n+\t\t\texit(bisect_checkout(sha1_to_hex(mb), no_checkout));\n \t\t}\n \t}\n \n@@ -849,7 +857,7 @@ static int check_ancestors(const char *prefix)\n  * If a merge base must be tested by the user, its source code will be\n  * checked out to be tested by the user and we will exit.\n  */\n-static void check_good_are_ancestors_of_bad(const char *prefix)\n+static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)\n {\n \tconst char *filename = git_path(\"BISECT_ANCESTORS_OK\");\n \tstruct stat st;\n@@ -868,7 +876,7 @@ static void check_good_are_ancestors_of_bad(const char *prefix)\n \n \t/* Check if all good revs are ancestor of the bad rev. */\n \tif (check_ancestors(prefix))\n-\t\tcheck_merge_bases();\n+\t\tcheck_merge_bases(no_checkout);\n \n \t/* Create file BISECT_ANCESTORS_OK. */\n \tfd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0600);\n@@ -908,8 +916,11 @@ static void show_diff_tree(const char *prefix, struct commit *commit)\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+ *\n+ * If no_checkout is non-zero, the bisection process does not\n+ * checkout the trial commit but instead simply updates BISECT_HEAD.\n  */\n-int bisect_next_all(const char *prefix)\n+int bisect_next_all(const char *prefix, int no_checkout)\n {\n \tstruct rev_info revs;\n \tstruct commit_list *tried;\n@@ -920,7 +931,7 @@ int bisect_next_all(const char *prefix)\n \tif (read_bisect_refs())\n \t\tdie(\"reading bisect refs failed\");\n \n-\tcheck_good_are_ancestors_of_bad(prefix);\n+\tcheck_good_are_ancestors_of_bad(prefix, no_checkout);\n \n \tbisect_rev_setup(&revs, prefix, \"%s\", \"^%s\", 1);\n \trevs.limited = 1;\n@@ -966,6 +977,6 @@ int bisect_next_all(const char *prefix)\n \t       \"(roughly %d step%s)\\n\", nr, (nr == 1 ? \"\" : \"s\"),\n \t       steps, (steps == 1 ? \"\" : \"s\"));\n \n-\treturn bisect_checkout(bisect_rev_hex);\n+\treturn bisect_checkout(bisect_rev_hex, no_checkout);\n }\n \ndiff --git a/bisect.h b/bisect.h\nindex 0862ce5..22f2e4d 100644\n--- a/bisect.h\n+++ b/bisect.h\n@@ -27,7 +27,7 @@ struct rev_list_info {\n \tconst char *header_prefix;\n };\n \n-extern int bisect_next_all(const char *prefix);\n+extern int bisect_next_all(const char *prefix, int no_checkout);\n \n extern int estimate_bisect_steps(int all);\n \ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex 5b22639..8d325a5 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -4,16 +4,19 @@\n #include \"bisect.h\"\n \n static const char * const git_bisect_helper_usage[] = {\n-\t\"git bisect--helper --next-all\",\n+\t\"git bisect--helper --next-all [--no-checkout]\",\n \tNULL\n };\n \n int cmd_bisect__helper(int argc, const char **argv, const char *prefix)\n {\n \tint next_all = 0;\n+\tint no_checkout = 0;\n \tstruct option options[] = {\n \t\tOPT_BOOLEAN(0, \"next-all\", &next_all,\n \t\t\t    \"perform 'git bisect next'\"),\n+\t\tOPT_BOOLEAN(0, \"no-checkout\", &no_checkout,\n+\t\t\t    \"update BISECT_HEAD instead of checking out the current commit\"),\n \t\tOPT_END()\n \t};\n \n@@ -24,5 +27,5 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(git_bisect_helper_usage, options);\n \n \t/* next-all */\n-\treturn bisect_next_all(prefix);\n+\treturn bisect_next_all(prefix, no_checkout);\n }\n-- \n1.7.6.353.g50d6f\n"},{"id":"172926","messageId":"1312459263-16911-6-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 5/7] bisect: introduce --no-checkout support into porcelain.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:01:01Z","receivedAt":"2011-08-04T12:01:01Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"git-bisect can now perform bisection of a history without performing\na checkout at each stage of the bisection process. Instead, HEAD is updated.\n\nOne use-case for this function is allow git bisect to be used with\ndamaged repositories where git checkout would fail because the tree\nreferenced by the commit is damaged.\n\nIt can also be used in other cases where actual checkout of the tree\nis not required to progress the bisection.\n\nImproved-by: Christian Couder <chriscool@tuxfamily.org>\nImproved-by: Junio C Hamano <gitster@pobox.com>\nImproved-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n git-bisect.sh |   48 +++++++++++++++++++++++++++++++++++++-----------\n 1 files changed, 37 insertions(+), 11 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex a44ffe1..b9c18dd 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -3,7 +3,7 @@\n USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'\n LONG_USAGE='git bisect help\n         print this long help message.\n-git bisect start [<bad> [<good>...]] [--] [<pathspec>...]\n+git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]\n         reset bisect state and start bisection.\n git bisect bad [<rev>]\n         mark <rev> a known-bad revision.\n@@ -34,6 +34,16 @@ require_work_tree\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 \n+bisect_head()\n+{\n+\tif test -f \"$GIT_DIR/BISECT_HEAD\"\n+\tthen\n+\t\techo BISECT_HEAD\n+\telse\n+\t\techo HEAD\n+\tfi\n+}\n+\n bisect_autostart() {\n \ttest -s \"$GIT_DIR/BISECT_START\" || {\n \t\t(\n@@ -69,6 +79,7 @@ bisect_start() {\n \torig_args=$(git rev-parse --sq-quote \"$@\")\n \tbad_seen=0\n \teval=''\n+\tmode=''\n \twhile [ $# -gt 0 ]; do\n \t    arg=\"$1\"\n \t    case \"$arg\" in\n@@ -76,6 +87,11 @@ bisect_start() {\n \t\tshift\n \t\tbreak\n \t\t;;\n+\t    --no-checkout)\n+\t\tmode=--no-checkout\n+\t\tshift ;;\n+\t    --*)\n+\t\tdie \"$(eval_gettext \"unrecognised option: '\\$arg'\")\" ;;\n \t    *)\n \t\trev=$(git rev-parse -q --verify \"$arg^{commit}\") || {\n \t\t    test $has_double_dash -eq 1 &&\n@@ -107,7 +123,10 @@ bisect_start() {\n \tthen\n \t\t# Reset to the rev from where we started.\n \t\tstart_head=$(cat \"$GIT_DIR/BISECT_START\")\n-\t\tgit checkout \"$start_head\" -- || exit\n+\t\tif test \"z$mode\" != \"z--no-checkout\"\n+\t\tthen\n+\t\t    git checkout \"$start_head\" --\n+\t\tfi\n \telse\n \t\t# Get rev from where we start.\n \t\tcase \"$head\" in\n@@ -143,7 +162,10 @@ bisect_start() {\n \t#\n \t# Write new start state.\n \t#\n-\techo \"$start_head\" >\"$GIT_DIR/BISECT_START\" &&\n+\techo \"$start_head\" >\"$GIT_DIR/BISECT_START\" && {\n+\t\ttest \"z$mode\" != \"z--no-checkout\" ||\n+\t\tgit update-ref --no-deref BISECT_HEAD \"$start_head\"\n+\t} &&\n \tgit rev-parse --sq-quote \"$@\" >\"$GIT_DIR/BISECT_NAMES\" &&\n \teval \"$eval true\" &&\n \techo \"git bisect start$orig_args\" >>\"$GIT_DIR/BISECT_LOG\" || exit\n@@ -206,8 +228,8 @@ bisect_state() {\n \t0,*)\n \t\tdie \"$(gettext \"Please call 'bisect_state' with at least one argument.\")\" ;;\n \t1,bad|1,good|1,skip)\n-\t\trev=$(git rev-parse --verify HEAD) ||\n-\t\t\tdie \"$(gettext \"Bad rev input: HEAD\")\"\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@@ -291,7 +313,7 @@ bisect_next() {\n \tbisect_next_check good\n \n \t# Perform all bisection computation, display and checkout\n-\tgit bisect--helper --next-all\n+\tgit bisect--helper --next-all $(test -f \"$GIT_DIR/BISECT_HEAD\" && echo --no-checkout)\n \tres=$?\n \n         # Check if we should exit because bisection is finished\n@@ -340,12 +362,15 @@ bisect_reset() {\n \t*)\n \t    usage ;;\n \tesac\n-\tif git checkout \"$branch\" -- ; then\n-\t\tbisect_clean_state\n-\telse\n-\t\tdie \"$(eval_gettext \"Could not check out original HEAD '\\$branch'.\n+\tif ! test -f \"$GIT_DIR/BISECT_HEAD\"\n+\tthen\n+\t\tif ! git checkout \"$branch\" --\n+\t\tthen\n+\t\t\tdie \"$(eval_gettext \"Could not check out original HEAD '\\$branch'.\n Try 'git bisect reset <commit>'.\")\"\n+\t\tfi\n \tfi\n+\tbisect_clean_state\n }\n \n bisect_clean_state() {\n@@ -362,7 +387,8 @@ bisect_clean_state() {\n \trm -f \"$GIT_DIR/BISECT_RUN\" &&\n \t# Cleanup head-name if it got left by an old version of git-bisect\n \trm -f \"$GIT_DIR/head-name\" &&\n-\n+\tgit update-ref -d --no-deref BISECT_HEAD &&\n+\t# clean up BISECT_START last\n \trm -f \"$GIT_DIR/BISECT_START\"\n }\n \n-- \n1.7.6.353.g50d6f\n"},{"id":"172927","messageId":"1312459263-16911-7-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 6/7] bisect: add tests for the --no-checkout option.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:01:02Z","receivedAt":"2011-08-04T12:01:02Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"These tests verify that git-bisect --no-checkout can successfully\nbisect commit histories that reference damaged trees.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n t/t6030-bisect-porcelain.sh |   82 +++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 82 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 9ae2de8..4fb7d11 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -126,6 +126,18 @@ test_expect_success 'bisect reset removes packed refs' '\n \ttest -z \"$(git for-each-ref \"refs/heads/bisect\")\"\n '\n \n+test_expect_success 'bisect reset removes bisect state after --no-checkout' '\n+\tgit bisect reset &&\n+\tgit bisect start --no-checkout &&\n+\tgit bisect good $HASH1 &&\n+\tgit bisect bad $HASH3 &&\n+\tgit bisect next &&\n+\tgit bisect reset &&\n+\ttest -z \"$(git for-each-ref \"refs/bisect/*\")\" &&\n+\ttest -z \"$(git for-each-ref \"refs/heads/bisect\")\" &&\n+\ttest -z \"$(git for-each-ref \"BISECT_HEAD\")\"\n+'\n+\n test_expect_success 'bisect start: back in good branch' '\n \tgit branch > branch.output &&\n \tgrep \"* other\" branch.output > /dev/null &&\n@@ -630,4 +642,74 @@ test_expect_success 'bisect fails if tree is broken on trial commit' '\n \ttest_cmp expected.missing-tree.default error.txt\n '\n \n+check_same()\n+{\n+\techo \"Checking $1 is the same as $2\" &&\n+\tgit rev-parse \"$1\" > expected.same &&\n+\tgit rev-parse \"$2\" > expected.actual &&\n+\ttest_cmp expected.same expected.actual\n+}\n+\n+test_expect_success 'bisect: --no-checkout - start commit bad' '\n+\tgit bisect reset &&\n+\tgit bisect start BROKEN_HASH7 BROKEN_HASH4 --no-checkout &&\n+\tcheck_same BROKEN_HASH6 BISECT_HEAD &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect: --no-checkout - trial commit bad' '\n+\tgit bisect reset &&\n+\tgit bisect start broken BROKEN_HASH4 --no-checkout &&\n+\tcheck_same BROKEN_HASH6 BISECT_HEAD &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect: --no-checkout - target before breakage' '\n+\tgit bisect reset &&\n+\tgit bisect start broken BROKEN_HASH4 --no-checkout &&\n+\tcheck_same BROKEN_HASH6 BISECT_HEAD &&\n+\tgit bisect bad BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH5 BISECT_HEAD &&\n+\tgit bisect bad BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH5 bisect/bad &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect: --no-checkout - target in breakage' '\n+\tgit bisect reset &&\n+\tgit bisect start broken BROKEN_HASH4 --no-checkout &&\n+\tcheck_same BROKEN_HASH6 BISECT_HEAD &&\n+\tgit bisect bad BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH5 BISECT_HEAD &&\n+\tgit bisect good BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH6 bisect/bad &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect: --no-checkout - target after breakage' '\n+\tgit bisect reset &&\n+\tgit bisect start broken BROKEN_HASH4 --no-checkout &&\n+\tcheck_same BROKEN_HASH6 BISECT_HEAD &&\n+\tgit bisect good BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH8 BISECT_HEAD &&\n+\tgit bisect good BISECT_HEAD &&\n+\tcheck_same BROKEN_HASH9 bisect/bad &&\n+\tgit bisect reset\n+'\n+\n+test_expect_success 'bisect: demonstrate identification of damage boundary' \"\n+\tgit bisect reset &&\n+\tgit checkout broken &&\n+\tgit bisect start broken master --no-checkout &&\n+\tgit bisect run sh -c '\n+\t\tGOOD=\\$(git for-each-ref \\\"--format=%(objectname)\\\" refs/bisect/good-*) &&\n+\t\tgit rev-list --objects BISECT_HEAD --not \\$GOOD >tmp.\\$\\$ &&\n+\t\tgit pack-objects --stdout >/dev/null < tmp.\\$\\$\n+\t\trc=\\$?\n+\t\trm -f tmp.\\$\\$\n+\t\ttest \\$rc = 0' &&\n+\tcheck_same BROKEN_HASH6 bisect/bad &&\n+\tgit bisect reset\n+\"\n+\n test_done\n-- \n1.7.6.353.g50d6f\n"},{"id":"172928","messageId":"1312459263-16911-8-git-send-email-jon.seymour@gmail.com","threadId":"28022","inReplyTo":"1312459263-16911-1-git-send-email-jon.seymour@gmail.com","subject":"[PATCH v17 7/7] bisect: add documentation for --no-checkout option.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-08-04T12:01:03Z","receivedAt":"2011-08-04T12:01:03Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Signed-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n Documentation/git-bisect.txt |   32 +++++++++++++++++++++++++++++++-\n 1 files changed, 31 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt\nindex ab60a18..41e6ca8 100644\n--- a/Documentation/git-bisect.txt\n+++ b/Documentation/git-bisect.txt\n@@ -17,7 +17,7 @@ The command takes various subcommands, and different options depending\n on the subcommand:\n \n  git bisect help\n- git bisect start [<bad> [<good>...]] [--] [<paths>...]\n+ git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<paths>...]\n  git bisect bad [<rev>]\n  git bisect good [<rev>...]\n  git bisect skip [(<rev>|<range>)...]\n@@ -263,6 +263,17 @@ rewind the tree to the pristine state.  Finally the script should exit\n with the status of the real test to let the \"git bisect run\" command loop\n determine the eventual outcome of the bisect session.\n \n+OPTIONS\n+-------\n+--no-checkout::\n++\n+Do not checkout the new working tree at each iteration of the bisection\n+process. Instead just update a special reference named 'BISECT_HEAD' to make\n+it point to the commit that should be tested.\n++\n+This option may be useful when the test you would perform in each step\n+does not require a checked out tree.\n+\n EXAMPLES\n --------\n \n@@ -343,6 +354,25 @@ $ git bisect run sh -c \"make || exit 125; ~/check_test_case.sh\"\n This shows that you can do without a run script if you write the test\n on a single line.\n \n+* Locate a good region of the object graph in a damaged repository\n++\n+------------\n+$ git bisect start HEAD <known-good-commit> [ <boundary-commit> ... ] --no-checkout\n+$ git bisect run sh -c '\n+\tGOOD=$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&\n+\tgit rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ &&\n+\tgit pack-objects --stdout >/dev/null <tmp.$$\n+\trc=$?\n+\trm -f tmp.$$\n+\ttest $rc = 0'\n+\n+------------\n++\n+In this case, when 'git bisect run' finishes, bisect/bad will refer to a commit that\n+has at least one parent whose reachable graph is fully traversable in the sense\n+required by 'git pack objects'.\n+\n+\n SEE ALSO\n --------\n link:git-bisect-lk2009.html[Fighting regressions with git bisect],\n-- \n1.7.6.353.g50d6f\n"},{"id":"174979","messageId":"201109070816.16655.chriscool@tuxfamily.org","threadId":"28022","inReplyTo":"1312459263-16911-2-git-send-email-jon.seymour@gmail.com","subject":"Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2011-09-07T06:16:15Z","receivedAt":"2011-09-07T06:16:15Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Thursday 04 August 2011 14:00:57 Jon Seymour wrote:\n> Currently 'git bisect start' modifies some state prior to checking\n> that its arguments are valid.\n> \n> This change moves argument validation before state modification\n> with the effect that state modification does not occur\n> unless argument validations succeeds.\n\nThis thread:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/180733/\n\nmade me wonder if we introduced a bug with this patch.\n\nIf we start bisecting like this:\n\n$ git bisect start HEAD HEAD~20\n\nand then we decide that it was not optimum and we want to start again like \nthis:\n\n$ git bisect start HEAD HEAD~6\n\nthen issuing the latter command might not work as it did before this patch.\n \nBefore this patch the latter command would do a \"git checkout $start_head\" \nbefore the repeated rev=$(git rev-parse -q --verify \"$arg^{commit}\") to \nconvert arguments into sha1. And after this patch the order is reversed.\n\nThis means that before this patch \"HEAD\" in the arguments to \"git bisect \nstart\" would refer to $start_head because the \"git checkout $start_head\" \nchanges HEAD. After this patch \"HEAD\" in the arguments to \"git bisect start\" \nwould refer to the current HEAD.\n\nFor example before this patch, if I issue \"git bisect start HEAD HEAD~8\" twice \nI get:\n\n$ git bisect start HEAD HEAD~8\nBisecting: 15 revisions left to test after this (roughly 4 steps)\n[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-\nexternal-command'\n$ git bisect start HEAD HEAD~8\nPrevious HEAD position was 67c116b... Merge branch 'jk/pager-with-external-\ncommand'\nSwitched to branch 'master'\nBisecting: 15 revisions left to test after this (roughly 4 steps)\n[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-\nexternal-command'\n\nso the same commit to test is checked out.\n\nAfter this patch I get:\n\n$ git bisect start HEAD HEAD~8\nBisecting: 15 revisions left to test after this (roughly 4 steps)\n[67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b] Merge branch 'jk/pager-with-\nexternal-command'\n$ git bisect start HEAD HEAD~8\nPrevious HEAD position was 67c116b... Merge branch 'jk/pager-with-external-\ncommand'\nSwitched to branch 'master'\nBisecting: 15 revisions left to test after this (roughly 4 steps)\n[e5cfcb04e0acc5f3b51e6d69487028315b33e4c9] Merge branch 'mh/attr'\n\nso a different commit is checked out after the second \"git bisect start HEAD \nHEAD~8\".\n\nBest regards,\nChristian.\n"},{"id":"174982","messageId":"7vobyw4mkv.fsf@alter.siamese.dyndns.org","threadId":"28022","inReplyTo":"201109070816.16655.chriscool@tuxfamily.org","subject":"Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-07T11:29:52Z","receivedAt":"2011-09-07T11:29:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> If we start bisecting like this:\n>\n> $ git bisect start HEAD HEAD~20\n>\n> and then we decide that it was not optimum and we want to start again like \n> this:\n>\n> $ git bisect start HEAD HEAD~6\n>\n> then issuing the latter command might not work as it did before this patch.\n\nI didn't even know the above was supposed to work. It may have worked, but\nI think it was not by design but merely by accident. Besides, wouldn't it\nbe the same to say \"git bisect good\" to further limit the suspect range,\ninstead of giving the second, seemingly nested, \"bisect start\" that is not\nreally nesting, which only confuses the users?\n\nHaving said that, if you can resurrect the old behaviour without too much\ncode churn, I wouldn't mind to look at the patch, but I am not sure if it\nis worth it.\n"},{"id":"175016","messageId":"4E67B2F2.9070806@kdbg.org","threadId":"28022","inReplyTo":"201109070816.16655.chriscool@tuxfamily.org","subject":"Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2011-09-07T18:07:46Z","receivedAt":"2011-09-07T18:07:46Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 07.09.2011 08:16, schrieb Christian Couder:\n> If we start bisecting like this:\n> \n> $ git bisect start HEAD HEAD~20\n> \n> and then we decide that it was not optimum and we want to start again like \n> this:\n> \n> $ git bisect start HEAD HEAD~6\n> \n> then issuing the latter command might not work as it did before this patch.\n>  \n> Before this patch the latter command would do a \"git checkout $start_head\" \n> before the repeated rev=$(git rev-parse -q --verify \"$arg^{commit}\") to \n> convert arguments into sha1. And after this patch the order is reversed.\n> \n> This means that before this patch \"HEAD\" in the arguments to \"git bisect \n> start\" would refer to $start_head because the \"git checkout $start_head\" \n> changes HEAD. After this patch \"HEAD\" in the arguments to \"git bisect start\" \n> would refer to the current HEAD.\n\nBut isn't this an improvement? HEAD denotes the current head. After the\nfirst 'bisect start HEAD HEAD~20', HEAD is somewhere in the middle, not\nthe original HEAD anymore; I would *expect* that a different commit is\nchecked out if I just repeat the command.\n\nIOW, I think the new behavior is *much* better than the old behavior.\n\n-- Hannes\n"},{"id":"175056","messageId":"CAH3AnrpNSNsz77kBsGQxprXh3bdNUzrWyFwtq_up0hetwikhMA@mail.gmail.com","threadId":"28022","inReplyTo":"4E67B2F2.9070806@kdbg.org","subject":"Re: [PATCH v17 1/7] bisect: move argument parsing before state modification.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-09-08T01:23:25Z","receivedAt":"2011-09-08T01:23:25Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Thu, Sep 8, 2011 at 4:07 AM, Johannes Sixt <j6t@kdbg.org> wrote:\n> Am 07.09.2011 08:16, schrieb Christian Couder:\n\n> IOW, I think the new behavior is *much* better than the old behavior.\n>\n\nThere is perhaps no surprise that I agree with Hannes. Certainly, it\nseemed saner to me to do argument validation before state update. [\nAlso, the earlier iterations of the --no-checkout series needed the\nnew behaviour. Not sure if that is still true, but I suspect it is ].\n\njon.\n"}]}