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

[PATCH 0/3] Do not be totally silent upon lock error

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2016, 19:41 UTC
Message-ID
<20161207194105.25780-1-gitster@pobox.com>
In-Reply-To
<xmqqd1h3y506.fsf@gitster.mtv.corp.google.com>

Robbie Iannucci reported that "git merge" that fast-forwards fails silently when a competing or stale index.lock is present in recent Git:

    $ git merge --ff-only master; echo $?
    Updating 454cb6bd52..8d7a455ed5
    1
    $ exit

Did the update happen? We used to give "fatal: Unable to create ..." followed by "Another git process seems to be running..." advice, and that would have helped the user from the confusion.

This was because there were only two choices available to the callers of the lockfile API--they can either ask it to die with message when the lock cannot be acquired, or ask it to silently return -1 to signal an error. The recent "libify sequencer" topic turned many existing "please die" calls to "just silently return -1", and while it added new "unable to lock" error messages to most of them, one spot didn't get any and now is allowed to just die silently.

This series should fix it:
 - 1/3 is something I noticed while reading the existing callers of
   the lockfile API, and is not a new issue with "libify sequencer"
   topic.
 - 2/3 gives a new third option to callers of the lockfile API; they
   can now say "please emit the usual error message upon failing to
   acquire the lock, but give control back to me".
 - 3/3 uses the new option to resurrect the message.
Junio C Hamano (3):
  wt-status: implement opportunisitc index update correctly
  hold_locked_index(): align error handling with hold_lockfile_for_update()
  lockfile: LOCK_REPORT_ON_ERROR
 apply.c                          |  2 +-
 builtin/add.c                    |  2 +-
 builtin/am.c                     |  6 +++---
 builtin/checkout-index.c         |  2 +-
 builtin/checkout.c               |  4 ++--
 builtin/clone.c                  |  2 +-
 builtin/commit.c                 |  8 ++++----
 builtin/merge.c                  |  6 +++---
 builtin/mv.c                     |  2 +-
 builtin/read-tree.c              |  2 +-
 builtin/reset.c                  |  2 +-
 builtin/rm.c                     |  2 +-
 builtin/update-index.c           |  1 +
 lockfile.c                       | 12 ++++++++++--
 lockfile.h                       |  8 +++++++-
 merge-recursive.c                |  2 +-
 merge.c                          |  2 +-
 read-cache.c                     |  7 ++-----
 rerere.c                         |  2 +-
 sequencer.c                      |  2 +-
 t/helper/test-scrap-cache-tree.c |  2 +-
 wt-status.c                      |  7 ++++---
 22 files changed, 49 insertions(+), 36 deletions(-)
-- 
2.11.0-274-g0631465056
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 19 in “[BUG] Index.lock error message regression in git 2.11.0”
  1. Robbie IannucciDec 3, 2016
  2. Robbie IannucciDec 3, 2016
  3. Junio C HamanoDec 6, 2016
  4. Re* [BUG] Index.lock error message regression in git 2.11.0Junio C Hamano, Dec 6, 2016
  5. Junio C HamanoDec 7, 2016
  6. 0/3 Do not be totally silent upon lock errorJunio C Hamano, Dec 7, 2016
  7. 1/3 wt-status: implement opportunisitc index update correctlyJunio C Hamano, Dec 7, 2016
  8. Stefan BellerDec 7, 2016
  9. Junio C HamanoDec 7, 2016
  10. Stefan BellerDec 7, 2016
  11. Junio C HamanoDec 7, 2016
  12. Stefan BellerDec 7, 2016
  13. Paul TanDec 8, 2016
  14. Junio C HamanoDec 8, 2016
  15. 2/3 hold_locked_index(): align error handling with hold_lockfile_for_update()Junio C Hamano, Dec 7, 2016
  16. 3/3 lockfile: LOCK_REPORT_ON_ERRORJunio C Hamano, Dec 7, 2016
  17. Johannes SchindelinDec 8, 2016
  18. Robbie IannucciDec 8, 2016
  19. Junio C HamanoDec 8, 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.