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: f19f1b6cf37d22cf317b5c3b52a11eede1abe267
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 417b181f99ce53f50dea6541430cfe1f1f359a6a
Choose a head ref
  • 4 commits
  • 9 files changed
  • 1 contributor

Commits on Feb 17, 2026

  1. interactive -p: add new --auto-advance flag

    When using the interactive add, reset, stash or checkout machinery,
    we do not have the option of reworking with a file when selecting
    hunks, because the session automatically advances to the next file
    or ends if we have just one file.
    
    Introduce the flag `--auto-advance` which auto advances by default,
    when interactively selecting patches with the '--patch' option.
    However, the `--no-auto-advance` option does not auto advance, thereby
    allowing users the option to rework with files.
    
    Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    devdekunle authored and gitster committed Feb 17, 2026
    Configuration menu
    Copy the full SHA
    06c81a1 View commit details
    Browse the repository at this point in the history
  2. add-patch: modify patch_update_file() signature

    The function `patch_update_file()` takes the add_p_state struct
    pointer and the current `struct file_diff` pointer and returns an
    int.
    
    When using the `--no-auto-advance` flag, we want to be able to request
    the next or previous file from the caller.
    
    Modify the function signature to instead take the index of the
    current `file_diff` and the `add_p_state` struct pointer so that we
    can compute the `file_diff` from the index while also having
    access to the file index. This will help us request the next or
    previous file from the caller.
    
    Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    devdekunle authored and gitster committed Feb 17, 2026
    Configuration menu
    Copy the full SHA
    5708809 View commit details
    Browse the repository at this point in the history
  3. add-patch: allow all-or-none application of patches

    When the flag `--no-auto-advance` is used with `--patch`,
    if the user has decided `USE` on a hunk in a file, goes to another
    file, and then returns to this file and changes the previous
    decision on the hunk to `SKIP`, because the patch has already
    been applied, the last decision is not registered and the now
    SKIPPED hunk is still applied.
    
    Move the logic for applying patches into a function so that we can
    reuse this logic to implement the all or non application of the patches
    after the user is done with the hunk selection.
    
    Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    devdekunle authored and gitster committed Feb 17, 2026
    Configuration menu
    Copy the full SHA
    d3cce5e View commit details
    Browse the repository at this point in the history
  4. add-patch: allow interfile navigation when selecting hunks

    After deciding on all hunks in a file, the interactive session
    advances automatically to the next file if there is another,
    or the process ends.
    
    Now using the `--no-auto-advance` flag with `--patch`, the process
    does not advance automatically. A user can choose to go to the next
    file by pressing '>' or the previous file by pressing '<', before or
    after deciding on all hunks in the current file.
    
    After all hunks have been decided in a file, the user can still
    rework with the file by applying the options available in the permit
    set for that hunk, and after all the decisions, the user presses 'q'
    to submit.
    After all hunks have been decided, the user can press '?' which will
    show the hunk selection summary in the help patch remainder text
    including the total hunks, number of hunks marked for use and number
    of hunks marked for skip.
    
    This feature is enabled by passing the `--no-auto-advance` flag
    to `--patch` option of the subcommands add, stash, reset,
    and checkout.
    
    Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    devdekunle authored and gitster committed Feb 17, 2026
    Configuration menu
    Copy the full SHA
    417b181 View commit details
    Browse the repository at this point in the history
Loading