Commit Graph

1709 Commits

Author SHA1 Message Date
Dan Davison
6afd3705d8 Refactor: module for working with format strings 2021-08-28 21:36:57 -04:00
Dan Davison
0b8f14503c Add default-language option 2021-08-28 21:36:57 -04:00
Dan Davison
2f0f3ebeef Refactor: syntax_highlight_and_paint_line function 2021-08-28 21:36:57 -04:00
Dan Davison
23e88e5567 Refactor: eliminate format module 2021-08-28 21:36:57 -04:00
Dan Davison
2b8a894489 Use dotted range notation in diff.submodule = short case 2021-08-23 17:56:44 -04:00
Dan Davison
16da5c8d58
Refactor: select next handled event with single disjunction expression (#701)
- create test_* functions for all state machine events
- move test_* into handle_* functions
- select next handled event with pipeline
- Inline test_* functions
2021-08-23 00:28:13 -07:00
Dan Davison
bffa1efded
More minimalistic display of submodule (short) diffs (#700)
* Rename state machine state: Submodule -> SubmoduleLog

* More minimalistic display of submodule log diffs

Partially fixes #662

* Defer emitting hunk header until first true hunk line

A consequence is that we do not emit the (pseudo) hunk header in
submodule (short) state; see #662.
2021-08-23 00:24:49 -07:00
Dan Davison
5e02d340a8
662 submodule diffs (#699) 2021-08-22 11:25:39 -07:00
Dan Davison
67745fee86
Refactor: use Option to model sometimes-null highlighter (#698)
* Refactor: use Option to model sometimes null highlighter

The highlighter is only needed when a language has been identified for
highlighting. Prior to this commit a dummy highlighter was being created
in place of no highlighter at all.

* Improve help text: slowness is due to edit inference

Ref #659
2021-08-21 19:53:07 -07:00
Dan Davison
ad52c74fab Add some test coverage for truncate_str with a multibyte unicode character
https://graphemica.com/%DD%B6

Ref #677
2021-08-21 10:09:28 -07:00
Dan Davison
d29bf95767
Use "syntax theme" terminology in show-syntax-themes output (#697)
Ref #678
2021-08-20 21:14:04 -07:00
Dan Davison
a60652a91d
Merge pull request #694 from dandavison/693-remote-urls
Support `insteadOf` replacements in git remote URLs
2021-08-20 21:13:51 -07:00
Dan Davison
4f6ab57023
Fix deadlock in git diff mode (#695)
Don't wait for the child process to exit before consuming the child
process's output.

Fixes #683
2021-08-20 20:20:44 -07:00
Thomas Otto
a1b5a06cb5
Fix empty line highlighting (#642) 2021-08-20 20:19:42 -07:00
Dan Davison
cf686e93b5 Revert "Add failing test that gitconfig insteadOf is honored"
This reverts commit e540004c9ae3a9fd6d3da6566422fb7f4a9ebdd1.
2021-08-20 19:58:07 -07:00
Dan Davison
601ebdb9d9 Add failing test that gitconfig insteadOf is honored
See #693
2021-08-20 19:58:07 -07:00
Dan Davison
64fa4c6aeb Support insteadOf replacements in git remote URLs
Use libgit2 to query remote URL instead of querying remote.origin.url
directly. This has the consequence that `insteadOf` replacements are
honored.

See https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf

Fixes #693
2021-08-20 19:58:07 -07:00
Dan Davison
cdea15407e Hold GitConfig in main Config struct 2021-08-20 19:58:07 -07:00
Dan Davison
3722146a25 Revert "Support insteadOf replacements in git remote URLs"
This reverts commit d97227ded9.
2021-08-20 19:58:07 -07:00
Dan Davison
98485fcfec Support insteadOf replacements in git remote URLs
Use libgit2 to query remote URL instead of querying remote.origin.url
directly. This has the consequence that `insteadOf` replacements are
honored.

See https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf

Fixes #693
2021-08-20 19:58:07 -07:00
Dan Davison
2c0b35f89c
Refactoring for #693 (#696) 2021-08-20 19:57:11 -07:00
Dan Davison
130b0b6a21
Make it possible to jump between files when navigate is active (#684)
* Use distinct navigate label for file and hunk boundaries

Ref #680

* Make it easy to remove hunk label from navigate regex

Thanks @lepotic for the suggestion.
Fixes #680

* Allow regex meta characters to be used in navigate anchors
2021-08-20 18:34:50 -07:00
Dan Davison
512ccbc01a Bump dev version number 2021-08-20 10:21:19 -07:00
Dan Davison
be61273130 Compile delta from source in dockerfile 2021-08-20 10:19:55 -07:00
ulwlu
9fa449e2b5
Fix computed values to be computed after all set_options (#690)
* Make truecolor option honorable from gitconfig

* Add test that true-color can be read from git config

The new test fails before 7ed3c2c3ee

* Place computing process after set_options

* Add test for checking if values requre computing set correctly

* Remove unnecessary computed values candidate

Co-authored-by: Dan Davison <dandavison7@gmail.com>
2021-08-20 09:51:24 -07:00
Ben Armstead
ea3417abe4
Remove unnecessary borrows (#692) 2021-08-18 11:59:02 -07:00
dependabot[bot]
2de7b51cc9
Bump bitflags from 1.3.1 to 1.3.2 (#691)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/1.3.1...1.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-16 10:10:10 -07:00
dependabot[bot]
a49e12acc0
Bump git2 from 0.13.20 to 0.13.21 (#687)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.13.20 to 0.13.21.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.13.20...0.13.21)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 10:08:14 -07:00
Dan Davison
223b2c6f3d
Ignore ctrl-c (SIGINT) to avoid leaving an orphaned pager process. (#686)
Fixes #681
2021-08-12 15:13:57 -07:00
Dan Davison
362f75e5fb In the docker image: clone delta repo and install rust toolchain 2021-08-12 13:29:58 -07:00
Dan Davison
35ba0dc1a9
Terminate process gracefully on error in diff() (#685)
As noted in the comment in main(), process::exit should be avoided
because it does not call certain destructors.

Fixes #681
2021-08-12 13:17:32 -07:00
Dan Davison
0541c5b3d8 Update Dockerfile 2021-08-12 11:47:59 -07:00
dependabot[bot]
541c887bf7
Bump bitflags from 1.2.1 to 1.3.1 (#682)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.2.1 to 1.3.1.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/1.2.1...1.3.1)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-12 09:45:13 -07:00
dependabot[bot]
c733031528
Bump syntect from 4.5.0 to 4.6.0 (#674)
Bumps [syntect](https://github.com/trishume/syntect) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/trishume/syntect/releases)
- [Changelog](https://github.com/trishume/syntect/blob/master/CHANGELOG.md)
- [Commits](https://github.com/trishume/syntect/compare/v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: syntect
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-02 20:47:45 +01:00
Dan Davison
e5c6ae47d0 clippy
- Fix --allow argument added in previous commit f956a38bfc
- Fix lint
2021-08-02 16:21:06 +01:00
Dan Davison
f956a38bfc Ignore clippy needless_borrow lint failures 2021-08-02 09:12:10 +01:00
Dan Davison
ef92f3f646 Change example config in README
- Use `keep-plus-minus-markers = false` for `git add -p`
- Otherwise resemble "hoopoe" theme
2021-07-28 19:56:22 +01:00
Sebastian Paarmann
c2dc651678
Recognize GitHub SSH remote URLs that don't start with git@ for hyperlinks (#668)
Closes #667.

SSH remote URLs are usually formatted as `git@github.com:user/repo` but
certain setups can allow using just `github.com:user/repo`, see issue #667
for an example.
This modifies the regex used to detect a GitHub remote for hyperlink
generation to also allow the latter form.
2021-07-26 14:37:45 +01:00
norisio
63fdebbf68
Fix the empty result issue in add -p (#664)
* Strip a neglected CR character in ingest_line

* Add test_orphan_carriage_return_is_stripped

* Eliminate redundant assignment in if-let-Some
2021-07-22 22:34:35 +01:00
Dan Davison
e5664693a9 Bump homebrew formula 2021-07-13 16:13:58 +01:00
Dan Davison
7839a36158 Bump version in links to executables 2021-07-13 16:12:27 +01:00
Dan Davison
f01846bd44
Do not resolve executables as relative path from current directory (#658)
* Refactor: child pager process creation

* Protect calls to Command::new behind grep_cli::resolve_binary

* Move less env-var setting into less-specific branch
2021-07-10 15:52:06 +01:00
Dan Davison
2826bdd75b Clippy: don't nest module inside module with same name 2021-07-10 08:22:16 +01:00
Dan Davison
a3fd4bb710 Clippy: don't nest module inside module with same name 2021-07-10 07:08:26 +01:00
Abhishek Keshri
cf3f8c32b8
Add new theme mantis-shrimp (#656)
*colourful and deadly*
2021-07-08 23:30:58 +01:00
Maxim Baz
1315cd71ba
Do not generate hyperlinks for hunks with no file or line number (#650)
* Do not generate hyperlinks for hunks with no file or line number

* Add some tests, apply suggestion
2021-07-08 17:09:56 +01:00
Axel Navarro
2da444a195
README: add links to Linux and macOS packages (#655) 2021-07-08 14:26:26 +01:00
Dan Davison
b6d221cee2 Link to glibc- and musl-linked executables from README 2021-07-08 12:25:46 +01:00
Dan Davison
284673277f Reformat README installation section 2021-07-08 12:21:14 +01:00
Dan Davison
2edeb3712e More clean-up of installation section in README 2021-07-08 12:03:29 +01:00