diff options
Diffstat (limited to '')
-rwxr-xr-x | kern | 9 | ||||
-rw-r--r-- | kern.1 | 4 |
2 files changed, 10 insertions, 3 deletions
@@ -77,7 +77,12 @@ config_kernel() { diff_kernel() { diff=${1:-$(get_running_config)} - nvim -d .config "$diff" + + if command -v git >/dev/null; then + git diff --no-index "$diff" .config + else + diff -u "$diff" .config + fi } build_kernel() { @@ -101,7 +106,7 @@ test_diff() { dt=$(mktemp) sed -nE '/^(# )?CONFIG_.*/p' "$(get_running_config)" > "$dt" if ! sed -nE '/^(# )?CONFIG_.*/p' .config | diff -q "$dt" -; then - diff_kernel + diff_kernel || true printf "Continue? [y/N] " read -r response if test "$response" != "y"; then @@ -97,7 +97,9 @@ If no template is given, this command uses the output of as the template name. .It Sy diff Op Ar config Uses -.Xr nvim 1 +.Xr git-diff 1 +if available, otherwise +.Xr diff 1 to display the differences between the generated kernel configuration and .Em config . .Pp |