crates.io Crates.io

cargo function history

A cargo frontend for the git function history library.

Installation

cargo install cargo-function-history

Usage

cargo function-history <function-name<:filename>> <options>

or cargo-function-history <function-name<:filename>> <options>

Options

using the tui

Once you run the the command, a tui interface will pop up.

Even if you specified a search via command you ran to open the app, you will still see no function history result, because it is still loading. Once it is done loading, you will see the function history result.

Now that you've opened the app, you will see its split into 3 sections:

command-pane

Even though the viewing pane comes first you generally wont be able to use the viewing pane without entering a command.

To enter editing mode press : then you will see the command pane change to the command input mode, and show the cursor with yellow text in the input bar

To exit editing mode press esc.

If your command is to long to fit on the screen, you can can use the left and right arrow keys to scroll the command pane.

You can also use the up and down arrow keys to scroll through your command history.

Each command starts with one of three command types:

command-pane-search

after typing search you can type the function name you want to search for.

If you want your search to only be for a certain file, you first specify if it is an absolute or relative search with absolute or relative, then the file name, or if you want to search to any file that contains a directory you can do directory directory-name.

If you want your search to also be for a certain date, commit hash, or date range, you can specify that with date, commit-hash, or date-range, then the date, commit hash, or date range (for the date range each date is separated by a space).

If you only need your search to be for a certain date, commit hash, or date range, you can skip the the file name and filetype.

Then press enter to execute the command, and after executing the command you will see the search result in the viewing pane.

command-pane-filter

after running a search (or another filter) typing filter, lets you build a command to filter the current output.

The options vary by if you have already filtered by lets say a date, then you won't be able to filter by a date range or a commit hash.

All the options are:

After entering the command, press enter to execute the command, and after executing the command you will see the search result in the viewing pane.

command-pane-list

After typing list you can type the type of list you want to see with commits or dates.

Then press enter to execute the command, and after executing the command you will see the list result in the viewing pane.

viewing pane

To navigate the viewing pane you need to be in viewing mode. To enter viewing mode from editing mode press esc.

To scroll the file in the viewing pane you can use the the up or k and down or j keys.

To move to the next or previous commit you can use the right or l and left or h keys.

To move through files in a commit you can use the shift + right or l and shift + left or h keys.

At the top it will show the commit hash, date, and time of the commit. With the file name under that.

The file will be shown with the function you searched for with the line numbers.

status pane

The status pane is used to display the status of the program.

There are 4 different status types:

Note

When specifying dates please use the RFC 2822 format, e.g. Mon, 15 Feb 2021 15:04:05 +0000, please put underscores instead of spaces like Mon,_15_Feb_2021_15:04:05_+0000.