tig_history should first use XDG_CACHE_HOME

Created on 7 Jan 2018  路  4Comments  路  Source: jonas/tig

The .tig_history file, being a history file, is technically a cache file rather than a local data file.

A better order for storing this file while preserving current compat would be $XDG_CACHE_HOME/tig_history $XDG_DATA_HOME/tig/history, ~/.local/share/tig/history, ~/.tig_history.

Most helpful comment

This should be reopened, I'm using tig version 2.4.1 and still writes into $(HOME)/tig_history.
It should write history to $XDG_DATA_HOME/tig/history (or similar) and if $XDG_DATA_HOME is not present then write to $(HOME).local/share/tig/history.

All 4 comments

I disagree that history files are cached data. Cached data to me has always been automatically generated data, the deletion of which won't affect user experience. If a user's history is deleted, it definitely affects user experience. It's also not auto-generated; it's user-generated text strings.

Can you give an example of a program that stores user-visible history with deletable cached data? As a counter-example, Chrome lists browsing history and cached data under two separate categories when asking to clear "browsing data."

I've found, as user-visible history cache, that Thunar saves sessions in .cache/sessions. Deleting these files will affect user experience by not restoring the session. A thunar session could be considered equivalent to browsing history.

The Chrome comment made me realize that browsing history (user history) and cached data (to speed things up) are both cache ("user specific non-essential") but with different effects on user-experience, and the XDG Base Directory Specification does not address this. The former is user generated and the latter auto-generated.

This should be reopened, I'm using tig version 2.4.1 and still writes into $(HOME)/tig_history.
It should write history to $XDG_DATA_HOME/tig/history (or similar) and if $XDG_DATA_HOME is not present then write to $(HOME).local/share/tig/history.

This should be reopened, I'm using tig version 2.4.1 and still writes into $(HOME)/tig_history.
It should write history to $XDG_DATA_HOME/tig/history (or similar) and if $XDG_DATA_HOME is not present then write to $(HOME).local/share/tig/history.

I agree. Having to create the directory $XDG_DATA_HOME/tig first (the current state of things) is not a good solution, as it forces the user to create the directory every time he/she sets up a new system/user account.
The directory should be created if it does not exist (perhaps unless the history file exists in the old location) I think.
This issue made me wrap the executable to create the directory beforehand.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xi picture xi  路  3Comments

kgraefe picture kgraefe  路  8Comments

proski picture proski  路  3Comments

seiyeah78 picture seiyeah78  路  7Comments

hSATAC picture hSATAC  路  8Comments