nnn/patches
2024-02-09 23:14:56 +05:30
..
colemak Add option to rm -rf irrespective of trash setting 2024-02-09 23:14:56 +05:30
gitstatus Fix patch build errors 2023-09-20 23:41:54 +05:30
namefirst show relative line numbering when jumping 2024-02-03 09:53:11 +00:00
restorepreview show relative line numbering when jumping 2024-02-03 09:53:11 +00:00
check-patches.sh Fix checkpatches duplicate make 2022-07-18 18:28:15 +05:30
README.md rm colemak-dh 2023-09-30 22:25:23 +06:00

User Patch Framework

This directory contains sizable user submitted patches that were rejected from mainline as they tend to be more subjective in nature.

The patches will be adapted on each release when necessary (v4.1 onwards). Each patch can be applied through its respective make variable during compilation. In case inter-patch merge conflicts occur, a compatibility patch is provided and will automatically be applied.

List of patches

Patch (a-z) Description Make var
colemak Key bindings for Colemak keyboard layout O_COLEMAK
gitstatus Add git status column to the detail view. Provides command line flag -G to show column in normal mode. O_GITSTATUS
namefirst Print filenames first in the detail view. Print user/group columns when a directory contains different users/groups. O_NAMEFIRST
restorepreview Add pipe to close and restore preview-tui for internal undetached edits (e key) O_RESTOREPREVIEW

To apply a patch, use the corresponding make variable, e.g.:

make O_NAMEFIRST=1

When contributing/adding a new patch, make sure to add the make variable to the patches array in ./misc/test/check-patches.sh as well so that patch failures can be easily tested.

Resolving patch conflicts

Patch conflicts can be checked locally by running make checkpatches or by running ./patches/check-patches.sh manually.

Whenever patch conflicts occur on the latest master, pull requests resolving them are welcome. Let's say a conflict occurs in the restorepreview patch. The best way to resolve this conflict would be something along the lines of:

  • Ensure you're on latest master and run PATCH_OPTS="--merge" make O_RESTOREPREVIEW=1. This will generate the conflict markers in src/nnn.c.
  • Next edit src/nnn.c, resolve the conflicts around the conflict markers(<<<<<<<), and save.
  • Then run git diff > patch.diff && sed -i -e "/^$/{r patch.diff" -e "q;}" patches/restorepreview/mainline.diff to update the patch.