git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Han Xin <chiyutianyi@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	Jiang Xin <worldhello.net@gmail.com>
Cc: Han Xin <hanxin.hx@alibaba-inc.com>
Subject: [RFC PATCH 0/1] invalid outdated temporary files
Date: Wed, 23 Mar 2022 14:33:12 +0800	[thread overview]
Message-ID: <cover.1648007488.git.hanxin.hx@alibaba-inc.com> (raw)

From: Han Xin <hanxin.hx@alibaba-inc.com>

When I use git on network storage, there may be some temporary files left in
git repositories due to the program quitting unexpectedly, and they also
prevent me from continuing to use the git command line until I manually
delete them.

For some obviously expired temporary files, manual deletion is an extra
expensive job, and one that I think can be avoided. So I wrote this patch.
When creating a temporary file with the same name, if the mtime of the target
file exceeds one day, unlink it first, and then try to recreate it.

Han Xin (1):
  tempfile: invalid outdated temporary files

 Documentation/config/core.txt |  6 ++++++
 cache.h                       |  1 +
 config.c                      |  5 +++++
 environment.c                 |  1 +
 t/t3210-pack-refs.sh          | 10 ++++++++++
 tempfile.c                    | 21 +++++++++++++++++++++
 6 files changed, 44 insertions(+)

-- 
2.35.1.55.gde4365fc52.agit.6.5.7


             reply	other threads:[~2022-03-23  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  6:33 Han Xin [this message]
2022-03-23  6:33 ` [RFC PATCH 1/1] tempfile: invalid outdated temporary files Han Xin
2022-03-23 20:36   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1648007488.git.hanxin.hx@alibaba-inc.com \
    --to=chiyutianyi@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hanxin.hx@alibaba-inc.com \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).