Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3cef67694c
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b02be8b901
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 28, 2019

  1. bisect: use string arguments to feed internal diff-tree

    Commit e22278c (bisect: display first bad commit without forking a
    new process, 2009-05-28) converted our external call to diff-tree to
    an internal use of the log_tree_commit(). But rather than individually
    setting options in the rev_info struct (and explaining in comments how
    they map to command-line options), we can just pass the command-line
    options to setup_revisions().
    
    This is shorter, easier to change, and less likely to break if
    revision.c internals change.
    
    Note that we unconditionally set the output format to "raw". The
    conditional in the original code didn't actually do anything useful,
    since nobody had an opportunity to set the format to anything.
    
    Signed-off-by: Jeff King <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    peff authored and gitster committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    2008f29 View commit details
    Browse the repository at this point in the history
  2. bisect: fix internal diff-tree config loading

    When we run our internal diff-tree to show the bisected commit, we call
    init_revisions(), then load config, then setup_revisions(). But that
    order is wrong: we copy the configured defaults into the rev_info struct
    during the init_revisions step, so our config load wasn't actually doing
    anything.
    
    Signed-off-by: Jeff King <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    peff authored and gitster committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    40ae3d3 View commit details
    Browse the repository at this point in the history
  3. bisect: make diff-tree output prettier

    After completing a bisection, we print out the commit we found using an
    internal version of diff-tree. The result is aesthetically lacking:
    
      - it shows a raw diff, which is generally less informative for human
        readers than "--stat --summary" (which we already decided was nice
        for humans in format-patch's output).
    
      - by not abbreviating hashes, the result is likely to wrap on most
        people's terminals
    
      - we don't use "-r", so if the commit touched files in a directory,
        you only get to see the top-level directory mentioned
    
      - we don't specify "--cc" or similar, so merges print nothing (not
        even the commit message!)
    
    Even though bisect might be driven by scripts, there's no reason to
    consider this part of the output as machine-readable (if anything, the
    initial "$hash is the first bad commit" might be parsed, but we won't
    touch that here). Let's make it prettier and more informative for a
    human reading the output.
    
    While we're tweaking the options, let's also switch to using the diff
    "ui" config. If we're accepting that this is human-readable output, then
    we should respect the user's options for how to display it.
    
    Note that we have to touch a few tests in t6030. These check bisection
    in a corrupted repository (it's missing a subtree). They didn't fail
    with the previous code, because it didn't actually recurse far enough in
    the diff to find the broken tree. But now we'll see the corruption and
    complain.
    
    Adjusting the tests to expect the die() is the best fix. We still
    confirm that we're able to bisect within the broken repo. And we'll
    still print "$hash is the first bad commit" as usual before dying;
    showing that is a reasonable outcome in a corrupt repository (and was
    what might happen already, if the root tree was corrupt).
    
    Signed-off-by: Jeff King <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    peff authored and gitster committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    b02be8b View commit details
    Browse the repository at this point in the history
Loading