Skip to content
  • Jeff King's avatar
    stash: default listing to working-tree diff · 288c67ca
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When you list stashes, you can provide arbitrary git-log
    options to change the display. However, adding just "-p"
    does nothing, because each stash is actually a merge commit.
    
    This implementation detail is easy to forget, leading to
    confused users who think "-p" is not working. We can make
    this easier by defaulting to "--first-parent -m", which will
    show the diff against the working tree. This omits the
    index portion of the stash entirely, but it's simple and it
    matches what "git stash show" provides.
    
    People who are more clueful about stash's true form can use
    "--cc" to override the "-m", and the "--first-parent" will
    then do nothing. For diffs, it only affects non-combined
    diffs, so "--cc" overrides it. And for the traversal, we are
    walking the linear reflog anyway, so we do not even care
    about the parents.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    288c67ca