Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range-diff: support reading mbox files #1420

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Dec 6, 2022

  1. range-diff: support reading mbox files

    Internally, the `git range-diff` command spawns a `git log` process and
    parses its output for the given commit ranges.
    
    This works well when the patches that need to be compared are present in
    the local repository in the form of commits.
    
    In scenarios where that is not the case, the `range-diff` command is
    currently less helpful.
    
    The Git mailing list is such a scenario: Instead of using Git to
    exchange commits, the patches are sent there as plain-text and no commit
    range can be specified to let `range-diff` consume those patches.
    
    Instead, the expectation is to download the mails, apply them locally
    and then use `range-diff`. This can be quite cumbersome e.g. when a
    suitable base revision has to be found first where the patch applies
    cleanly.
    
    Let's offer a way to read those patches from pre-prepared MBox files
    instead when an argument "mbox:<filename>" is passed instead of a commit
    range.
    
    For extra convenience, interpret the filename `-` as standard input.
    This makes it easy to compare contributions on the mailing list with the
    actual commits that were integrated into Git's main branch. Example:
    
    	commit=5c4003ca3f0e9ac6d3c8aa3e387ff843bd440411
    	mid=bdfa3845b81531863941e6a97c28eb1afa62dd2c.1489435755.git.johannes.schindelin@gmx.de
    	curl -s https://lore.kernel.org/git/$mid/raw |
    	git range-diff mbox:- $commit^!
    
    This addresses gitgitgadget#207
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    5bb19a1 View commit details
    Browse the repository at this point in the history
  2. fixup! range-diff: support reading mbox files

    Undo long header handling, will redo in a bit.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    b0aa940 View commit details
    Browse the repository at this point in the history
  3. fixup! range-diff: optionally accept pathspecs

    Undo in-body handling; will redo in a moment.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    c372848 View commit details
    Browse the repository at this point in the history
  4. range-diff(mbox): grok long header lines

    The mbox format allows for long header values to be broken apart into
    78-column wide chunks. Parse those, so that even long commit titles are
    handled correctly.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    74008a6 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2023

  1. WIP

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    4b98885 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. WIP

    Need to add a test for a bare diff (i.e. without commit message), to
    allow things like:
    
    	git range-diff $COMMIT^! mbox:<(git diff HEAD)
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    15d1b8a View commit details
    Browse the repository at this point in the history