11 Commits
Author SHA1 Message Date
Johannes AgricolaandNaseschwarz 9056e5e75c Show cursor on panic (#2620)
ratatui::Terminal starts by hiding the cursor. If we panic and abort,
that Terminal instance is not dropped, which leaves restoring the cursor
state to us.

Co-authored-by: Naseschwarz <[email protected]>
2025-04-18 09:53:25 +02:00
Johannes AgricolaandNaseschwarz baa1822180 Remove some #[allow]s II (#2616)
Co-authored-by: Naseschwarz <[email protected]>
2025-04-18 09:29:06 +02:00
Johannes Agricola e08d954573 Clean up a few #[allow]s (#2614) 2025-04-16 10:45:08 +02:00
Johannes AgricolaandNaseschwarz 7f88934d05 Bump msrv to 1.81 (#2613)
Co-authored-by: Naseschwarz <[email protected]>
2025-04-16 09:21:06 +02:00
7f75307f6e Resolve core.hooksPath relative to GIT_WORK_TREE (#2571)
* Resolve core.hooksPath relative to GIT_WORK_TREE

git supports relative values in core.hooksPath.

`man git-config`:

> A relative path is taken as relative to the directory where the hooks are
> run (see the "DESCRIPTION" section of githooks[5]).

`man githooks`:

> Before Git invokes a hook, it changes its working directory to either
> $GIT_DIR in a bare repository or the root of the working tree in a >
> non-bare repository.

I.e. relative paths in core.hooksPath in non-bare repositories are always
relative to GIT_WORK_TREE.

There is a further exception; I believe this is not considered for path
resolution:

> An exception are hooks triggered during a push (pre-receive, update,
> post-receive, post-update, push-to-checkout) which are always executed
> in $GIT_DIR.

* Favor Repository::workdir() over path().parent()

This more clearly errors in case of bare repositories instead of using
the parent directory of the bare repository.

---------

Co-authored-by: Naseschwarz <[email protected]>
Co-authored-by: extrawurst <[email protected]>
2025-04-04 15:28:44 +02:00
Johannes AgricolaandNaseschwarz 89f73d2ec2 Disable dotted range commit yanking (#2577)
The algorithm for computing marked_consecutive assumes that commits are
consecutive in the commit graph if they are consecutive in the
linearized log used in` commitlist.rs`. That is not universally correct,
as siblings may also be displayed consecutively in this list.

For now, this just removes generating commit lists in dotted range
notation.

Co-authored-by: Naseschwarz <[email protected]>
2025-04-04 15:27:50 +02:00
Johannes Agricola 6a884d1388 Consolidate recent theme change docs in THEMES.md (#2575) 2025-03-22 19:43:43 +01:00
Johannes Agricola dcd9a00ff3 Check cargo sort in make check (#2572)
This is run in CI, so running this offline avoids an unnecessary CI
failure.
2025-03-22 11:53:03 +01:00
a91132d187 Bump git2 from 0.20.0 to 0.20.1 (#2567)
* Bump git2 from 0.20.0 to 0.20.1

Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.20.0 to 0.20.1.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.20.0...git2-0.20.1)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Avoid passing reference into struct

git2-rs changed the lifetime of the result of Patch::hunk() to reference
the patch struct:
https://github.com/rust-lang/git2-rs/pull/1141

Thus, returning a patch struct and a reference into it is flagged by the
borrow checker upon move when returning.

This patch avoids returning both alltogether by separating retrieving
and retrieving the patch.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Naseschwarz <[email protected]>
2025-03-18 09:09:11 +01:00
3c1e35eec7 Copy text using OSC52 (#2548)
* Copy text using OSC52 if X/Wayland methods fail
* Move Wayland/X string copying out of copy_string

Copying logic seems too nested to comprehend with the introcution of two
paths towards OSC52 otherwise.

---------

Co-authored-by: Naseschwarz <[email protected]>
Co-authored-by: extrawurst <[email protected]>
2025-03-15 09:33:54 +01:00
Johannes AgricolaandNaseschwarz 381ab45d3a Ignore RUSTSEC-2024-0436 (#2562)
cargo deny reports:

```
ID: RUSTSEC-2024-0436
Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0436
The creator of the crate `paste` has stated in the [`README.md`](https://github.com/dtolnay/paste/blob/master/README.md)
that this project is not longer maintained as well as archived the repository
Announcement: https://github.com/dtolnay/paste
Solution: No safe upgrade is available!
paste v1.0.15
└── ratatui v0.29.0
    ├── gitui v0.27.0
    └── tui-textarea v0.7.0
        └── gitui v0.27.0 (*)
```

In https://github.com/gitui-org/gitui/issues/2554 the decision was made
to ignore this advisory, as ratatui already has removed paste in
https://github.com/ratatui/ratatui/pull/1713 and we are just waiting for
an upstream release.

Co-authored-by: Naseschwarz <[email protected]>
2025-03-14 22:20:10 +01:00