NAME
fnc —
interactive text-based user interface
for Fossil repositories
SYNOPSIS
fnc |
command [arg ...] |
fnc |
[-hv] |
fnc |
path |
fnc |
blame [-ChRz]
[-c commit]
[-l lineno]
[-n n]
[-r path]
path |
fnc |
branch [-CchopRz]
[-a date]
[-b date]
[-r path]
[-s order]
[glob] |
fnc |
commit [-h]
[-m msg]
[path ...] |
fnc |
config [-hl]
[-r path]
[-u option]
[option [value]] |
fnc |
diff [-bCDhiloPqsWwz]
[-r path]
[-x n]
[artifact1 [artifact2]]
[path ...] |
fnc |
histedit [-aCcdefhlm]
[-F path]
[-X [reference]] |
fnc |
stash [-hP]
[-C n]
[(get|pop)
[id]] |
fnc |
timeline [-ChPz]
[-b branch]
[-c commit]
[-f glob]
[-n n]
[-r path]
[-T tag]
[-t type]
[-u user]
[path] |
fnc |
tree [-Chz]
[-c commit]
[-r path]
[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. Some command-specific
key maps may be prefixed with an integer, which is denoted by
‘N’ in the descriptions below, and is used as a modifier to
the operation as indicated. fnc echoes digits to the
view when count modifiers are entered, and completes the sequence on input
of the first non-numeric character. Count modifiers can be aborted by
entering an unmapped key. Inflight compound commands can be canceled with
^G or backspace. Global options are as
follows:
-h,--help- Display program help and usage information then exit.
-v,--version- Display program version then exit.
Global key bindings are as follows:
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 N increments (default: 1).
)- When in a splitscreen view, increase the size of the active split N increments (default: 1).
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 are as
follows:
commit[-h] [-mmsg] [path ...]-
Create a new commit in the repository from changes in the work tree while a
(alias:ci)histeditoperation is paused for aneditcommand. If no path arguments are specified, commit all changes in the work tree. Otherwise, commit changes at or within the specified paths.This command is currently only supported while a
histeditoperation is paused; use fossil(1)commitotherwise. The options forfnccommitare as follows:-h,--help- Display
commitcommand help and usage information then exit. -m,--messagemsg- Use msg as the commit message instead of opening an editor.
config[-hl] [-rpath] [-uoption | option [value]]-
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
(aliases:conf,set)fncwill display the current value of option. With no arguments,fncconfigwill 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,
fncwill fallback to default values.Unless the
-roption is used to specify a path to the fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes a local checkout is open in or above the current working directory.Options for
fncconfigare as follows:-h,--help- Display config command help and usage information then exit.
-l,--ls- List all available options.
-r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-u,--unsetoption- Clear the specified option.
histedit[-aCcdefhlm] [-Fpath] [-X[reference]]-
Edit the commit history between the work tree's current base commit (exclusive) and the tip commit of the work tree's current branch (inclusive).
(alias:he)Before running
fnchistedit, the work tree's base commit must be updated to a commit preceding the first commit to be edited; for example, with the fossil(1)updatecommand. This base commit is the lower (exclusive) bound of the edited range, and the tip of the work tree's branch is the upper (inclusive) bound. The work tree must not contain uncommitted local changes.Unless one of the
-d,-e,-f, or-moptions is used,fncopensVISUAL,EDITOR, or /usr/bin/vi, in that order of preference, with a line-based script listing one commit per line in order from oldest to newest. Each line begins with a command followed by whitespace and an abbreviated commit hash. Lines beginning with ‘#’ are ignored. Quitting the editor without saving aborts the operation.The available histedit script commands are as follows:
pickcommituse the commit as-is foldcommitcombine the commit with the next commit that is used dropcommitremove the commit from the edited history mesgcommitopen an editor to reword the commit's log message editcommitapply the commit, then pause for amending Lines may be reordered to reorder commits in the edited history. Every commit in the edited range must be listed exactly once.
The edited history is constructed by replaying the selected commits as a new linear sequence on top of the base commit. Each replayed commit retains its original author. Where possible, original commit timestamps are preserved but reordered commits are given a new commit timestamp that increases monotonically along the edited line. The edited branch is left with a single linear history and the work tree is updated to the newly edited tip.
The original commits are not deleted; instead, the original line is marked private and moved onto a private branch named “backup/histedit/HASH-PREFIX” (where "HASH-PREFIX" is an abbreviated SHA hash of the original branch tip), and its leaf is closed. Private commits are hidden from the default
fnctimeline, so the backup does not clutter the edited history, but it remains browsable withfnctimeline-Porfnctimeline-bbackup/histedit/HASH-PREFIX, and the original commits can be recovered from it if needed. Backups can be listed with-land deleted with-X.The original branch is not modified until the operation completes, so an unexpected error rolls the repository and work tree back to their starting state.
An
editcommand, or a merge conflict encountered while replaying any commit, pauses the operation: the applied changes are left in the work tree andfnchisteditreturns. After amending the work tree (or resolving the conflict), resume withfnchistedit-c; the paused commit is created from the work tree as it then stands and the remaining commits are replayed. During aneditpause the applied changes are presented as ordinary pending changes, so arbitrary commits may be created withfnccommitbefore resuming; whatever changes remain in the work tree become the edited commit when the operation is continued. Commits made during a pause must be created withfnccommit, which performs extra bookkeeping. fossil(1)commitbehavior is undefined during anfnchisteditoperation and may produce inconsistent state. Alternatively,fnchistedit-aaborts the paused operation, discarding the partially replayed line and restoring the work tree to the original branch tip. While an operation is paused, otherfnchisteditoperations are refused until it is continued or aborted.The options for
fnchisteditare as follows:-a,--abort- Abort an interrupted histedit operation, discarding the partially replayed line and restoring the work tree to the original branch tip. Can only be used while an operation is paused.
-C,--allow-conflict- When continuing, allow the paused commit to be created even if files
in the work tree still contain merge conflict markers. Can only be
used together with
-c. -c,--continue- Continue an interrupted histedit operation that was paused by an
editcommand or a merge conflict. Can only be used while an operation is paused. -d,--drop- Drop all commits. This is a quick equivalent to a histedit script that
specifies
dropfor every commit in the edited range, reducing the branch to its base commit. Cannot be used with any other command-line arguments. -e,--edit- Edit all commits. This is a quick equivalent to a histedit script that
specifies
editfor every commit in the edited range, pausing the operation at each commit so the work tree can be amended before continuing. Cannot be used with any other command-line arguments. -F,--scriptpath- Use the histedit script at path instead of opening an editor.
-f,--fold- Fold all commits into a single commit. This is a quick equivalent to a
histedit script that specifies
foldfor every commit except the last, which ispick. Cannot be used with any other command-line arguments. -h,--help- Display
histeditcommand help and usage information then exit. -l,--list- List backups created by previous
histeditoperations, showing each backup branch with the date, hash, and log message summary of its tip commit. -m,--message- Edit log messages only. This is a quick equivalent to a histedit
script that specifies
mesgfor every commit. Cannot be used with any other command-line arguments. -X,--delete[reference]- Delete backups created by previous
histeditoperations by permanently removing the backup commits from the repository. If a reference argument is given, only the named backup is deleted; otherwise all histedit backups are deleted. The reference argument may be given either as the bare hash or as the full “backup/histedit/hash” reference as printed by-l. No copy is retained, so this cannot be undone.
stash[-hP] [-Cn] [(get|pop) [id]]-
When run with neither the
(aliases:save,sta)getnorpopsubcommands,fncstashinteractively emits each hunk in the work tree diff to the standard output and prompts the user to stash or keep it. Pressing return without entering a character defaults to ‘y’.Valid answers are as follows:
y yes, stash the current hunk (default) n no, do not stash the current hunk q quit; do not stash any hunks and leave the work tree unchanged 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 ? display help When all hunks have been selected,
fncopensVISUAL,EDITOR, or /usr/bin/vi, in that order of preference, for the user to compose a stash message. If the message is left empty, a default 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, the operation can be aborted by answering "q" at the prompt. This will discard any previous selections and leave the work tree unchanged.Available subcommands for
fncstashare as follows:get[id]-
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.
(aliases:apply) pop[id]- Like
get, but also remove the changeset from the stash cache.
Options only apply to
fncstash(i.e., neither thegetnorpopsubcommands) and are as follows:-h,--help- Display
stashcommand 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.
-C,--contextn- Set n context lines to be shown around each hunk such that 0 ≤ n ≤ 64 (default: 5).
timeline[-Chz] [-bbranch] [-ccommit] [-fglob] [-nn] [-rpath] [-Ttag] [-ttype] [-uuser] [path]-
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.
(aliases:log,tl)Unless the
-roption is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes 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
fncis invoked without an explicit command.Options for
fnctimelineare 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 the c timeline 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. -f,--filterglob- Filter timeline by commits containing glob in any of the commit comment, user, or branch fields. Pattern matching is case-insensitive unless glob has at least one uppercase character, which will make the search case-sensitive. Filtering can also be performed at runtime with the F timeline view key binding as documented below.
-h,--help- Display timeline command help and usage information then exit.
-n,--limitn- Limit timeline to the latest n commits. By
default,
fncwill load the entire repository history. Negative values are a no-op. -P,--private- Include commits on private branches. By default, commits on private
branches (such as the “backup/histedit/*” branches
created by
fnchistedit) are hidden. As an exception, when the timeline is restricted to a single private branch (either with-bor by opening a private branch's timeline from the branch view), its commits are shown even without this option. -r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-T,--tagtag- Only display commits with T cards containing
tag. The expected argument is a glob of a commit
manifest's T card argument, with the most recent tag to match being
selected. Pattern matching is case-insensitive unless
tag has at least one uppercase character, which
will make the search case-sensitive. By default,
fncwill display all commits irrespective of which T cards are attached to the commit manifest. -t,--typetype- Only display type commits. Valid
type values are as follows:
c check-in w wiki t ticket e technote f forum post g tag artifact By default,
fncwill load all commits irrespective of type. This is a repeatable flag (e.g.,fnctimeline-t e -t t). -u,--usernameuser- Only display commits authored by user. The search is case-insensitive by default unless user contains at least one uppercase character, which will make the search case-sensitive.
-z,--utc- Display dates and timestamps in Coordinated Universal Time (UTC)
rather than local time. This can also be configured with the
FNC_UTCoption (see ENVIRONMENT for details).
Key bindings for
fnctimelineare as follows:Arrow-down, j, >, .- Move selection cursor down the timeline.
Arrow-up, k, <, ,- Move selection cursor up the timeline.
Arrow-right, l- Scroll view to the right N increments in the buffer (default: 1). Comment field contents move left on the screen.
Arrow-left, h- Scroll view to the left N increments in the buffer (default: 1) Comment field contents move right on the screen.
$- Scroll view to the rightmost position. This corresponds to the end of the longest log message summary line on the page.
0- Scroll view left to the start of the line.
C-f, Page-down- Scroll timeline view N pages downwards in the buffer (default: 1).
C-b, Page-up- Scroll timeline view N pages upwards in the buffer (default: 1).
C-d- Scroll timeline view half of N pages downwards in the buffer (default: 1).
C-u- Scroll timeline view half of N pages upwards in the buffer (default: 1).
Enter- Open a
diffview displaying the changeset of the currently selected commit. Space- Tag or untag the currently selected commit as the base commit for the
next tagged commit to be diffed against. If another commit is already
tagged, open a
diffview showing the changes between it and the currently selected commit. b- Open and populate a
branchview with all repository branches. One of the listed branches can be selected to display a newtimelineview of its commit history. D- Diff local changes on disk in the current work tree against the currently selected commit.
F- Prompt to enter a search term to filter a new timeline view that displays commits with comment, user, or branch fields that match the entered pattern.
t- Open a
treeview displaying the tree of the repository corresponding to the currently selected commit. /- Prompt to enter a search term to begin searching for commits matching the pattern provided. The search term is an extended regular expression that is matched against the comment, author username, branch, and SHA1 or SHA3 hash of each commit in the repository. See re_format(7) for regular expression syntax.
n- Find the Nth next commit that matches the current search term (default: 1). The search will continue until a match is found, the earliest commit on the timeline is consumed, or ^G or backspace are input.
N- Find the Nth previous commit that matches the current search term (default: 1). The search will continue until a match is found, the latest commit on the timeline is consumed, or ^G or backspace are input.
Backspace- Cancel the current search or timeline traversal in progress (i.e.,
operations executed with
/orG/End).
diff[-bCDhiloPqsWwz] [-rpath] [-xn] [artifact1 [artifact2]] [path ...]-
Display the differences between two repository artifacts, or between the local changes in the work tree and a given commit.
(alias:di)If invoked in a work tree with no artifact arguments specified,
fncwill show the differences between the local changes in the work tree and the commit on which the current checkout is based. If invoked in a work tree and only artifact1 is specified,fncwill show the differences between the local changes in the work tree and the commit referenced by artifact1. When artifact1 and artifact2 are specified, the differences between these two versions will be displayed. Both artifact arguments must resolve to the same type (i.e., commits or blobs), and are 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,fncwill filter diffs so that only changes involving the file(s) in the named paths are displayed. Paths may be absolute, relative to the current working directory, or relative to the repository root.When invoked outside a work tree with the
-roption or requesting the differences between blobs, both artifact arguments must be specified; in the latter case, any trailing arguments are invalid and will be ignored.Unless the
-roption is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes a local checkout is open in or above the current working directory.Options for
fncdiffare as follows:-b,--brief- Omit all changes. Show the file index and hash lines only.
-C,--no-colour- Disable coloured diff output, which is enabled by default on supported
terminals. If this option is not used, colour can be toggled with the
cdiff view key binding as documented below. User-defined colours are also supported (see ENVIRONMENT for details). -D,--min-diffstat- Show minimal diffstat instead of the more verbose plot bar histogram.
-h,--help- Display diff command help and usage information then exit.
-i,--invert- Invert the differences between artifacts.
-l,--line-numbers- Display actual file line numbers in diff output.
-o,--no-curses- Do not initialise curses to render the diff view. Write the diff directly to the standard output.
-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. This option is mutually exclusive with
-land-s, which produce incompatible hunk headers. -q,--quiet- Do not output complete content of newly added or deleted files, which are displayed by default. Only show the file index and hash lines.
-r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-s,--sbs- Display a side-by-side formatted diff. This option is mutually
exclusive with
-l. -W,--wrap- Wrap lines that are longer than the width of the diff view or terminal
in
fncdiff-oinvocations. Can be toggled at runtime with theWkey map as documented below. -w,--whitespace- Ignore whitespace-only changes.
-x,--contextn- Set n context lines to be shown in the diff such that 0 ≤ n ≤ 64. Illegal values are a no-op (default: 5).
-z,--utc- Display dates and timestamps in Coordinated Universal Time (UTC)
rather than local time. This can also be configured with the
FNC_UTCoption (see ENVIRONMENT for details).
All the above options (except
-h,-o, and-r) can be made persistent as global or repository options via theFNC_DIFF_FLAGSandFNC_DIFF_CONTEXToptions (see ENVIRONMENT for details).Key bindings for
fncdiffare as follows:Arrow-down, j- Scroll view N lines downwards in the buffer (default: 1). Diff output moves upwards on the screen.
Arrow-up, k- Scroll view N lines upwards in the buffer (default: 1). Diff output moves downwards on the screen.
Arrow-right, l- Scroll view to the right N increments in the buffer (default: 1). Diff output moves left on the screen.
Arrow-left, h- Scroll view to the left N increments in the buffer (default: 1). Diff output moves right on the screen.
$- Scroll view to the rightmost position. This corresponds to the end of the longest line on the page.
0- Scroll view left to the start of the line.
C-e- Move the selection cursor down N lines (default: 1).
C-y- Move the selection cursor up N lines (default: 1).
C-f, Page-down, Space- Scroll diff view N pages downwards in the buffer (default: 1).
C-b, Page-up- Scroll diff view N pages upwards in the buffer (default: 1).
C-d- Scroll diff view half of N pages downwards in the buffer (default: 1).
C-u- Scroll diff view half of N pages upwards in the buffer (default: 1).
C-k, K, <, ,- If the
diffview is derived from thetimelineview, move up to the Nth previous (i.e., newer) commit and display its diff. If derived from theblameview, move up to the Nth previous line in the annotated file and display the corresponding diff (default: 1). C-j, J, >, .- If the
diffview is derived from thetimelineview, move down the timeline to the Nth next (i.e., older) commit and display its diff. If derived from theblameview, move down to the Nth next line in the annotated file and display the corresponding diff (default: 1). C-p- Navigate to the Nth previous file in the diff (default: 1).
C-n- Navigate to the Nth next file in the diff (default: 1).
[- Navigate to the Nth previous hunk in the diff (default: 1).
]- Navigate to the Nth next hunk in the diff (default: 1).
-, _- Decrease the number of context lines in the diff by N (default: 1).
=, +- Increase the number of context lines in the diff by N (default: 1).
#- 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
branchview 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- Toggle display in diff hunk headers of which function or scope each change belongs; for example: @@ -2360,10 +2361,11 @@ draw_commits(struct fnc_view *view)
p- Write the currently viewed diff to a patch file on disk in the /tmp directory. The pathname comprises abbreviated hashes of the commits in the diff (e.g., /tmp/fnc-c1024062-f4467173-7IuqgOKaP2.diff) and is drawn to the status line.
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 word wrap. When enabled, lines longer than the width of the diff view are wrapped and continue on the next line. Lines are broken at whitespace if possible, otherwise lines are broken at the last glyph that fits in the view width.
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 Nth next line that matches the current search term (default: 1).
N- Find the Nth previous line that matches the current search term (default: 1).
tree[-Chz] [-ccommit] [-rpath] [path]-
Display a navigable tree of the repository.
(aliases:dir,tr)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
-roption is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes 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
fnctreeare 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,--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. -h,--help- Display tree command help and usage information then exit.
-r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-z,--utc- Display dates and timestamps in Coordinated Universal Time (UTC)
rather than local time. This can also be configured with the
FNC_UTCoption (see ENVIRONMENT for details).
Key bindings for
fnctreeare as follows:Enter, Arrow-right, l- Enter the currently selected directory, or open a
blameview of the currently selected file. Backspace, Arrow-left, h- Move up to the Nth parent directory (default: 1). This is a no-op when in the root tree.
Arrow-down, j- Move selection cursor N nodes down the tree (default: 1).
Arrow-up, k- Move selection cursor N nodes up the tree (default: 1).
C-f, Page-down- Scroll tree view N pages downwards in the buffer (default: 1).
C-b, Page-up- Scroll tree view N pages upwards in the buffer (default: 1).
C-d- Scroll tree view half of N pages downwards in the buffer (default: 1).
C-u- Scroll tree view half of N pages upwards in the buffer (default: 1).
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
timelineview 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 Nth next tree node that matches the current search pattern (default: 1).
N- Find the Nth previous tree node that matches the current search pattern (default: 1).
blame[-ChRz] [-ccommit] [-llineno] [-nn] [-rpath] path-
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.
(aliases:praise,bl)Unless the
-roption is used to specifiy a fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes a local checkout is open in or above the current working directory.Options for
fncblameare 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,--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. -h,--help- Display blame command help and usage information then exit.
-l,--linelineno- Open the annotated file and navigate directly to lineno.
-n,--limitn- Limit depth of blame history to n commits or
seconds. The latter is denoted by a postfixed 's' (e.g., 30s). With
this option,
fncwill traverse either as many commits as specified or as possible in the specified time limit. By default,fncwill traverse the entire historical record of the file, which can be expensive for large files that span many commits. Use this option for a faster, more targeted annotation. -R,--reverse- Reverse annotate the file starting from a historical commit and move
forward in time so that instead of showing the most recent commit that
changed each line, show the first commit that modified each line after
the specified commit (requires
-c). -r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-z,--utc- Display dates and timestamps in Coordinated Universal Time (UTC)
rather than local time. This can also be configured with the
FNC_UTCoption (see ENVIRONMENT for details).
Key bindings for
fncblameare as follows:Arrow-down, j- Move selection cursor down N lines (default: 1).
Arrow-up, k- Move selection cursor up N lines (default: 1).
Arrow-right, l- Scroll view to the right N increments in the buffer (default: 1). File contents move left on the screen.
Arrow-left, h- Scroll view to the left N increments in the buffer (default: 1). 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 N pages downwards in the buffer (default: 1).
C-b, Page-up- Scroll blame view N pages upwards in the buffer (default: 1).
C-d- Scroll blame view half of N pages downwards in the buffer (default: 1).
C-u- Scroll blame view half of N pages upwards in the buffer (default: 1).
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
diffview of the commit corresponding to the currently selected line. #- Toggle display of file line numbers.
@- Open 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
branchview 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).
N- Find the Nth previous token that matches the current search pattern (default: 1).
n- Find the Nth next token that matches the current search pattern (default: 1).
branch[-CchopRz] [-adate] [-bdate] [-rpath] [-sorder] [glob]-
Display navigable list of repository branches.
(aliases:br,ref)If glob is specified, only display branches matching the pattern provided. Pattern matching is case-insensitive unless glob contains at least one uppercase character, which will make the search case-sensitive.
Unless the
-roption is used to specify a fossil(1) repository, this command must be invoked from within a work tree; that is,fncassumes a local checkout is open in or above the current working directory.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 are 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.
Options for
fncbranchare as follows:-a,--afterdate- Display only those branches with activity after the specified date, which is expected to be either an ISO 8601 (e.g., 2020-10-10) or unambiguous DD/MM/YYYY or MM/DD/YYYY formatted date.
-b,--beforedate- Display only those branches with activity before the specified date, which is expected to be either an ISO 8601 (e.g., 2020-10-10) or 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 this option is not used, 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.
-r,--repopath- Use the repository at the specified path. If not specified, assume a fossil(1) work tree is located in or above the current working directory, and use its configured repository path.
-s,--sortorder- 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.
-z,--utc- Display dates and timestamps in Coordinated Universal Time (UTC)
rather than local time. This can also be configured with the
FNC_UTCoption (see ENVIRONMENT for details).
Key bindings for
fncbranchare as follows:Arrow-down, j- Move selection cursor down N branches (default: 1).
Arrow-up, k- Move selection cursor up N branches (default: 1).
C-f, Page-down- Scroll branch view N pages downwards in the buffer (default: 1).
C-b, Page-up- Scroll branch view N pages upwards in the buffer (default: 1).
C-d- Scroll branch view half of N pages downwards in the buffer (default: 1).
C-u- Scroll branch view half of N pages upwards in the buffer (default: 1).
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
timelineview 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
treeview of the currently selected branch. R, C-l- Reload the view with all repository branches, irrespective of which
options were used in this
fncbranchinvocation. /- 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 Nth next branch that matches the current search pattern (default: 1).
N- Find the Nth previous branch that matches the current search pattern (default: 1).
ENVIRONMENT
When the terminal window is ≥ 120 columns wide,
fnc will display child views in a vertical split at
least 80 columns wide, otherwise a fullscreen will be used. To open child
views in a horizontal split instead, configure the following option as
either an exported environment variable or with fnc
config as documented above.
FNC_VIEW_SPLIT_MODE- Open child views in a horizontal or vertical split. Value can be either "horizontal" or "vertical" (default: vertical).
fnc displays all dates and timestamps in
local time unless the -z option is specified, in
which case all dates and timestamps are in Coordinated Universal Time (UTC).
This can be made persistent without using the -z
option by setting the following option as either an exported environment
variable or with fnc config
as documented above.
FNC_UTC- If set to a non-empty value, display dates and timestamps in Coordinated Universal Time (UTC).
Similarly, diff options can be
persistently applied to all diff views whether directly accessed with
fnc diff or as a child view
of the timeline or blame
views by configuring the following options:
FNC_DIFF_FLAGS- String containing any or all of the available short form
diffboolean flag options documented above except for the-hand-ooptions (i.e., bCDilPqsWwz). If mutually exclusive options "l" and "s" are both specified, whichever is last will take precedence; 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).
Any options passed to fnc
diff will override the above settings.
fnc displays coloured output by default in
supported terminals. Each colour object identified below can be defined by
either exporting environment variables (e.g., export
FNC_COLOUR_COMMIT=red), or with
fnc config as documented
above. At startup, fnc will search for user-defined
colours in the following order:
| 1. repository options | repo.fossil |
| 2. environment variables | shell |
If none are found, the default colour scheme will be displayed.
This enables setting per-project colours to visually distinguish the current
repository being viewed, and globally changing the colour scheme for all
repositories with no local options configured. Except where documented
below, 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:
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; for example, "unset
FNC_DIFF_CONTEXT". As documented above, local
options can be unset with fnc
config -u
option.
EXIT STATUS
The fnc utility exits 0 on success,
and >0 if an error occurs.
SEE ALSO
AUTHORS
Mark Jamsek <mark@jamsek.com>
CAVEATS
fnc displays best with a Unicode character
set. If fnc is invoked in an environment with UTF-8
character encoding selected, it assumes the Unicode character set is
supported; otherwise, fnc defaults to the ASCII
character set. Some fonts may fail to render Unicode characters in the help
view if they lack the requisite glyphs. If your font does not support these
Unicode characters, invoke fnc with "LC_CTYPE=C
fnc" to select the ASCII character set and
encoding.