FNC(1)
๐ 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,
fncwill 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,--repopath โ Use thefossil(1)repository at the specified path for the currentfncinvocation.-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 theFNC_UTCoption (see โENVIRONMENTโ for details). ๐
๐ Global key bindings ๐
H,?,F1โ Display runtime help.Cโ Toggle between coloured and monochromatic output. On supported terminals,fncwill default to displaying all views in colour. Colours can be customised using theconfigcommand or environment variables (see โENVIRONMENTโ for details). ๐Tabโ Switch focus between open views.fโ Toggle between fullscreen and splitscreen mode. By default,fncwill open child views in a vertical split if the terminal window is โฅ 120 columns wide. SetFNC_VIEW_SPLIT_MODEas 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โ Quitfnc.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โ Displayconfigcommand help and usage information then exit.-l,--lsโ List all available options.-u,--unsetoption โ 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 hunknโ no, do not stash the current hunkaโ yes, stash this hunk and all remaining hunks in the current filekโ no, do not stash this hunk nor any remaining hunks in the current fileAโ yes, stash this hunk and all remaining hunks in the diffKโ no, do not stash this hunk nor any remaining hunks in the diffQโ 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]โ Likeget, 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โ Displaystashcommand 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,--contextn โ Set n context lines to be shown in the interactive stash diff display such that0 โค 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,--branchbranch โ 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,fncwill 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 thectimeline view key binding as documented below. User-defined colours are also supported (see โENVIRONMENTโ for details). ๐-c,--commitcommit โ 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,fncwill 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,--filterglob โ 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 theFkey in the timeline view (more on that down below ๐).-h,--helpโ shows the timeline command help + usage info, then dips. Bye ๐-n,--limitn โ caps the timeline at the latest n commits. Default behavior?fncloads 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,--tagtag โ only shows commits that haveTcards containing tag. The argument you pass is expected to be a glob of a commit manifest'sTcard 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 defaultfncdisplays all commits no matter whichTcards are attached to the commit manifest โ so this is opt-in only, gorl.-t,--typetype โ only shows commits of type. The valid type values are, and I quote:ciโ check-inwโ wikitโ ticketeโ technotefโ forum postgโ 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,--usernameuser โ 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 bufferC-b,Page-upโ scrolls the timeline view one whole page upwards in the bufferC-dโ scrolls the timeline view half a page downwards in the bufferC-uโ scrolls the timeline view half a page upwards in the bufferEnterโ 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 commitFโ 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, seere_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/orG/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 thecdiff view key binding (documented below). User-defined colours are also supported โ seeENVIRONMENTfor 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-land-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,--contextn โ sets n context lines to be shown in the diff, such that0 โค 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.fncwill prompt the user for a path, which can be absolute or relative, that points to a location in either the current work tree or thetmpdirectory. 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.diffextension (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,fncwill 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 inre_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 thectree view key binding as documented below. User-defined colours are also supported (see โENVIRONMENTโ for details). ๐จ-c,--commitcommit โ 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,fncwill 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 inre_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 thecblame view key binding as documented below. User-defined colours are also supported (see โENVIRONMENTโ for details). ๐จ-c,--commitcommit โ 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,fncwill 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,--linelineno โ 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 lilson the end (like30s๐ ). With this,fncwill either walk as many commits as you asked for or as many as it can squeeze into that time window, whichever comes first. By defaultfncdigs 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 inre_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 unambiguousDD/MM/YYYYorMM/DD/YYYYformatted 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 unambiguousDD/MM/YYYYorMM/DD/YYYYformatted 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 thecbranch 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 usedstateโ 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.fncwill 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 thisfnc branchinvocation./โ 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 inre_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-hand-ooptions (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-xoption (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:
- repository options โ
repo.fossil - 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 ofautoormono. 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
- alpine 3.24: fnc-doc 0.18-r1 ยท ISC
- nixos 26.05: fnc 0.18
- nixpkgs unstable: fnc 0.18
- Copyright (c) 2021, 2022, 2023 Mark Jamsek <mark@jamsek.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms