FNC(1)

๐Ÿ“ฆ version 0.18, in alpine 3.24, nixos 26.05, nixpkgs unstable

๐Ÿ’– FNC(1) ๐Ÿ’–

Welcome to FNC(1), bestie โ€” straight from the General Commands Manual. This is the page for fnc, and itโ€™s giving โ€œFossil but make it navigableโ€ energy. ๐Ÿฆ‹

๐ŸŒธ NAME ๐ŸŒธ

fnc โ€” interactive text-based user interface for Fossil repositories. ๐Ÿ’…

๐Ÿ“œ SYNOPSIS ๐Ÿ“œ

fnc [-z] [-R repository] command [arg ...]
fnc [-hv]
fnc path

fnc blame [-Chr] [-c commit] [-l lineno] [-n n] path
fnc branch [-Cchopr] [-a date] [-b date] [-s order] [glob]
fnc config [-hl] [-u option] [option [value]]
fnc diff [-bCDhiloPqsWw] [-x n] [artifact1 [artifact2]] [path ...]
fnc stash [-ChP] [-x n] [(get|pop) [id]]
fnc timeline [-Ch] [-b branch] [-c commit] [-f glob] [-n n] [-T tag]
    [-t type] [-u user] [path]
fnc tree [-Ch] [-c commit] [path]

โœจ DESCRIPTION โœจ

fnc is an interactive text-based user interface for exploring fossil(1) repositories, and managing local changes in a Fossil work tree. ๐Ÿซถ

To facilitate navigation and display repository data, fnc supports multiple views:

  • Timeline โ€” Display commits from the repositoryโ€™s history in chronologically descending order. If no command or only a path is specified, fnc will default to displaying this view. โณ
  • Diff โ€” Display changes introduced in the specified commit, between two repository artifacts, or local changes in the work tree. ๐Ÿ”
  • Tree โ€” Display navigable tree reflecting the repository state as at the specified commit. ๐ŸŒณ
  • Blame โ€” Display and annotate each line in the given file with the hyperlinked commit in which the line was last modified. ๐Ÿ•ต๏ธ
  • Branch โ€” Display navigable list of all repository branches. ๐ŸŒฟ

fnc provides both global and command-specific options, and runtime key bindings. Global options are as follows:

๐ŸŒˆ Global options ๐ŸŒˆ

  • -h, --help โ€” Display program help and usage information then exit. ๐Ÿ’–
  • -R, --repo path โ€” Use the fossil(1) repository at the specified path for the current fnc invocation.
  • -v, --version โ€” Display program version then exit.
  • -z, --utc โ€” Display dates and timestamps in Coordinated Universal Time (UTC) rather than local time. This can also be configured with the FNC_UTC option (see โ€œENVIRONMENTโ€ for details). ๐ŸŒ

๐ŸŽ€ Global key bindings ๐ŸŽ€

  • H, ?, F1 โ€” Display runtime help.
  • C โ€” Toggle between coloured and monochromatic output. On supported terminals, fnc will default to displaying all views in colour. Colours can be customised using the config command or environment variables (see โ€œENVIRONMENTโ€ for details). ๐ŸŒˆ
  • Tab โ€” Switch focus between open views.
  • f โ€” Toggle between fullscreen and splitscreen mode. By default, fnc will open child views in a vertical split if the terminal window is โ‰ฅ 120 columns wide. Set FNC_VIEW_SPLIT_MODE as documented in the โ€œENVIRONMENTโ€ section to change this behaviour.
  • s โ€” Switch between horizontal and vertical splitscreen layout, and render all active views in the new layout. If the terminal is not wide enough when switching to a vertical split, views will render in fullscreen.
  • ( โ€” When in a splitscreen view, decrease the size of the active split.
  • ) โ€” When in a splitscreen view, increase the size of the active split.
  • G, End โ€” Scroll to the last line in the view.
  • gg, Home โ€” Scroll to the first line in the view.
  • Q โ€” Quit fnc.
  • q โ€” Quit the active view.

๐Ÿ’ป Commands available to fnc ๐Ÿ’ป

โš™๏ธ config [-hl] [-u option | option [value]]

aliases: conf, set

Retrieve the current or set a new value for option in the local repository. When specified, value will become the new value for option, otherwise fnc will display the current value of option. With no arguments, fnc config will list all user-defined options; see โ€œENVIRONMENTโ€ for a detailed list of all available options and their default values. โœจ

During initialisation, if no value is defined for a given option in the local repository, environment variables will be searched. If still not found, fnc will fallback to default values.

Unless the global -R option is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is, fnc assumes a local checkout is open in or above the current working directory.

Options for fnc config are as follows:

  • -h, --help โ€” Display config command help and usage information then exit.
  • -l, --ls โ€” List all available options.
  • -u, --unset option โ€” Clear the specified option.

๐Ÿ—ƒ๏ธ stash [-ChP] [-x n] [(get|pop) [id]]

aliases: save, sta

When run with neither the get nor pop subcommands, fnc stash will interactively iterate over each hunk comprising the diff of local changes in the work tree, and prompt the user to either stash or keep the current hunk. ๐Ÿงบ

Valid answers are as follows:

  • b โ€” scroll back^
  • m โ€” show more of the current hunk^
  • y โ€” yes, stash the current hunk
  • n โ€” no, do not stash the current hunk
  • a โ€” yes, stash this hunk and all remaining hunks in the current file
  • k โ€” no, do not stash this hunk nor any remaining hunks in the current file
  • A โ€” yes, stash this hunk and all remaining hunks in the diff
  • K โ€” no, do not stash this hunk nor any remaining hunks in the diff
  • Q โ€” abort the stash operation and discard any previous selections
  • ? โ€” display help dialog
^ Conditionally available when the current hunk occupies multiple pages.

When all hunks have been selected, fnc will prompt the user to enter a stash message. If not provided, a default message of "fnc stash HASH-PREFIX", where "HASH-PREFIX" is an abbreviated SHA hash of the current checkout, will be used. At any time prior to the final hunk being selected (i.e., before being prompted for the stash message), the operation can be aborted by either answering "Q" at the prompt or opening the help dialog and entering the Q key binding. This will discard any previous selections and leave the work tree unchanged. ๐Ÿ›‘

Available subcommands for fnc stash are as follows:

  • get [id] (aliases: apply) โ€” Retrieve the stash changeset corresponding to the specified id and apply it to the current checkout. If id is omitted, the most recent stash entry will be applied. ๐Ÿ“ฅ
  • pop [id] โ€” Like get, but also remove the changeset from the stash cache. ๐Ÿ“ค

Options only apply to fnc stash (i.e., neither the get nor pop subcommands) and are as follows:

  • -C, --no-colour โ€” Disable coloured output, which is enabled by default on supported terminals.
  • -h, --help โ€” Display stash command help and usage information then exit.
  • -P, --no-prototype โ€” Do not display the enclosing function or scope in the hunk header. The heuristic used to determine the enclosing scope will produce reliable results for all C-like languages (e.g., C/C++, Java, Python, JavaScript); however, Lisps and non-source code (e.g., make(1), Markdown, reStructuredText) will return meaningless results. ๐Ÿ™ˆ
  • -x, --context n โ€” Set n context lines to be shown in the interactive stash diff display such that 0 โ‰ค n โ‰ค 64. Illegal values are a no-op (default: 5).

๐Ÿ•ฐ๏ธ timeline [-Chz] [-b branch] [-c commit] [-f glob] [-n n] [-T tag] [-t type] [-u user] [path]

aliases: log, tl

Display repository history with a chronological log of all commits. If path is specified, only show commits that modified the file(s) at this path. The path may be absolute, relative to the current working directory, or relative to the repository root. ๐Ÿ“š

Unless the global -R option is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is, fnc assumes a local checkout is open in or above the current working directory.

If invoked in a work tree, the log entry of the commit on which the checkout is based will be prefixed with one of the following annotations:

  • @ โ€” work tree of the checked-out commit contains no local changes
  • ~ โ€” work tree of the checked-out commit contains local changes

This command will be executed by default if fnc is invoked without an explicit command. โญ

Options for fnc timeline are as follows:

  • -b, --branch branch โ€” Display commits on the specified branch. The expected argument is a glob of the symbolic branch name, with the most recent branch to match being selected. Pattern matching is case-insensitive unless branch has at least one uppercase character, which will make the search case-sensitive. By default, fnc will display all commits irrespective of the branch on which they reside. ๐ŸŒฟ
  • -C, --no-colour โ€” Disable coloured timeline, which is enabled by default on supported terminals. If this option is not used, colour can be toggled with the c timeline view key binding as documented below. User-defined colours are also supported (see โ€œENVIRONMENTโ€ for details). ๐ŸŒˆ
  • -c, --commit commit โ€” Start timeline traversal from the specified commit. The expected argument is either a symbolic reference (e.g., branch name, tag), or (a unique abbreviated prefix of) a valid commit SHA1 or SHA3 hash, or an ISO 8601 formatted date. When this option is not used, fnc will begin traversing history from the latest commit. For a complete list of valid arguments this option accepts, see Fossilโ€™s Check-in Names: https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki. ๐Ÿ”ฅ
  • -f, --filter glob โ€” narrows the timeline down to commits that have glob chillin' in any of these fields: the commit comment, the user, or the branch. Matching is case-insensitive bestie, unless glob has at least one uppercase character โ€” then it flips to case-sensitive, so watch your caps lock ๐Ÿ’…. You can also filter live at runtime with the F key in the timeline view (more on that down below ๐Ÿ‘‡).
  • -h, --help โ€” shows the timeline command help + usage info, then dips. Bye ๐Ÿ‘‹
  • -n, --limit n โ€” caps the timeline at the latest n commits. Default behavior? fnc loads the entire repository history, the whole thing, no crumbs left behind ๐Ÿ˜ญ. Negative values are a no-op (they literally do nothing, don't even try).
  • -T, --tag tag โ€” only shows commits that have T cards containing tag. The argument you pass is expected to be a glob of a commit manifest's T card argument, and the most recent tag that matches gets selected โœจ. Pattern matching is case-insensitive unless tag has at least one uppercase character, which makes it case-sensitive. By default fnc displays all commits no matter which T cards are attached to the commit manifest โ€” so this is opt-in only, gorl.
  • -t, --type type โ€” only shows commits of type. The valid type values are, and I quote:
    • ci โ€” check-in
    • w โ€” wiki
    • t โ€” ticket
    • e โ€” technote
    • f โ€” forum post
    • g โ€” tag artifact

By default fnc loads all commits regardless of type. And this flag is repeatable, so you can stack it like fnc timeline -t e -t t ๐Ÿ”ฅ (yes, the manpage literally says that, iconic).

  • -u, --username user โ€” only shows commits authored by user. The search is case-insensitive by default unless user contains at least one uppercase character โ€” then it's case-sensitive, that's just how it is ๐ŸŽ€.

๐ŸŒธ Key bindings for fnc timeline ๐ŸŒธ

okay so here's your whole keyboard cheat sheet, memorise it, it's giving study guide energy ๐Ÿ’–

  • Arrow-down, j, >, . โ€” moves the selection cursor down the timeline โฌ‡๏ธ
  • Arrow-up, k, <, , โ€” moves the selection cursor up the timeline โฌ†๏ธ
  • Arrow-right, l โ€” scrolls the view to the right in the buffer. The comment field contents move left on screen, fyi ๐Ÿฆ‹
  • Arrow-left, h โ€” scrolls the view to the left in the buffer. Comment field contents move right on screen ๐Ÿ’ซ
  • $ โ€” scrolls the view all the way to the rightmost position. That corresponds to the end of the longest log message summary line on the page ๐Ÿ‘‘
  • 0 โ€” scrolls the view left, back to the start of the line ๐ŸŽ€
  • C-f, Page-down โ€” scrolls the timeline view one whole page downwards in the buffer
  • C-b, Page-up โ€” scrolls the timeline view one whole page upwards in the buffer
  • C-d โ€” scrolls the timeline view half a page downwards in the buffer
  • C-u โ€” scrolls the timeline view half a page upwards in the buffer
  • Enter โ€” opens a diff view showing the changeset of the currently selected commit ๐Ÿ‘€
  • Space โ€” tags or untags the currently selected commit as the base commit for the next tagged commit to be diffed against. If another commit is already tagged, it opens a diff view showing the changes between that one and the currently selected commit. Sneaky but useful ๐Ÿ’…
  • b โ€” opens and populates a branch view with all repository branches. You can select one of the listed branches to display a fresh new timeline view of its commit history ๐ŸŒˆ
  • D โ€” diffs local changes on disk in the current work tree against the currently selected commit
  • F โ€” prompts you for a search term to filter a new timeline view that displays commits with comment, user, or branch fields matching the pattern you typed ๐Ÿ”
  • t โ€” opens a tree view showing the tree of the repository corresponding to the currently selected commit ๐ŸŒณ
  • / โ€” prompts for a search term to start searching for commits matching the pattern provided. The search term is an extended regular expression matched against the comment, author username, branch, and SHA1 or SHA3 hash of each commit in the repository. For the regex syntax deets, see re_format(7). Slash is literally the main character here ๐Ÿ”ฅ
  • n โ€” finds the next commit that matches the current search term. The search keeps going until either a match is found or the earliest commit on the timeline is consumed ๐Ÿ˜ค
  • N โ€” finds the previous commit that matches the current search term. Search continues until either a match is found or the latest commit on the timeline is consumed ๐Ÿ™ˆ
  • Backspace โ€” cancels the current search or timeline traversal in progress (i.e., operations executed with / or G/End) ๐Ÿ›‘

๐Ÿฆ‹ diff (alias: di)

diff [-bCDhiloPqsWw] [-x n] [artifact1 [artifact2]] [path ...]
               (alias: di)

Displays the differences between two repository artifacts, or between the local changes in the work tree and a given commit. Basically the ultimate glow-up comparison tool ๐Ÿ’–

If you invoke it in a work tree with no artifact arguments specified, fnc shows the differences between the local changes in the work tree and the commit on which the current checkout is based. If you're in a work tree and only artifact1 is specified, fnc shows the differences between the local changes in the work tree and the commit referenced by artifact1. When artifact1 and artifact2 are both specified, the differences between those two versions get displayed ๐Ÿซถ

Both artifact arguments must resolve to the same type (i.e., commits or blobs), and they're expected to be either: symbolic references (e.g., branch names, tags); a commit or blob SHA1 or SHA3 (unique abbreviated) hash; or an ISO 8601 formatted date. If one or more path arguments are supplied, fnc filters the diffs so only changes involving the file(s) in the named paths show up. Paths may be absolute, relative to the current working directory, or relative to the repository root ๐ŸŽ€

When invoked outside a work tree with the global -R option, or when requesting the differences between blobs, both artifact arguments must be specified. In the blob case, any trailing arguments are invalid and will be ignored. no cap, they just get dropped ๐Ÿ’€

Unless the global -R option is used to specify a fossil(1) repository, this command must be invoked from within a work tree โ€” that is, fnc assumes a local checkout is open in or above the current working directory โš ๏ธ

โœจ Options for fnc diff are as follows โœจ

  • -b, --brief โ€” omits all changes. Shows the file index and hash lines only, minimal queen behavior ๐Ÿ’…
  • -C, --no-colour โ€” disables coloured diff output, which is enabled by default on supported terminals. If you don't use this option, you can toggle colour with the c diff view key binding (documented below). User-defined colours are also supported โ€” see ENVIRONMENT for the details ๐ŸŒˆ
  • -D, --min-diffstat โ€” shows a minimal diffstat instead of the more verbose plot bar histogram ๐Ÿ“Š
  • -h, --help โ€” displays diff command help and usage information, then exits
  • -i, --invert โ€” inverts the differences between artifacts ๐Ÿ”„
  • -l, --line-numbers โ€” displays actual file line numbers in the diff output ๐Ÿ”ข
  • -o, --no-curses โ€” does not initialise curses to render the diff view. Writes the diff directly to the standard output ๐Ÿ–จ๏ธ
  • -P, --no-prototype โ€” doesn't display the enclosing function or scope in the hunk header. The heuristic used to determine the enclosing scope gives reliable results for all C-like languages (e.g., C/C++, Java, Python, JavaScript) โ€” but Lisps and non-source code (e.g., make(1), Markdown, reStructuredText) will return meaningless results ๐Ÿ˜ญ. Heads up: this option is mutually exclusive with -l and -s, which produce incompatible hunk headers โ€” pick a lane bestie
  • -q, --quiet โ€” doesn't output the complete content of newly added or deleted files, which are displayed by default. Only shows the file index and hash lines ๐Ÿคซ
  • -s, --sbs โ€” displays a side-by-side formatted diff. This option is mutually exclusive with -l (again, pick one, they can't both be the main character)
  • -W, --whitespace-eol โ€” ignores end-of-line whitespace-only changes ๐Ÿงผ
  • -w, --whitespace โ€” ignores whitespace-only changes, all of them
  • -x, --context n โ€” sets n context lines to be shown in the diff, such that 0 โ‰ค n โ‰ค 64. Illegal values are a no-op (default: 5) ๐ŸŽฏ

All the above options (except -h and -o) can be made persistent as global or repository options via the FNC_DIFF_FLAGS option โ€” see ENVIRONMENT for details ๐Ÿ‘‘

๐Ÿ’œ Key bindings for fnc diff ๐Ÿ’œ

  • Arrow-down, j โ€” scrolls the view one line downwards in the buffer. The diff output moves upwards on screen โฌ‡๏ธ
  • Arrow-up, k โ€” scrolls the view one line upwards in the buffer. The diff output moves downwards on screen โฌ†๏ธ
  • Arrow-right, l โ€” scrolls the view to the right in the buffer. The diff output moves left on screen โžก๏ธ
  • Arrow-left, h โ€” scrolls the view to the left in the buffer. The diff output moves right on screen โฌ…๏ธ
  • $ โ€” scrolls the view to the rightmost position. This corresponds to the end of the longest line on the page ๐ŸŽ€

okay so weโ€™re still in the diff view key bindings, and these are the little keyboard shortcuts that make the diff view feel like a main character. ๐Ÿ’…

  • 0 โ€” Scroll view left to the start of the line. โฌ…๏ธ
  • C-e โ€” Move the selection cursor down one line. ๐Ÿ’–
  • C-y โ€” Move the selection cursor up one line. ๐Ÿฆ‹
  • C-f, Page-down, Space โ€” Scroll diff view one page downwards in the buffer. ๐ŸŒธ
  • C-b, Page-up โ€” Scroll diff view one page upwards in the buffer. ๐ŸŒธ
  • C-d โ€” Scroll diff view half of one page downwards in the buffer. ๐ŸŽ€
  • C-u โ€” Scroll diff view half of one page upwards in the buffer. ๐ŸŽ€
  • C-k, K, <, , โ€” If the diff view is derived from the timeline view, move up to the previous (i.e., newer) commit and display its diff. If derived from the blame view, move up to the previous line in the annotated file and display the corresponding diff. ๐Ÿ”ฅ
  • C-j, J, >, . โ€” If the diff view is derived from the timeline view, move down the timeline to the next (i.e., older) commit and display its diff. If derived from the blame view, move down to the next line in the annotated file and display the corresponding diff. ๐Ÿ”ฅ
  • C-p โ€” Navigate to the previous file in the diff. ๐Ÿซถ
  • C-n โ€” Navigate to the next file in the diff. ๐Ÿซถ
  • [ โ€” Navigate to the previous hunk in the diff. โœจ
  • ] โ€” Navigate to the next hunk in the diff. โœจ
  • -, _ โ€” Decrease the number of context lines in the diff. ๐Ÿ’…
  • =, + โ€” Increase the number of context lines in the diff. ๐Ÿ’…
  • # โ€” Toggle the display of diff view (not actual file) line numbers. ๐Ÿ‘‘
  • @ โ€” Open prompt to enter a line number and navigate to that line in the view. ๐Ÿงš
  • B โ€” Toggle brief diff mode by only displaying file index and hash lines. ๐ŸŒˆ
  • b โ€” Open and populate the branch view with all repository branches. ๐ŸŒฟ
  • D โ€” Toggle between minimal and histogram diffstat. ๐Ÿ“Š
  • i โ€” Toggle inversion of diff output. ๐Ÿ”„
  • L โ€” Toggle file line number formatted diff. ๐Ÿ”ข
  • P โ€” Write the currently viewed diff to a file on disk. fnc will prompt the user for a path, which can be absolute or relative, that points to a location in either the current work tree or the tmp directory. If no path is input and the return key is entered, the diff will be written to the current working directory using the first ten characters of the current artifact hash as the filename with a .diff extension (e.g., 2870235eef.diff). If the path already exists, it will be overwritten. ๐Ÿ’พ
  • p โ€” In the diff hunk header, toggle display of which function or scope each change is in; for example: @@ -2360,10 +2361,11 @@ draw_commits(struct fnc_view *view) ๐Ÿ”
  • S โ€” Toggle display of a side-by-side formatted diff. ๐Ÿชž
  • v โ€” Toggle verbosity of diff output. By default, fnc will display the entire content of newly added or deleted files. ๐Ÿ—ฃ๏ธ
  • W โ€” Toggle whether end-of-line whitespace changes are ignored when comparing lines in the diff. ๐ŸŒฌ๏ธ
  • w โ€” Toggle whether whitespace-only changes are ignored when comparing lines in the diff. ๐ŸŒฌ๏ธ
  • / โ€” Prompt to enter a search term to begin searching the diff output for lines matching the pattern provided. The search term is an extended regular expression, which is documented in re_format(7). ๐Ÿ”Ž
  • n โ€” Find the next line that matches the current search term. โญ๏ธ
  • N โ€” Find the previous line that matches the current search term. โฎ๏ธ

๐ŸŒณ tree ๐ŸŒณ

tree [-Ch] [-c commit] [path]

(aliases: dir, tr)

Display a navigable tree of the repository. ๐ŸŒฒ

If a path is specified, display the corresponding subtree, otherwise display the root of the tree. The path may be absolute, relative to the current working directory, or relative to the repository root. With no options passed, the tree will reflect the state of the latest commit on trunk. ๐ŸŒฑ

Unless the global -R option is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is, fnc assumes a local checkout is open in or above the current working directory. ๐Ÿซถ

Tree nodes are lexicographically ordered and may be postfixed with an identifier corresponding to the mode of the file object on disk as returned by lstat(2): ๐Ÿ“

  • / โ€” directory
  • * โ€” executable
  • @ โ€” symbolic link

Nodes representing symbolic links are further annotated with the path of the source file (e.g., symlink@ -> targetpath) ๐Ÿ”—

Options for fnc tree are as follows:

  • -C, --no-colour โ€” Disable coloured output, which is enabled by default on supported terminals. If this option is not used, colour can be toggled with the c tree view key binding as documented below. User-defined colours are also supported (see โ€œENVIRONMENTโ€ for details). ๐ŸŽจ
  • -c, --commit commit โ€” Display the repository tree corresponding to the checkin identified by commit. The expected argument is either a symbolic reference (e.g., branch name, tag), or (a unique abbreviated prefix of) a valid commit SHA1 or SHA3 hash, or an ISO 8601 formatted date. When this option is not used, fnc will display the tree of the latest commit. For a complete list of valid arguments this option accepts, see Fossil's Check-in Names: https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki. ๐Ÿ—‚๏ธ
  • -h, --help โ€” Display tree command help and usage information then exit. ๐Ÿ™‹

Key bindings for fnc tree are as follows:

  • Enter, Arrow-right, l โ€” Enter the currently selected directory, or open a blame view of the currently selected file. ๐Ÿšช
  • Backspace, Arrow-left, h โ€” Move up a level to the parent directory. This is a no-op when in the root tree. โฌ†๏ธ
  • Arrow-down, j โ€” Move selection cursor one node down the tree. โฌ‡๏ธ
  • Arrow-up, k โ€” Move selection cursor one node up the tree. โฌ†๏ธ
  • C-f, Page-down โ€” Scroll tree view one page downwards in the buffer. ๐Ÿ“œ
  • C-b, Page-up โ€” Scroll tree view one page upwards in the buffer. ๐Ÿ“œ
  • C-d โ€” Scroll tree view half of one page downwards in the buffer. ๐ŸŽ€
  • C-u โ€” Scroll tree view half of one page upwards in the buffer. ๐ŸŽ€
  • Home, gg โ€” Move selection cursor to the first node in the tree. ๐Ÿฅ‡
  • End, G โ€” Move selection cursor to the last node in the tree. ๐Ÿ
  • b โ€” Open and populate the branch view with all repository branches. ๐ŸŒฟ
  • d โ€” Toggle display of the last modified timestamp for each tree entry. โฐ
  • i โ€” Toggle display of the hash ID for all file nodes in the tree. ๐Ÿ”‘
  • t โ€” Open the timeline view of the currently selected tree entry. This will display the log of all commits involving the tracked file(s) corresponding to the selected tree node. ๐Ÿ•ฐ๏ธ
  • / โ€” Prompt to enter a search term to begin searching the tree for entries matching the entered pattern. The search term is an extended regular expression, as documented in re_format(7), and is matched against the path of each tree node. ๐Ÿ”Ž
  • n โ€” Find the next tree node that matches the current search pattern. โญ๏ธ
  • N โ€” Find the previous tree node that matches the current search pattern. โฎ๏ธ

๐Ÿ•ต๏ธ blame ๐Ÿ•ต๏ธ

blame [-Chr] [-c commit] [-l lineno] [-n n] path

(aliases: praise, bl)

Show commit attribution history for each line of the file at the named path, which may be absolute, relative to the current working directory, or relative to the repository root. ๐Ÿ‘€

Unless the global -R option is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is, fnc assumes a local checkout is open in or above the current working directory. ๐Ÿซถ

Options for fnc blame are as follows:

  • -C, --no-colour โ€” Disable coloured output, which is enabled by default on supported terminals. If this option is not used, colour can be toggled with the c blame view key binding as documented below. User-defined colours are also supported (see โ€œENVIRONMENTโ€ for details). ๐ŸŽจ
  • -c, --commit commit โ€” Start annotation of the tracked file from the specified commit. The expected argument is either a symbolic reference (e.g., branch name, tag), or (a unique abbreviated prefix of) a valid commit SHA1 or SHA3 hash, or an ISO 8601 formatted date. When this option is not used, fnc will begin annotation from the latest commit. For a complete list of valid arguments this option accepts, see Fossil's Check-in Names: https://fossil-scm.org/home/doc/trunk/www/checkin_names.wiki. ๐Ÿ—‚๏ธ
  • -h, --help โ€” Display blame command help and usage information then exit. ๐Ÿ™‹
  • -l, --line lineno โ€” Open the annotated file and navigate directly to lineno. ๐Ÿ“
  • -n, --limit n โ€” caps how deep the blame history goes at n commits, or at n seconds if you slap a lil s on the end (like 30s ๐Ÿ’…). With this, fnc will either walk as many commits as you asked for or as many as it can squeeze into that time window, whichever comes first. By default fnc digs through the entire historical record of the file, which is lowkey expensive for big files that span a ton of commits ๐Ÿ˜ญ. Use this when you want a faster, more targeted annotation. slay.
  • -r, --reverse โ€” reverse-annotates the file: it starts from a historical commit and cruises forward in time, so instead of showing the most recent commit that touched each line, it shows the first commit that modified each line after the commit you specified. (requires -c โ€” no cap, it's mandatory ๐Ÿซถ)

โŒจ๏ธ Key bindings for fnc blame

okay bestie, here's your whole keyboard map:

  • Arrow-down, j โ€” move selection cursor down one line.
  • Arrow-up, k โ€” move selection cursor up one line.
  • Arrow-right, l โ€” scroll view to the right in the buffer. the file contents move left on the screen (yes, it's giving opposite day, that's just how scrolling works ๐Ÿ’€).
  • Arrow-left, h โ€” scroll view to the left in the buffer. file contents move right on the screen.
  • $ โ€” scroll view to the rightmost position. this corresponds to the end of the longest line on the page.
  • 0 โ€” scroll the view left to the beginning of the line.
  • C-f, Page-down โ€” scroll blame view one page downwards in the buffer.
  • C-b, Page-up โ€” scroll blame view one page upwards in the buffer.
  • C-d โ€” scroll blame view half of one page downwards in the buffer.
  • C-u โ€” scroll blame view half of one page upwards in the buffer.
  • Home, gg โ€” move selection cursor to the first line in the file.
  • End, G โ€” move selection cursor to the last line in the file.
  • Enter โ€” open a diff view of the commit corresponding to the currently selected line. iconic.
  • # โ€” toggle display of file line numbers.
  • @ โ€” open a prompt to enter a line number and navigate to that line in the file.
  • P, Backspace โ€” reload the previously blamed version of the file.
  • c โ€” blame the version of the file corresponding to the commit in the currently selected line.
  • p โ€” blame the version of the file corresponding to the parent of the commit in the currently selected line.
  • b โ€” open and populate a branch view with all repository branches.
  • t โ€” open a timeline view that begins traversing the timeline from the commit corresponding to the currently selected annotated line.
  • / โ€” prompt to enter a search term to begin searching the file for tokens matching the entered pattern. the search term is an extended regular expression, as documented in re_format(7). fancy fr fr.
  • N โ€” find the previous token that matches the current search pattern.
  • n โ€” find the next token that matches the current search pattern.

๐ŸŒฟ branch

branch [-Cchopr] [-a date] [-b date] [-s order] [glob]

(aliases: br, ref)

Display a navigable list of repository branches. it's literally a whole little browser for your branches, no cap โœจ

If glob is specified, only display branches matching the pattern you provided. pattern matching is case-insensitive unless glob contains at least one uppercase character โ€” that flips the search to case-sensitive. so type carefully, bestie ๐Ÿ™ˆ

Unless the global -R option is used to specify a fossil(1) repository, this command has to be invoked from within a work tree โ€” that is, fnc assumes a local checkout is open in or above the current working directory. no checkout, no branches. periodt.

Branches are lexicographically ordered by default, and are prefixed with an identifier corresponding to the branch state (i.e., open/closed). the current and private branches get further annotated with a postfixed identifier:

+dev-foo      open
-rm-bar       closed
+trunk@       current
+wip-baz*     private

All branches, irrespective of state or privacy, are displayed by default, but can be filtered based on several characteristics. filter away, queen ๐Ÿ‘‘

โœจ Options for fnc branch

  • -a, --after date โ€” display only those branches with activity after the specified date, which is expected to be either an ISO 8601 date (e.g., 2020-10-10) or an unambiguous DD/MM/YYYY or MM/DD/YYYY formatted date.
  • -b, --before date โ€” display only those branches with activity before the specified date, which is expected to be either an ISO 8601 date (e.g., 2020-10-10) or an unambiguous DD/MM/YYYY or MM/DD/YYYY formatted date.
  • -C, --no-colour โ€” disable coloured output, which is enabled by default on supported terminals. if you don't use this option, colour can be toggled with the c branch view key binding as documented below ๐ŸŽจ. user-defined colours are also supported (see โ€œENVIRONMENTโ€ for details).
  • -c, --closed โ€” display only closed branches.
  • -h, --help โ€” display branch command help and usage information then exit.
  • -o, --open โ€” display only opened branches.
  • -p, --no-private โ€” do not show private branches, which are included in the list of displayed branches by default.
  • -r, --reverse โ€” reverse the order in which branches are displayed.
  • -s, --sort order โ€” sort branches by order. valid order values are as follows:
    • mru โ€” most recently used
    • state โ€” open/closed state

branches are sorted in lexicographical order by default. (so -s is literally the vibe-check override ๐Ÿ’…)

๐ŸŽ€ Key bindings for fnc branch

  • Arrow-down, j โ€” move selection cursor down one branch.
  • Arrow-up, k โ€” move selection cursor up one branch.
  • C-f, Page-down โ€” scroll branch view one page downwards in the buffer.
  • C-b, Page-up โ€” scroll branch view one page upwards in the buffer.
  • C-d โ€” scroll branch view half of one page downwards in the buffer.
  • C-u โ€” scroll branch view half of one page upwards in the buffer.
  • Home, gg โ€” move selection cursor to the first branch in the list.
  • End, G โ€” move selection cursor to the last branch in the list.
  • Enter, Space โ€” display a timeline view of the currently selected branch.
  • d โ€” toggle display of the date on which the branch last received changes.
  • i โ€” toggle display of the SHA1 or SHA3 hash that identifies each branch, which is the commit hash of the branch tip.
  • o โ€” toggle sort order of currently displayed branches. fnc will cycle from lexicographical order to most recently used and then open/closed state.
  • t โ€” open a tree view of the currently selected branch.
  • R, C-l โ€” reload the view with all repository branches, irrespective of which options were used in this fnc branch invocation.
  • / โ€” prompt to enter a search term to begin searching the list for branches matching the entered pattern. the search term is an extended regular expression, as documented in re_format(7).
  • n โ€” find the next branch that matches the current search pattern.
  • N โ€” find the previous branch that matches the current search pattern.

๐ŸŒธ ENVIRONMENT ๐ŸŒธ

Okay bestie, so here's the vibe check on your terminal window: when it's โ‰ฅ 120 columns wide, fnc will show child views in a vertical split that's at least 80 columns wide โ€” otherwise you get fullscreen. That's just how she rolls. ๐Ÿ’…

But if you're a horizontal-split kinda girl, just configure this option โ€” either as an exported environment variable or with fnc config as documented above:

  • FNC_VIEW_SPLIT_MODE โ€” opens child views in a horizontal or vertical split. Value can be either "horizontal" or "vertical" (default: vertical).

So fnc shows all dates and timestamps in local time unless you pass the global -z option โ€” in which case everything is in Coordinated Universal Time (UTC). No in-between, no vibes. ๐Ÿ•

And if you want that to stick without typing -z every single time? Set this one, again either as an exported environment variable or with fnc config:

  • FNC_UTC โ€” if set to a non-empty value, display dates and timestamps in Coordinated Universal Time (UTC).

Same energy for diff options, bestie โ€” you can persistently apply them to all diff views, whether you went straight there with fnc diff or you're peeking at a child view of the timeline or blame views. Configure these:

  • FNC_DIFF_FLAGS โ€” string containing any or all of the available short form diff boolean flag options documented above, except the -h and -o options (i.e., bCDilPqsWw). And listen: if the mutually exclusive options "l" and "s" are both specified, whichever is last wins โ€” for example, "lqs" will display side-by-side formatted diffs (default: "").
  • FNC_DIFF_CONTEXT โ€” numeric value as per the above documented -x option (i.e., 0 โ‰ค n โ‰ค 64) specifying the number of context lines (default: 5).
Just so we're clear: any options passed to fnc diff will override the above settings. Your command line is the main character, periodt. ๐Ÿ‘‘

๐ŸŽจ Colours ๐ŸŽจ

fnc displays coloured output by default in supported terminals. Each colour object below can be defined either by exporting environment variables (e.g., export FNC_COLOUR_COMMIT=red) or with fnc config as documented above. At startup, fnc searches for user-defined colours in this order:

  1. repository options โ€” repo.fossil
  2. environment variables โ€” shell

If none are found, the default colour scheme shows up and slays on its own. This is iconic because it means you can set per-project colours to visually distinguish which repository you're looking at, and globally change the colour scheme for all repositories with no local options configured. Best of both worlds, honestly. โœจ

Except where documented below, the colours supported in fnc are:

"black"  "green"   "blue"     "cyan"
"red"    "yellow"  "magenta"  "default"

Where "default" is the current foreground (i.e., text) colour in the terminal. ๐Ÿ–๏ธ

User-definable colour objects displayed in various fnc views are as follows โ€” buckle up:

  • FNC_COLOUR_COMMIT โ€” the commit hash ID field displayed in the timeline, diff, tree, and blame views (default: "green").
  • FNC_COLOUR_USER โ€” the username field displayed in the timeline and diff views (default: "cyan").
  • FNC_COLOUR_DATE โ€” the date field displayed in the timeline and diff views (default: "yellow").
  • FNC_COLOUR_DIFF_MINUS โ€” removed lines displayed in the diff view (default: "magenta").
  • FNC_COLOUR_DIFF_PLUS โ€” added lines displayed in the diff view (default: "cyan").
  • FNC_COLOUR_DIFF_HUNK โ€” hunk header lines (e.g., @@ -732,34 +747,40 @@) displayed in the diff view (default: "yellow").
  • FNC_COLOUR_DIFF_META โ€” metadata displayed in the diff view (default: "green").
  • FNC_COLOUR_DIFF_TAGS โ€” the tag field displayed in the diff view (default: "magenta").
  • FNC_COLOUR_DIFF_SBS_EDIT โ€” changed (i.e., not added or removed) lines in the diff view when displaying side-by-side diffs (default: "red").
  • FNC_COLOUR_TREE_DIR โ€” directory entries displayed in the tree view (default: "cyan").
  • FNC_COLOUR_TREE_EXEC โ€” executable file entries displayed in the tree view (default: "green").
  • FNC_COLOUR_TREE_LINK โ€” symbolic link entries displayed in the tree view (default: "magenta").
  • FNC_COLOUR_BRANCH_OPEN โ€” open branches displayed in the branch view (default: "cyan").
  • FNC_COLOUR_BRANCH_CLOSED โ€” closed branches displayed in the branch view (default: "magenta").
  • FNC_COLOUR_BRANCH_CURRENT โ€” the branch corresponding to the current checkout displayed in the branch view (default: "green").
  • FNC_COLOUR_BRANCH_PRIVATE โ€” private branches displayed in the branch view (default: "yellow").
  • FNC_COLOUR_HL_LINE โ€” selected line highlight in the diff view. Value can be one of auto or mono. The former will invert the foreground colour of the selected line, while the latter will use a monochromatic highlight (default: "auto").
  • FNC_COLOUR_HL_SEARCH โ€” search term highlight in the blame and diff views (default: "yellow").

To clear environment variables, invoke the shell builtin unset โ€” like, for example, "unset FNC_DIFF_CONTEXT". And as documented above, local options can be unset with the fnc config -u option. ๐Ÿงน

fnc displays best with UTF-8, and will detect whether UTF-8 is enabled to determine which characters to draw in certain views. If UTF-8 is supported by your terminal but is currently disabled, you can enable it with "export LC_CTYPE=en_US.UTF-8"; if it's not available, fnc will revert to ASCII. Frugal but functional. ๐Ÿ’โ€โ™€๏ธ

Relatedly โ€” and this is such a niche flex โ€” some fonts may render certain characters poorly in the help screen because they lack the requisite glyphs. Monospace Regular, JetBrains Mono, and Menlo are known to render all characters well. Font queens only. ๐Ÿซถ


๐Ÿ”ฅ EXIT STATUS ๐Ÿ”ฅ

The fnc utility exits 0 on success, and >0 if an error occurs. Simple as that, no cap.


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

fossil(1), sqlite3(1), re_format(7) โ€” go read those too, iykyk.


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Mark Jamsek <mark@jamsek.com>


Alright bestie, that's the whole page โ€” go forth and fnc responsibly. ๐ŸŒˆ๐Ÿ’–

This gorgeous little number comes to you from Debian, dated $Mdocdate$, and it's page FNC(1) โ€” periodt. ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from