Skip to content

Instantly share code, notes, and snippets.

@wisq
Last active April 25, 2024 10:22
Show Gist options
  • Select an option

  • Save wisq/0fa021df52a3bd2485ac to your computer and use it in GitHub Desktop.

Select an option

Save wisq/0fa021df52a3bd2485ac to your computer and use it in GitHub Desktop.

Revisions

  1. wisq revised this gist Jul 25, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,6 @@ Situation: Some commit (on master, but not necessarily head of master) has broke

    Now just follow the bisect.

    The `while` line has broken your commit up into small chunks. If a chunk has actually broken syntax (so you can't test either way), you can `git bisect skip`.
    The `while` line has broken your commit up into small chunks, one commit per chunk. If a chunk has actually broken syntax (so you can't test either way), you can `git bisect skip`.

    You can also `s/master/any-reference-branch-or-tag-or-sha/g`. And you can use `s\ny\nq\n` if you want even smaller chunks (but more risk of syntax errors).
  2. wisq revised this gist Jul 25, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ Situation: Some commit (on master, but not necessarily head of master) has broke
    ```sh
    % git bisect start
    % git bisect good
    % while [ `git diff master | wc -l` -gt 0 ]; do echo -e "y\nq\n" | git co -p master; git commit -m 'partial undo'; done
    % while [ "`git diff master`" != "" ]; do echo -e "y\nq\n" | git checkout -p master; git commit -m 'partial undo'; done
    ```
    (test here to make sure we've recreated your problem)
    ```sh
    @@ -18,4 +18,6 @@ Situation: Some commit (on master, but not necessarily head of master) has broke

    Now just follow the bisect.

    You can also `s/master/any-reference-branch-or-tag-or-sha/g`.
    The `while` line has broken your commit up into small chunks. If a chunk has actually broken syntax (so you can't test either way), you can `git bisect skip`.

    You can also `s/master/any-reference-branch-or-tag-or-sha/g`. And you can use `s\ny\nq\n` if you want even smaller chunks (but more risk of syntax errors).
  3. wisq revised this gist Jul 25, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,18 @@
    Situation: Some commit (on master, but not necessarily head of master) has broken things, but it's a big commit and it's not clear what part broke things.

    ```shell
    ```sh
    % git checkout master
    % git checkout -b bisect-branch
    % git revert <offending commit>
    ```
    (test here to make sure reverting fixed your problem)
    ```shell
    ```sh
    % git bisect start
    % git bisect good
    % while [ `git diff master | wc -l` -gt 0 ]; do echo -e "y\nq\n" | git co -p master; git commit -m 'partial undo'; done
    ```
    (test here to make sure we've recreated your problem)
    ```shell
    ```sh
    % git bisect bad
    ```

  4. wisq created this gist Jul 25, 2014.
    21 changes: 21 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    Situation: Some commit (on master, but not necessarily head of master) has broken things, but it's a big commit and it's not clear what part broke things.

    ```shell
    % git checkout master
    % git checkout -b bisect-branch
    % git revert <offending commit>
    ```
    (test here to make sure reverting fixed your problem)
    ```shell
    % git bisect start
    % git bisect good
    % while [ `git diff master | wc -l` -gt 0 ]; do echo -e "y\nq\n" | git co -p master; git commit -m 'partial undo'; done
    ```
    (test here to make sure we've recreated your problem)
    ```shell
    % git bisect bad
    ```

    Now just follow the bisect.

    You can also `s/master/any-reference-branch-or-tag-or-sha/g`.