alphapapa / alphapapa/magit-todos

Error in process execution forces automatic scanning on status update

Offen
#158 2 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @alphapapa Auf GitHub ansehen
bug
Vorherrschende Sprache
Emacs Lisp
Sterne
792
Forks
54
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This is a pretty minor bug that I noticed but thought was worth reporting.

## Steps to reproduce

* Customise `magit-todos-update` to either `nil` (manual updates) or a number of seconds to cache.
* Run manual `magit-todos-update` to scan for TODOs.
* An error occurs while running the process (for example, `rg` reports permission denied error for a file in the repo working directory).

## Expected behaviour

Afterwards, refreshing magit status will continue to not automatically scan for to-dos (as per the `magit-todos-update` selection).

## Observed behaviour

Afterwards, refreshing magit status will trigger a new scan each time, behaving as if `magit-todos-update` was set to `t`.

## Analysis

* Local variable `magit-todos-updating` is set to `t` before evaluating `magit-todos--async-start-process`. It is only set to `nil` again by the `finish-func` callback (and this only runs if the process succeeds.)
* If there's an error then the `magit-todos-updating` stays `t` until/unless the scan process re-runs and succeeds. This causes the magit status callback to be treated as a manual update each time.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.