• J
    git-gui: Implement "Stage/Unstage Line" · 5821988f
    Johannes Sixt 提交于
    This adds a context menu entry below "Stage/Unstage Hunk" that stages or
    unstages just the line under the mouse pointer.
    
    This is by itself useful, for example, if there are unrelated changes in
    the same hunk and the hunk cannot be split by reducing the context.
    
    The feature can also be used to split a hunk by staging a number of
    additions (or unstaging a number of removals) until there are enough
    context lines that the hunk gets split.
    
    The implementation reads the complete hunk that the line lives in, and
    constructs a new hunk by picking existing context lines, removing unneeded
    change lines and transforming other change lines to context lines. The
    resulting hunk is fed through 'git apply' just like in the "Stage/Unstage
    Hunk" case.
    Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
    Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
    5821988f
git-gui.sh 72.2 KB