]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei rediff: `git diff -O<order-file>' support
authorEric Wong <e@80x24.org>
Sun, 1 Oct 2023 09:54:22 +0000 (09:54 +0000)
committerEric Wong <e@80x24.org>
Sun, 1 Oct 2023 22:41:45 +0000 (22:41 +0000)
We can't use the `-O' switch since it conflicts with
--only|-O= to specify externals.  Thus we'll introduce
a more verbose `--order-file=FILE' option when running
`git diff'.

lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiRediff.pm

index beb0f89799090d9c00494897d72992e99f250b81..48c5644b182eec0af91581e6d65d09849bed0fd2 100644 (file)
@@ -159,7 +159,7 @@ our @diff_opt = qw(unified|U=i output-indicator-new=s output-indicator-old=s
        rename-empty! check ws-error-highlight=s full-index binary
        abbrev:i break-rewrites|B:s find-renames|M:s find-copies:s
        find-copies-harder irreversible-delete|D l=i diff-filter=s
-       S=s G=s find-object=s pickaxe-all pickaxe-regex O=s R
+       S=s G=s find-object=s pickaxe-all pickaxe-regex R
        relative:s text|a ignore-cr-at-eol ignore-space-at-eol
        ignore-space-change|b ignore-all-space|w ignore-blank-lines
        inter-hunk-context=i function-context|W exit-code ext-diff
@@ -198,8 +198,8 @@ our %CMD = ( # sorted in order of importance/use:
 'rediff' => [ '--stdin|LOCATION...',
                'regenerate a diff with different options',
        'stdin|', # /|\z/ must be first for lone dash
-       qw(git-dir=s@ cwd! verbose|v+ color:s no-color drq:1 dequote-only:1),
-       @diff_opt, @lxs_opt, @net_opt, @c_opt ],
+       qw(git-dir=s@ cwd! verbose|v+ color:s no-color drq:1 dequote-only:1
+       order-file=s), @diff_opt, @lxs_opt, @net_opt, @c_opt ],
 
 'mail-diff' => [ '--stdin|LOCATION...', 'diff the contents of emails',
        'stdin|', # /|\z/ must be first for lone dash
index efd24d174b62218df58d24def2845546abf2137b..6cc6131be3ddcc544ecf5ae430643f67f20219d3 100644 (file)
@@ -82,6 +82,7 @@ sub _lei_diff_prepare ($$) {
                        push @$cmd, $c ? "-$c" : "--$o";
                }
        }
+       push(@$cmd, "-O$opt->{'order-file'}") if $opt->{'order-file'};
 }
 
 sub diff_ctxq ($$) {