{"thread":{"id":"64072","subject":"Git fetch Failure","startedAt":"2025-09-02T14:08:50Z","lastAt":"2025-09-02T20:28:19Z","messageCount":3,"participants":["Tarun【ツ】","Kristoffer Haugsbakk","Karthik Nayak"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"525342","messageId":"CAGAx-2Ac2Tt4-jTH=AApK3m=U7d2RJBaTW=uX6jBHzmpWU9NYw@mail.gmail.com","threadId":"64072","inReplyTo":null,"subject":"Git fetch Failure","fromName":"Tarun【ツ】","fromEmail":"tarunramsinghani@gmail.com","sentAt":"2025-09-02T14:08:38Z","receivedAt":"2025-09-02T14:08:50Z","isPatch":false,"sender":{"key":"tarunramsinghani@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\n\nPlease answer the following questions to help us understand your issue.\n\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\nI am trying to clone the repo from cmdline. the same steps succeeds\nwith git v2.50.1 but fails with git v 2.51.0\n\n\nrepro steps\n\n\nmkdir TasksTest\n\ncd TasksTest\n\ngit init\n\ngit remote add origin https://github.com/microsoft/azure-pipelines-tasks.git\n\ngit fetch\n\n\nWhat did you expect to happen? (Expected behavior)\n\nGit fetch to succeed\n\n\nWhat happened instead? (Actual behavior)\n\nGit fetch failed with error\n\nerror: cannot lock ref\n'refs/remotes/origin/users/ajya/sqlservermoduleimportM146': Unable to\ncreate '/Users/admin/Repos/tasks1/.git/refs/remotes/origin/users/ajya/sqlservermoduleimportM146.lock':\nFile exists.\n\n\nAnother git process seems to be running in this repository, e.g.\n\nan editor opened by 'git commit'. Please make sure all processes\n\nare terminated then try again. If it still fails, a git process\n\nmay have crashed in this repository earlier:\n\nremove the file manually to continue.\n\n\n\n\nWhat's different between what you expected and what actually happened?\n\n\nAnything else you want to add:\n\n\nPlease review the rest of the bug report below.\n\nYou can delete any lines you don't wish to share.\n\n\n\n[System Info]\n\ngit version:\n\ngit version 2.51.0\n\ncpu: arm64\n\nno commit associated with this build\n\nsizeof-long: 8\n\nsizeof-size_t: 8\n\nshell-path: /bin/sh\n\nfeature: fsmonitor--daemon\n\nlibcurl: 8.7.1\n\nzlib: 1.2.12\n\nSHA-1: SHA1_DC\n\nSHA-256: SHA256_BLK\n\ndefault-ref-format: files\n\ndefault-hash: sha1\n\nuname: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29\nPDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000 arm64\n\ncompiler info: clang: 17.0.0 (clang-1700.0.13.3)\n\nlibc info: no libc information available\n\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n\n[Enabled iHooks]\n"},{"id":"525343","messageId":"829c6e09-c834-461f-820d-981512a02a76@app.fastmail.com","threadId":"64072","inReplyTo":"CAGAx-2Ac2Tt4-jTH=AApK3m=U7d2RJBaTW=uX6jBHzmpWU9NYw@mail.gmail.com","subject":"Re: Git fetch Failure","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-09-02T14:46:33Z","receivedAt":"2025-09-02T14:46:55Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Tue, Sep 2, 2025, at 16:08, Tarun【ツ】 wrote:\n>[snip]\n> What happened instead? (Actual behavior)\n>\n> Git fetch failed with error\n>\n> error: cannot lock ref\n> 'refs/remotes/origin/users/ajya/sqlservermoduleimportM146': Unable to\n> create\n> '/Users/admin/Repos/tasks1/.git/refs/remotes/origin/users/ajya/sqlservermoduleimportM146.lock':\n> File exists.\n>[snip]\n> [System Info]\n>\n> git version:\n>\n> git version 2.51.0\n>\n> cpu: arm64\n>\n> no commit associated with this build\n>\n> sizeof-long: 8\n>\n> sizeof-size_t: 8\n>\n> shell-path: /bin/sh\n>\n> feature: fsmonitor--daemon\n>\n> libcurl: 8.7.1\n>\n> zlib: 1.2.12\n>\n> SHA-1: SHA1_DC\n>\n> SHA-256: SHA256_BLK\n>\n> default-ref-format: files\n>\n> default-hash: sha1\n>\n> uname: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29\n> PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000 arm64\n>\n> compiler info: clang: 17.0.0 (clang-1700.0.13.3)\n>\n> libc info: no libc information available\n>\n> $SHELL (typically, interactive shell): /bin/zsh\n>\n>\n>\n> [Enabled iHooks]\n\nIt looks like a casing issue caused by `default-ref-format: files`.\n\n```\n$ git for-each-ref --format='%(refname)' | grep -i sqlServerModuleImportM146\nrefs/remotes/origin/users/ajya/sqlServerModuleImportM146\nrefs/remotes/origin/users/ajya/sqlservermoduleimportM146\n```\n\nYou could try\n\n```\n$ git clone --ref-format=reftable https://github.com/microsoft/azure-pipelines-tasks.git\n```\n\n-- \nKristoffer Haugsbakk\n\n"},{"id":"525372","messageId":"CAOLa=ZQZL3hZE_3ajCAA5=41PZLAVOE=rnPJexu4nPGibNgvRA@mail.gmail.com","threadId":"64072","inReplyTo":"829c6e09-c834-461f-820d-981512a02a76@app.fastmail.com","subject":"Re: Git fetch Failure","fromName":"Karthik Nayak","fromEmail":"karthik.188@gmail.com","sentAt":"2025-09-02T20:28:18Z","receivedAt":"2025-09-02T20:28:19Z","isPatch":false,"sender":{"key":"karthik.188@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1786334?v=4"},"body":"\"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n\n> On Tue, Sep 2, 2025, at 16:08, Tarun【ツ】 wrote:\n>>[snip]\n>> What happened instead? (Actual behavior)\n>>\n>> Git fetch failed with error\n>>\n>> error: cannot lock ref\n>> 'refs/remotes/origin/users/ajya/sqlservermoduleimportM146': Unable to\n>> create\n>> '/Users/admin/Repos/tasks1/.git/refs/remotes/origin/users/ajya/sqlservermoduleimportM146.lock':\n>> File exists.\n>>[snip]\n>> [System Info]\n>>\n>> git version:\n>>\n>> git version 2.51.0\n>>\n>> cpu: arm64\n>>\n>> no commit associated with this build\n>>\n>> sizeof-long: 8\n>>\n>> sizeof-size_t: 8\n>>\n>> shell-path: /bin/sh\n>>\n>> feature: fsmonitor--daemon\n>>\n>> libcurl: 8.7.1\n>>\n>> zlib: 1.2.12\n>>\n>> SHA-1: SHA1_DC\n>>\n>> SHA-256: SHA256_BLK\n>>\n>> default-ref-format: files\n>>\n>> default-hash: sha1\n>>\n>> uname: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29\n>> PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000 arm64\n>>\n>> compiler info: clang: 17.0.0 (clang-1700.0.13.3)\n>>\n>> libc info: no libc information available\n>>\n>> $SHELL (typically, interactive shell): /bin/zsh\n>>\n>>\n>>\n>> [Enabled iHooks]\n>\n> It looks like a casing issue caused by `default-ref-format: files`.\n>\n> ```\n> $ git for-each-ref --format='%(refname)' | grep -i sqlServerModuleImportM146\n> refs/remotes/origin/users/ajya/sqlServerModuleImportM146\n> refs/remotes/origin/users/ajya/sqlservermoduleimportM146\n> ```\n>\n> You could try\n>\n> ```\n> $ git clone --ref-format=reftable https://github.com/microsoft/azure-pipelines-tasks.git\n> ```\n>\n\nYeah, so the issue is that using the files backend on case-insensitive\nfilesystems breaks since there are conflicts due to references with only\ncase difference. Before 2.51 we would simply overwrite one reference\nwith the other _silently_. With 2.51 we use a single transaction for\nreference update and this breaks.\n\nThere was another report similar to this [1] and I've also pushed\npatches to overcome this issue [2]. But with the files backend, there\nwill always be a compromise.\n\nSo like Kristoffer suggested, the best path is to use the reftable\nbackend, which can handle different cases in references.\n\n[1]: https://lore.kernel.org/all/YQXPR01MB3046197EF39296549EE6DD669A33A@YQXPR01MB3046.CANPRD01.PROD.OUTLOOK.COM/\n[2]: https://lore.kernel.org/all/20250902-587-git-fetch-1-fails-fetches-on-case-insensitive-repositories-v1-0-35e69bbb507d@gmail.com/\n\n> --\n> Kristoffer Haugsbakk\n"}]}