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

Re: [PATCH 2/2] dir.c: add retry logic to relocate_gitdir

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 4, 2017, 13:34 UTC
Message-ID
<CACsJy8DJtKw+gH+GJTHwGBJ=Bpc=xoN-ck56qNNPLTZ=mC++Lw@mail.gmail.com>
In-Reply-To
<CAGZ79kZoiFfi9+-yqHZmF3Ofp3X-CV6s0qg1bm2CRpN-ETbDLw@mail.gmail.com>
On Tue, Dec 20, 2016 at 6:19 AM, Stefan Beller <sbeller@google.com> wrote:
Show 5 quoted lines
>> On 12/19, Stefan Beller wrote:
> This code is heavily inspired by refs/files-backend.c which upon
> closer inspection only retries directory things within the git directory
> (which is assumed to be accessed in parallel by different invocations
> of Git)

I take inspiration from lock/temp files on the other hand. Could we keep some sort of "undo journal" as we move along and clear it when the "transaction" is completed? The good thing about lock files is, even if you die() or SIGTERM'd, rolling back can still take place (but it has to be something very simple, like removing or renaming because you don't want to do big things in a signal handler).

If things turn out to be complicated and risky to be executed in an unknown context, we could still print a helpful message like "yeah you're in trouble, maybe try this and this, or consult git mailing list. We apologise for the inconvenience,"

-- 
Duy
Previous: Stefan BellerNext: Stefan Beller
Message 5 of 9 in “improve relocate_git_dir to fail into a sane state.”
  1. 0/2 improve relocate_git_dir to fail into a sane state.Stefan Beller, Dec 19, 2016
  2. 2/2 dir.c: add retry logic to relocate_gitdirStefan Beller, Dec 19, 2016
  3. Brandon WilliamsDec 19, 2016
  4. Stefan BellerDec 19, 2016
  5. Duy NguyenJan 4, 2017
  6. 1/2 dir.c: split up connect_work_tree_and_git_dirStefan Beller, Dec 19, 2016
  7. Junio C HamanoDec 19, 2016
  8. Stefan BellerDec 19, 2016
  9. Junio C HamanoDec 19, 2016

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.