git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Run git status in the background.

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Mar 25, 2013, 09:12 UTC
Message-ID
<CALkWK0magR+9BsFRZYYmNAXTvV8Y-6reLOC1YCUm2fCBRrzFNA@mail.gmail.com>
In-Reply-To
<1363868968-19553-1-git-send-email-iveqy@iveqy.com>
Fredrik Gustafsson wrote:
> If core.preload is set to a non-zero value, every time a git command is
> executed, git status will be runned in the background if the value of
> core.preload is lower than the number of seconds since last run.

Counting the number of seconds since the last run is gross. This kind of setting makes sense in the credential-helper, where you specify how long to cache your password. I don't think you should use a time-based trigger for this feature.

Show 11 quoted lines
> Please see this thread:
> http://article.gmane.org/gmane.comp.version-control.git/218587
>
> This solution solves many of the problems discussed there, but
> introduces new ones. For example, it does have a bigger impact.
>
> With this solution beeing functional but a bit gross, it's not sure that
> it should be placed here at all. However, it's a good place to place it
> for all git-tools to be able to use it without knowing about it. (It
> would speed up all git wrappers and not just bash-prompt like the
> previous solution).

Yes, but you're proposing including a very gross feature in core git. I'm sorry, but this is a non-starter.

Show 12 quoted lines
> There's a few more things to address before shipping this if this is
> considered a good approach. Such as:
>         * Don't run if a "git status"-like git command has been runned. Or a
>           non-repo git command (lite git status or git help) is runned.
>         * Better names for settings and files.
>         * Better(?) invokation of git status (a forked internal call instead
>           of a system call?).
>
> Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
> ---
>  git.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
I would argue that git.c is the wrong place to implement this feature.
 You're essentially doing fopen(), fclose(), stat(), and system():
shouldn't this be a shell script?  I earlier suggested making it
something we can hook to chpwd() in zsh, and I think this is the most
sane suggestion.  This is what z() [1] uses, and I would argue that
your feature shares many similarities with it.
[1]: https://github.com/rupa/z
Previous: Fredrik Gustafsson
Message 2 of 2 in “Run git status in the background.”
  1. Run git status in the background.Fredrik Gustafsson, Mar 21, 2013
  2. Ramkumar RamachandraMar 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.