Skip to content

Commit

Permalink
chore: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Nov 28, 2024
1 parent 2337cda commit 37328aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ require("tinygit").undoLastCommitOrAmend()
- If there was a `push` operation done as a followup (such as `.smartCommit {
pushIfClean = false }`), the last commit is not undone.

<!-- LTeX: enabled=false -->
### GitHub interaction
<!-- LTeX: enabled=true -->
**Search issues & PRs**
- Requires `curl`.

Expand Down Expand Up @@ -245,10 +247,11 @@ The type of history search depends on the mode `.searchHistory` is called from:
* Note that [`git` uses heuristics to determine the enclosing function of
a change](https://news.ycombinator.com/item?id=38153309), so this is not
100% perfect and has varying reliability across languages.
- Another caveat is that for function history, git unfortunately does not
support searching across file renamings.
- Caveat: for function history, git does not support to follow renamings of
the file or function name.
- **Visual line mode**: line range history (`git log -L`).
- Uses the selected lines as the line range.
- Caveat: for line history, git does not support to follow file renamings.

**Keymaps in the diff popup**
- `<Tab>`: show older commit
Expand All @@ -267,7 +270,9 @@ require("tinygit").stashPop()

## Statusline components

<!-- LTeX: enabled=false -->
### git blame
<!-- LTeX: enabled=true -->
Shows the message and date (`git blame`) of the last commit that changed the
current *file* (not line).

Expand Down Expand Up @@ -368,12 +373,12 @@ require("tinygit").setup {
},
autoUnshallowIfNeeded = false,
},
appearance = { -- general plugin appearance
appearance = {
mainIcon = "󰊢",
backdrop = {
enabled = true,
blend = 50, -- 0-100
},
mainIcon = "󰊢",
},
statusline = {
blame = {
Expand Down
4 changes: 2 additions & 2 deletions lua/tinygit/commands/history.lua
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ local function functionHistory()
state.query = funcname

-- select from commits
-- CAVEAT `git log -L` does not support `--follow` and `--name-only`
local result = vim.system({
-- CAVEAT `git log -L` does not support `--follow` and `--name-only`
"git",
"log",
"--format=" .. selectCommit.gitlogFormat,
Expand Down Expand Up @@ -405,8 +405,8 @@ local function lineHistory()
state.lnum = lnum
state.offset = offset

-- CAVEAT `git log -L` does not support `--follow` and `--name-only`
local result = vim.system({
-- CAVEAT `git log -L` does not support `--follow` and `--name-only`
"git",
"log",
"--format=" .. selectCommit.gitlogFormat,
Expand Down
6 changes: 3 additions & 3 deletions lua/tinygit/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ local defaultConfig = {
},
autoUnshallowIfNeeded = false,
},
appearance = { -- general plugin appearance
appearance = {
mainIcon = "󰊢",
backdrop = {
enabled = true,
blend = 50, -- 0-100
},
mainIcon = "󰊢",
},
statusline = {
blame = {
Expand All @@ -94,7 +94,7 @@ M.config = defaultConfig -- in case user does not call `setup`
function M.setupPlugin(userConfig)
M.config = vim.tbl_deep_extend("force", defaultConfig, userConfig or {})

-- DEPRECATION
-- DEPRECATION (2024-11-23)
---@diagnostic disable: undefined-field
if
M.config.staging
Expand Down

0 comments on commit 37328aa

Please sign in to comment.