Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weā€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

šŸ› "navigate" makes less history transient #1261

Open
adamchainz opened this issue Dec 17, 2022 · 2 comments
Open

šŸ› "navigate" makes less history transient #1261

adamchainz opened this issue Dec 17, 2022 · 2 comments

Comments

@adamchainz
Copy link
Contributor

#237 changed delta to duplicate lessā€™ history file before handing over. I find this surprising as it means one cannot recall searches from even previous delta invocations.

For example:

  1. Run git log through delta, search for specific commits with /^author: adam.
  2. Don't find intended commits, quit.
  3. Switch to the right branch.
  4. Run git log agani, type / then up-arrow to find past search - but it's not there.
  5. Have to type out /^author: adam accurately again.

I propose the implementation changes in one of two ways:

  1. Edit the user's default history file in-place to add the navigate search regex (or move to bottom). I didnā€™t spot the reason this option wasnā€™t taken previously. Editing the less history file just a bit doesnā€™t seem as bad as duplicating it.
  2. Duplicate the userā€™s less history file to ~/.local/share/delta/lesshst only if there isnā€™t a duplicate already. Otherwise, only edit the duplicate file, to append/move the navigate search string at/to the end.

Either option would make delta lesses share history. The first would share with other lesses, which is ā€œlessā€ of a win imo.

@dandavison
Copy link
Owner

Hi @adamchainz, thanks, although #237 was a big advance (being able to leave navigate activated and start using it without thinking), I've also been wanting to improve things so that my history is not lost.

Is this something you might be interested in working on? I haven't thought through the design options thoroughly, but I think one fixed premise I'd like to propose is that no non-delta less usage should ever see the automatically-generated delta regexps in less history.

I'm trying to remember the exact usage patterns that have bothered me. The one you describe certainly. I wonder whether I do in fact want delta less to share history with other less usage, much as if one had done git ... | delta | less. I'll watch my own usage.

cc @cben @Kr1ss-XD

@adamchainz
Copy link
Contributor Author

non-delta less usage should ever see the automatically-generated delta regexps in less history.

Why stick to this? It's only one regexp. I don't think it's that troublesome to insert it into the normal less history.

Is this something you might be interested in working on?

Reviewing yes, but writing no, I don't have much Rust experience or time to pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants