Repository: dandavison/delta
Pull request #612 (2021-05-25 06:42:07)

Bump git2 from 0.13.18 to 0.13.20
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some time.

Note: if you make any changes to this PR yourself, they will take precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.13.18 to 0.13.20.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-lang/git2-rs/commit/910394149da909ae5f2a2279b2f3a0a3b254c8f6"><code>9103941</code></a> Bump to 0.13.20</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/290c68d020581f65e3776a267c0cb256e595fc9d"><code>290c68d</code></a> Bump libgit2-sys to 0.12.21+1.1.0</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/b673a5cc4e5a75e10e91774f96c77615e8981b2b"><code>b673a5c</code></a> Add support for specifying additional custom headers on git push and fetch op...</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/e16e16a935949b739fc8e618106c5e7c4ce8a8a3"><code>e16e16a</code></a> Update git2 to compile with latest rustc nightly (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/712">#712</a>)</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/0a64419db9fdca65f110e320d21d667d1d4a8ce0"><code>0a64419</code></a> update libgit2 submodule to recent main (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/708">#708</a>)</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/81b9cf9cd03351bd1b4c0c6bd0feb30891ddb2b7"><code>81b9cf9</code></a> Skip the systest tests on nightly rust (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/709">#709</a>)</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/9972c24281588a05f70adbcfe58d90280dc0b20a"><code>9972c24</code></a> Bump to 0.13.19</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/c32adc0572f3460ec87447459f0a27b7087ab7bd"><code>c32adc0</code></a> Bump to 0.12.20+1.1.0</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/2358d2c30c54517cfa5e5ad5455c3d5f6ee1dfae"><code>2358d2c</code></a> added git_repository_mergehead_foreach (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/707">#707</a>)</li>
<li><a href="https://github.com/rust-lang/git2-rs/commit/1b1499a78dc04c042aa7789f81f0a3308b66261b"><code>1b1499a</code></a> update libgit2 submodule to recent main (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/704">#704</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/git2-rs/compare/0.13.18...0.13.20">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=git2&package-manager=cargo&previous-version=0.13.18&new-version=0.13.20)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 0db780e..ac71cc7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17,9 +17,9 @@ dependencies = [
 
 [[package]]
 name = "ansi_colours"
-version = "1.0.1"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6add8b6"
+checksum = "52cb663b84aea8670b4a40368360e29485c11b03d14ff6283261aeccd69d5ce1"
 dependencies = [
  "cc",
 ]
@@ -258,7 +258,7 @@ dependencies = [
 
 [[package]]
 name = "git-delta"
-version = "0.7.1"
+version = "0.8.1"
 dependencies = [
  "ansi_colours",
  "ansi_term 0.12.1",
@@ -285,9 +285,9 @@ dependencies = [
 
 [[package]]
 name = "git2"
-version = "0.13.18"
+version = "0.13.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b483c6c2145421099df1b4efd50e0f6205479a072199460eff852fa15e5603c7"
+checksum = "d9831e983241f8c5591ed53f17d874833e2fa82cac2625f3888c50cbfe136cba"
 dependencies = [
  "bitflags",
  "libc",
@@ -346,9 +346,9 @@ dependencies = [
 
 [[package]]
 name = "itertools"
-version = "0.10.0"
+version = "0.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319"
+checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
 dependencies = [
  "either",
 ]
@@ -388,9 +388,9 @@ checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
 
 [[package]]
 name = "libgit2-sys"
-version = "0.12.19+1.1.0"
+version = "0.12.21+1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f322155d574c8b9ebe991a04f6908bb49e68a79463338d24a43d6274cb6443e6"
+checksum = "86271bacd72b2b9e854c3dcfb82efd538f15f870e4c11af66900effb462f6825"
 dependencies = [
  "cc",
  "libc",
@@ -830,9 +830,9 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
 
 [[package]]
 name = "vte"
-version = "0.10.0"
+version = "0.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2df25fed2855d2fbcbdf1016c69a6ac070fa1aabc8b5d7aedaab8703dce0d2d6"
+checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983"
 dependencies = [
  "arrayvec",
  "utf8parse",
diff --git a/Cargo.toml b/Cargo.toml
index 55ec3b0..0261406 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,14 +8,14 @@ edition = "2018"
 homepage = "https://github.com/dandavison/delta"
 license = "MIT"
 repository = "https://github.com/dandavison/delta"
-version = "0.7.1"
+version = "0.8.1"
 
 [[bin]]
 name = "delta"
 path = "src/main.rs"
 
 [dependencies]
-ansi_colours = "1.0.1"
+ansi_colours = "1.0.2"
 ansi_term = "0.12.1"
 atty = "0.2.14"
 bitflags = "1.2.1"
@@ -23,7 +23,7 @@ box_drawing = "0.1.2"
 bytelines = "2.2.2"
 console = "0.14.1"
 dirs-next = "2.0.0"
-itertools = "0.10.0"
+itertools = "0.10.1"
 lazy_static = "1.4"
 pathdiff = "0.2.0"
 regex = "1.4.6"
@@ -31,11 +31,11 @@ shell-words = "1.0.0"
 structopt = "0.3.21"
 unicode-segmentation = "1.7.1"
 unicode-width = "0.1.8"
-vte = "0.10.0"
+vte = "0.10.1"
 xdg = "2.2.0"
 
 [dependencies.git2]
-version = "0.13.18"
+version = "0.13.20"
 default-features = false
 features = []
 
diff --git a/HomeBrewFormula/git-delta.rb b/HomeBrewFormula/git-delta.rb
index 1661a9e..98d5deb 100644
--- a/HomeBrewFormula/git-delta.rb
+++ b/HomeBrewFormula/git-delta.rb
@@ -1,5 +1,5 @@
 class GitDelta < Formula
-  version "0.6.0"
+  version "0.8.0"
   desc "A viewer for git and diff output"
   homepage "https://github.com/dandavison/delta"
 
@@ -7,10 +7,10 @@ class GitDelta < Formula
 
   if OS.mac?
       url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-apple-darwin.tar.gz"
-      sha256 "d6368d3004fd39f4d1665a8fb91867d8e96f5ed59ef271925c41de6090fe44cb"
+      sha256 "c60122857345dd3d43f5cdb66d85d7647dbc60bbabfc03850045ad6e090d2450"
   elsif OS.linux?
       url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-unknown-linux-musl.tar.gz"
-      sha256 "7c5ddf43cb3b0f0640654df00ea31bf509bc364827793b93d0d5600ead0704beg"
+      sha256 "f57c6490f511e8ed0526f2171b28d95aca09a0e161b37400fd85d9aa03bfffd7"
   end
 
   conflicts_with "delta"
diff --git a/README.md b/README.md
index bda9f68..c5f4056 100644
--- a/README.md
+++ b/README.md
@@ -49,14 +49,19 @@ Code evolves, and we all spend time studying diffs. Delta aims to make this both
 - Support for Git's `--color-moved` feature.
 - Code can be copied directly from the diff (`-/+` markers are removed by default).
 - `n` and `N` keybindings to move between files in large diffs, and between diffs in `log -p` views (`--navigate`)
+- Commit hashes can be formatted as terminal [hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) to the Github/GitLab/Bitbucket page (`--hyperlinks`).
+  File paths can also be formatted as hyperlinks for opening in your OS.
 
 The most convenient way to configure delta is with a `[delta]` section in `~/.gitconfig`. Here's a quick example:
 
 <sub>
 
 ```gitconfig
-[core]
-    pager = delta
+[pager]
+    diff = delta
+    log = delta
+    reflog = delta
+    show = delta
 
 [interactive]
     diffFilter = delta --color-only
@@ -85,7 +90,7 @@ git -c delta.line-numbers=false show
 
 - [Installation](#installation)
 - [Configuration](#configuration)
-  - [Git config files](#git-config-files)
+  - [Git config files](#git-config-file)
   - [Environment](#environment)
 - [Usage](#usage)
   - [Choosing colors (styles)](#choosing-colors-styles)
@@ -196,7 +201,7 @@ In addition, delta handles traditional unified diff output.
 
 ## Installation
 
-You can download an executable for your system: [Linux](https://github.com/dandavison/delta/releases/download/0.6.0/delta-0.6.0-x86_64-unknown-linux-gnu.tar.gz) | [MacOS (recent versions)](https://github.com/dandavison/delta/releases/download/0.6.0/delta-0.6.0-x86_64-apple-darwin.tar.gz) | [Windows](https://github.com/dandavison/delta/releases/download/0.6.0/delta-0.6.0-x86_64-pc-windows-msvc.zip) | [All](https://github.com/dandavison/delta/releases)
+You can download an executable for your system: [Linux](https://github.com/dandavison/delta/releases/download/0.8.0/delta-0.8.0-x86_64-unknown-linux-gnu.tar.gz) | [MacOS (recent versions)](https://github.com/dandavison/delta/releases/download/0.8.0/delta-0.8.0-x86_64-apple-darwin.tar.gz) | [Windows](https://github.com/dandavison/delta/releases/download/0.8.0/delta-0.8.0-x86_64-pc-windows-msvc.zip) | [All](https://github.com/dandavison/delta/releases)
 
 Alternatively, delta is available in the following package managers:
 
@@ -274,17 +279,22 @@ Users of older MacOS versions (e.g. 10.11 El Capitan) should install using Homeb
 
 See [repology.org/git-delta](https://repology.org/project/git-delta/versions) for the current version in each package repository.
 
-Behind the scenes, delta uses `less` for paging. The version of `less` that comes with your operating system may be too old (currently, less v551 is a good choice). On MacOS, install `less` from Homebrew. For Windows, see [Using Delta on Windows](#using-delta-on-windows).
+Behind the scenes, delta uses [`less`](https://www.greenwoodsoftware.com/less/) for paging.
+It's important to have a reasonably recent version of less installed.
+On MacOS, install `less` from Homebrew. For Windows, see [Using Delta on Windows](#using-delta-on-windows).
 
 ## Configuration
 
-#### Git config files
+#### Git config file
 
-Set delta to be git's pager in your `.gitconfig`. Delta has many options to alter colors and other details of the output; `delta --help` shows them all. An example is
+Set delta to be the pager for git commands in your `.gitconfig`. Delta has many options to alter colors and other details of the output; `delta --help` shows them all. An example is
 
 ```gitconfig
-[core]
-    pager = delta
+[pager]
+    diff = delta
+    log = delta
+    reflog = delta
+    show = delta
 
 [delta]
     plus-style = "syntax #012800"
@@ -611,7 +621,7 @@ and use the executable found at `./target/release/delta`.
 ## Full --help output
 
 ```
-delta 0.7.1
+delta 0.8.0
 A viewer for git and diff output
 
 USAGE:
@@ -629,6 +639,8 @@ FLAGS:
         --navigate                   Activate diff navigation: use n to jump forwards and N to jump backwards. To change
                                      the file labels used see --file-modified-label, --file-removed-label, --file-added-
                                      label, --file-renamed-label
+        --relative-paths             Output all file paths relative to the current directory so that they resolve
+                                     correctly when clicked on or used in shell commands
         --hyperlinks                 Render commit hashes, file names, and line numbers as hyperlinks, according to the
                                      hyperlink spec for terminal emulators:
                                      https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By default,
@@ -636,9 +648,9 @@ FLAGS:
                                      hashes link to the commit in GitHub, if the remote repository is hosted by GitHub.
                                      See --hyperlinks-file-link-format for full control over the file URLs emitted.
                                      Hyperlinks are supported by several common terminal emulators. To make them work,
-                                     you must pass the -r (as opposed to -R) flag to less, e.g. via `export
-                                     DELTA_PAGER=less -rX`. If you use tmux, then you will also need a patched fork of
-                                     tmux (see https://github.com/dandavison/tmux)
+                                     you must use less version >= 581 with the -R flag (or use -r with older less
+                                     versions, but this will break e.g. --navigate). If you use tmux, then you will also
+                                     need a patched fork of tmux (see https://github.com/dandavison/tmux)
         --keep-plus-minus-markers    Prefix added/removed lines with a +/- character, exactly as git does. By default,
                                      delta does not emit any prefix, so code can be copied directly from delta's output
         --show-config                Display the active values for all Delta options. Style options are displayed with
@@ -701,6 +713,9 @@ OPTIONS:
             Style (foreground, background, attributes) for the commit hash decoration. See STYLES section. The style
             string should contain one of the special attributes 'box', 'ul' (underline), 'ol' (overline), or the
             combination 'ul ol' [default: ]
+        --commit-regex <commit-regex>
+            The regular expression used to identify the commit line when parsing git output [default: ^commit ]
+
         --file-style <file-style>
             Style (foreground, background, attributes) for the file section. See STYLES section. The style 'omit' can be
             used to remove the file section from the output [default: blue]
@@ -708,14 +723,18 @@ OPTIONS:
             Style (foreground, background, attributes) for the file decoration. See STYLES section. The style string
             should contain one of the special attributes 'box', 'ul' (underline), 'ol' (overline), or the combination
             'ul ol' [default: blue ul]
+        --hyperlinks-commit-link-format <hyperlinks-commit-link-format>
+            Format string for commit hyperlinks (requires --hyperlinks). The placeholder "{commit}" will be replaced by
+            the commit hash. For example: --hyperlinks-commit-link-format='https://mygitrepo/{commit}/'
         --hyperlinks-file-link-format <hyperlinks-file-link-format>
-            Format string for file hyperlinks. The placeholders "{path}" and "{line}" will be replaced by the absolute
-            file path and the line number, respectively. The default value of this option creates hyperlinks using
-            standard file URLs; your operating system should open these in the application registered for that file
-            type. However, these do not make use of the line number. In order for the link to open the file at the
-            correct line number, you could use a custom URL format such as "file-line://{path}:{line}" and register an
-            application to handle the custom "file-line" URL scheme by opening the file in your editor/IDE at the
-            indicated line number. See https://github.com/dandavison/open-in-editor for an example [default: file://{path}]
+            Format string for file hyperlinks (requires --hyperlinks). The placeholders "{path}" and "{line}" will be
+            replaced by the absolute file path and the line number, respectively. The default value of this option
+            creates hyperlinks using standard file URLs; your operating system should open these in the application
+            registered for that file type. However, these do not make use of the line number. In order for the link to
+            open the file at the correct line number, you could use a custom URL format such as "file-
+            line://{path}:{line}" and register an application to handle the custom "file-line" URL scheme by
+            opening the file in your editor/IDE at the indicated line number. See https://github.com/dandavison/open-in-
+            editor for an example [default: file://{path}]
         --hunk-header-style <hunk-header-style>
             Style (foreground, background, attributes) for the hunk-header. See STYLES section. Special attributes
             'file' and 'line-number' can be used to include the file path, and number of first hunk line, in the hunk
@@ -784,17 +803,21 @@ OPTIONS:
     -w, --width <width>
             The width of underline/overline decorations. Use --width=variable to extend decorations and background
             colors to the end of the text only. Otherwise background colors extend to the full terminal width
+        --diff-stat-align-width <diff-stat-align-width>
+            Width allocated for file paths in a diff stat section. If a relativized file path exceeds this width then
+            the diff stat will be misaligned [default: 48]
         --tabs <tab-width>
             The number of spaces to replace tab characters with. Use --tabs=0 to pass tab characters through directly,
             but note that in that case delta will calculate line widths assuming tabs occupy one character's width on
             the screen: if your terminal renders tabs as more than than one character wide then delta's output will look
             incorrect [default: 4]
-        --24-bit-color <true-color>
+        --true-color <true-color>
             Whether to emit 24-bit ("true color") RGB color codes. Options are auto, always, and never. "auto" means
             that delta will emit 24-bit color codes if the environment variable COLORTERM has the value "truecolor" or
             "24bit". If your terminal application (the application you use to enter commands at a shell prompt) supports
             24 bit colors, then it probably already sets this environment variable, in which case you don't need to do
             anything [default: auto]
+        --24-bit-color <24-bit-color>                                      Deprecated: use --true-color
         --inspect-raw-lines <inspect-raw-lines>
             Whether to examine ANSI color escape sequences in raw lines received from Git and handle lines colored in
             certain ways specially. This is on by default: it is how Delta supports Git's --color-moved feature. Set
diff --git a/src/bat_utils/output.rs b/src/bat_utils/output.rs
index 388bc0c..1166b4e 100644
--- a/src/bat_utils/output.rs
+++ b/src/bat_utils/output.rs
@@ -29,7 +29,7 @@ pub enum OutputType {
 impl OutputType {
     pub fn from_mode(
         mode: PagingMode,
-        pager: Option<&str>,
+        pager: Option<String>,
         config: &config::Config,
     ) -> Result<Self> {
         use self::PagingMode::*;
@@ -43,7 +43,7 @@ impl OutputType {
     /// Try to launch the pager. Fall back to stdout in case of errors.
     fn try_pager(
         quit_if_one_screen: bool,
-        pager_from_config: Option<&str>,
+        pager_from_config: Option<String>,
         config: &config::Config,
     ) -> Result<Self> {
         let mut replace_arguments_to_less = false;
@@ -66,8 +66,6 @@ impl OutputType {
             _ => None,
         };
 
-        let pager_from_config = pager_from_config.map(|p| p.to_string());
-
         if pager_from_config.is_some() {
             replace_arguments_to_less = false;
         }
diff --git a/src/cli.rs b/src/cli.rs
index 40629bc..72e91b5 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -237,15 +237,17 @@ pub struct Opt {
     pub relative_paths: bool,
 
     #[structopt(long = "hyperlinks")]
-    /// Render commit hashes, file names, and line numbers as hyperlinks, according to the
-    /// hyperlink spec for terminal emulators:
-    /// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By default, file names
-    /// and line numbers link to the local file using a file URL, whereas commit hashes link to the
-    /// commit in GitHub, if the remote repository is hosted by GitHub. See
-    /// --hyperlinks-file-link-format for full control over the file URLs emitted. Hyperlinks are
-    /// supported by several common terminal emulators. To make them work, you must pass the -r (as
-    /// opposed to -R) flag to less, e.g. via `export DELTA_PAGER=less -rX`. If you use tmux, then
-    /// you will also need a patched fork of tmux (see https://github.com/dandavison/tmux).
+    /// Render commit hashes, file names, and line numbers as hyperlinks,
+    /// according to the hyperlink spec for terminal emulators:
+    /// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By
+    /// default, file names and line numbers link to the local file using a file
+    /// URL, whereas commit hashes link to the commit in GitHub, if the remote
+    /// repository is hosted by GitHub. See --hyperlinks-file-link-format for
+    /// full control over the file URLs emitted. Hyperlinks are supported by
+    /// several common terminal emulators. To make them work, you must use less
+    /// version >= 581 with the -R flag (or use -r with older less versions, but
+    /// this will break e.g. --navigate). If you use tmux, then you will also
+    /// need a patched fork of tmux (see https://github.com/dandavison/tmux).
     pub hyperlinks: bool,
 
     #[structopt(long = "keep-plus-minus-markers")]
@@ -372,14 +374,23 @@ pub struct Opt {
     /// (overline), or the combination 'ul ol'.
     pub file_decoration_style: String,
 
-    /// Format string for file hyperlinks. The placeholders "{path}" and "{line}" will be replaced
-    /// by the absolute file path and the line number, respectively. The default value of this
-    /// option creates hyperlinks using standard file URLs; your operating system should open these
-    /// in the application registered for that file type. However, these do not make use of the
-    /// line number. In order for the link to open the file at the correct line number, you could
-    /// use a custom URL format such as "file-line://{path}:{line}" and register an application to
-    /// handle the custom "file-line" URL scheme by opening the file in your editor/IDE at the
-    /// indicated line number. See https://github.com/dandavison/open-in-editor for an example.
+    /// Format string for commit hyperlinks (requires --hyperlinks). The
+    /// placeholder "{commit}" will be replaced by the commit hash. For example:
+    /// --hyperlinks-commit-link-format='https://mygitrepo/{commit}/'
+    #[structopt(long = "hyperlinks-commit-link-format")]
+    pub hyperlinks_commit_link_format: Option<String>,
+
+    /// Format string for file hyperlinks (requires --hyperlinks). The
+    /// placeholders "{path}" and "{line}" will be replaced by the absolute file
+    /// path and the line number, respectively. The default value of this option
+    /// creates hyperlinks using standard file URLs; your operating system
+    /// should open these in the application registered for that file type.
+    /// However, these do not make use of the line number. In order for the link
+    /// to open the file at the correct line number, you could use a custom URL
+    /// format such as "file-line://{path}:{line}" and register an application
+    /// to handle the custom "file-line" URL scheme by opening the file in your
+    /// editor/IDE at the indicated line number. See
+    /// https://github.com/dandavison/open-in-editor for an example.
     #[structopt(long = "hyperlinks-file-link-format", default_value = "file://{path}")]
     pub hyperlinks_file_link_format: String,
 
@@ -521,9 +532,14 @@ pub struct Opt {
     #[structopt(long = "inspect-raw-lines", default_value = "true")]
     pub inspect_raw_lines: String,
 
-    /// Whether to use a pager when displaying output. Options are: auto, always, and never. The
-    /// default pager is `less`: this can be altered by setting the environment variables
-    /// DELTA_PAGER, BAT_PAGER, or PAGER (and that is their order of priority).
+    #[structopt(long)]
+    /// Which pager to use. The default pager is `less`. You can also change pager
+    /// by setting the environment variables DELTA_PAGER, BAT_PAGER, or PAGER
+    /// (and that is their order of priority). This option overrides all environment
+    /// variables above.
+    pub pager: Option<String>,
+
+    /// Whether to use a pager when displaying output. Options are: auto, always, and never.
     #[structopt(long = "paging", default_value = "auto")]
     pub paging_mode: String,
 
diff --git a/src/config.rs b/src/config.rs
index 8d72fb3..573a08e 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -41,6 +41,7 @@ pub struct Config {
     pub hunk_header_style_include_file_path: bool,
     pub hunk_header_style_include_line_number: bool,
     pub hyperlinks: bool,
+    pub hyperlinks_commit_link_format: Option<String>,
     pub hyperlinks_file_link_format: String,
     pub inspect_raw_lines: cli::InspectRawLines,
     pub keep_plus_minus_markers: bool,
@@ -65,6 +66,7 @@ pub struct Config {
     pub navigate_regexp: Option<String>,
     pub null_style: Style,
     pub null_syntect_style: SyntectStyle,
+    pub pager: Option<String>,
     pub paging_mode: PagingMode,
     pub plus_emph_style: Style,
     pub plus_empty_line_marker_style: Style,
@@ -220,6 +222,7 @@ impl From<cli::Opt> for Config {
                 .split(' ')
                 .any(|s| s == "line-number"),
             hyperlinks: opt.hyperlinks,
+            hyperlinks_commit_link_format: opt.hyperlinks_commit_link_format,
             hyperlinks_file_link_format: opt.hyperlinks_file_link_format,
             inspect_raw_lines: opt.computed.inspect_raw_lines,
             keep_plus_minus_markers: opt.keep_plus_minus_markers,
@@ -244,6 +247,7 @@ impl From<cli::Opt> for Config {
             navigate_regexp,
             null_style: Style::new(),
             null_syntect_style: SyntectStyle::default(),
+            pager: opt.pager,
             paging_mode: opt.computed.paging_mode,
             plus_emph_style,
             plus_empty_line_marker_style,
diff --git a/src/features/diff_highlight.rs b/src/features/diff_highlight.rs
index 0f4d5de..630099e 100644
--- a/src/features/diff_highlight.rs
+++ b/src/features/diff_highlight.rs
@@ -12,6 +12,12 @@ pub fn _make_feature(bold: bool) -> Vec<(String, OptionValueFunction)> {
         .filter(|(s, _)| s != "keep-plus-minus-markers" && s != "tabs")
         .collect();
     feature.extend(builtin_feature!([
+        (
+            "commit-style",
+            String,
+            Some("color.diff.commit"),
+            _opt => "raw"
+        ),
         (
             "minus-style",
             String,
diff --git a/src/features/diff_so_fancy.rs b/src/features/diff_so_fancy.rs
index 3898dac..d9849a0 100644
--- a/src/features/diff_so_fancy.rs
+++ b/src/features/diff_so_fancy.rs
@@ -16,12 +16,6 @@ pub fn make_feature() -> Vec<(String, OptionValueFunction)> {
             Some("color.diff-highlight.newHighlight"),
             _opt => "bold green 22"
         ),
-        (
-            "commit-style",
-            String,
-            Some("color.diff.commit"),
-            _opt => "bold yellow"
-        ),
         (
             "file-style",
             String,
@@ -64,7 +58,7 @@ pub mod tests {
             None,
         );
 
-        assert_eq!(opt.commit_style, "bold yellow");
+        assert_eq!(opt.commit_style, "raw");
         assert_eq!(opt.commit_decoration_style, "none");
 
         assert_eq!(opt.file_style, "11");
diff --git a/src/features/hyperlinks.rs b/src/features/hyperlinks.rs
index d59f5e9..bf0c235 100644
--- a/src/features/hyperlinks.rs
+++ b/src/features/hyperlinks.rs
@@ -22,7 +22,12 @@ pub fn format_commit_line_with_osc8_commit_hyperlink<'a>(
     line: &'a str,
     config: &Config,
 ) -> Cow<'a, str> {
-    if let Some(GitConfigEntry::GitRemote(GitRemoteRepo::GitHubRepo(repo))) =
+    if let Some(commit_link_format) = &config.hyperlinks_commit_link_format {
+        COMMIT_LINE_REGEX.replace(line, |captures: &Captures| {
+            let commit = captures.get(2).unwrap().as_str();
+            format_osc8_hyperlink(&commit_link_format.replace("{commit}", commit), commit)
+        })
+    } else if let Some(GitConfigEntry::GitRemote(GitRemoteRepo::GitHubRepo(repo))) =
         config.git_config_entries.get("remote.origin.url")
     {
         COMMIT_LINE_REGEX.replace(line, |captures: &Captures| {
@@ -51,18 +56,22 @@ pub fn format_osc8_file_hyperlink<'a>(
         } else {
             url = url.replace("{line}", "")
         };
-        Cow::from(format!(
-            "{osc}8;;{url}{st}{text}{osc}8;;{st}",
-            url = url,
-            text = text,
-            osc = "\x1b]",
-            st = "\x1b\\"
-        ))
+        Cow::from(format_osc8_hyperlink(&url, text))
     } else {
         Cow::from(relative_path)
     }
 }
 
+fn format_osc8_hyperlink(url: &str, text: &str) -> String {
+    format!(
+        "{osc}8;;{url}{st}{text}{osc}8;;{st}",
+        url = url,
+        text = text,
+        osc = "\x1b]",
+        st = "\x1b\\"
+    )
+}
+
 lazy_static! {
     static ref COMMIT_LINE_REGEX: Regex = Regex::new("(.* )([0-9a-f]{40})(.*)").unwrap();
 }
diff --git a/src/main.rs b/src/main.rs
index cbeb0bc..d6ed0aa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -82,7 +82,8 @@ fn run_app() -> std::io::Result<i32> {
         return Ok(0);
     }
 
-    let mut output_type = OutputType::from_mode(config.paging_mode, None, &config).unwrap();
+    let mut output_type =
+        OutputType::from_mode(config.paging_mode, config.pager.clone(), &config).unwrap();
     let mut writer = output_type.handle().unwrap();
 
     if atty::is(atty::Stream::Stdin) {
@@ -246,6 +247,7 @@ fn show_config(config: &config::Config, writer: &mut dyn Write) -> std::io::Resu
     max-line-length               = {max_line_length}
     navigate                      = {navigate}
     navigate-regexp               = {navigate_regexp}
+    pager                         = {pager}
     paging                        = {paging_mode}
     side-by-side                  = {side_by_side}
     syntax-theme                  = {syntax_theme}
@@ -259,6 +261,7 @@ fn show_config(config: &config::Config, writer: &mut dyn Write) -> std::io::Resu
             None => "".to_string(),
             Some(s) => s.to_string(),
         },
+        pager = config.pager.clone().unwrap_or_else(|| "none".to_string()),
         paging_mode = match config.paging_mode {
             PagingMode::Always => "always",
             PagingMode::Never => "never",
diff --git a/src/options/set.rs b/src/options/set.rs
index b27907e..ef0a259 100644
--- a/src/options/set.rs
+++ b/src/options/set.rs
@@ -142,6 +142,7 @@ pub fn set_options(
             hunk_header_line_number_style,
             hunk_header_style,
             hyperlinks,
+            hyperlinks_commit_link_format,
             hyperlinks_file_link_format,
             inspect_raw_lines,
             keep_plus_minus_markers,
@@ -164,6 +165,7 @@ pub fn set_options(
             line_numbers_right_format,
             line_numbers_right_style,
             line_numbers_zero_style,
+            pager,
             paging_mode,
             // Hack: plus-style must come before plus-*emph-style because the latter default
             // dynamically to the value of the former.
diff --git a/src/options/theme.rs b/src/options/theme.rs
index fa5cbef..52de3ea 100644
--- a/src/options/theme.rs
+++ b/src/options/theme.rs
@@ -35,7 +35,7 @@ pub fn set__is_light_mode__syntax_theme__syntax_set(
 }
 
 pub fn is_light_syntax_theme(theme: &str) -> bool {
-    LIGHT_SYNTAX_THEMES.contains(&theme)
+    LIGHT_SYNTAX_THEMES.contains(&theme) || theme.to_lowercase().contains("light")
 }
 
 const LIGHT_SYNTAX_THEMES: [&str; 6] = [


Test patch:
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs
index 82b12f5..7c7192e 100644
--- a/src/tests/test_example_diffs.rs
+++ b/src/tests/test_example_diffs.rs
@@ -1591,6 +1591,23 @@ src/align.rs:71: impl<'a> Alignment<'a> { │
         assert!(output.contains(r"src/delta.rs: mode -x"));
     }
 
+    #[test]
+    fn test_hyperlinks_commit_link_format() {
+        let config = integration_test_utils::make_config_from_args(&[
+            // If commit-style is not set then the commit line is handled in raw
+            // mode, in which case we only format hyperlinks if output is a tty;
+            // this causes the test to fail on Github Actions, but pass locally
+            // if output is left going to the screen.
+            "--commit-style",
+            "blue",
+            "--hyperlinks",
+            "--hyperlinks-commit-link-format",
+            "https://invent.kde.org/utilities/konsole/-/commit/{commit}",
+        ]);
+        let output = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, &config);
+        assert!(output.contains(r"https://invent.kde.org/utilities/konsole/-/commit/94907c0f136f46dc46ffae2dc92dca9af7eb7c2e"));
+    }
+
     const GIT_DIFF_SINGLE_HUNK: &str = "\
 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
 Author: Dan Davison <dandavison7@gmail.com>