Skip to content

Getting "Rename failed" question with commit-graph enabled and automatic git gc #2070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
t-b opened this issue Feb 12, 2019 · 2 comments
Closed

Comments

@t-b
Copy link

t-b commented Feb 12, 2019

Setup

  • Which version of Git for Windows are you using?

64-bit

$ git --version --build-options

git version 2.21.0.rc0.windows.1
cpu: x86_64
built from commit: 90e6f79403cde5aac607ce29510fe689a3f7455e
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running?

7 64-bit

$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Use Credential Manager: Disabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

core.commitGraph = true
gc.writeCommitGraph = true

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

After adding a commit and gc kicking in I get

Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Enumerating objects: 1064, done.
Counting objects: 100% (264/264), done.
Delta compression using up to 12 threads
Compressing objects: 100% (264/264), done.
Writing objects: 100% (264/264), done.
Total 264 (delta 150), reused 0 (delta 0)
Computing commit graph generation numbers: 100% (6510/6510), done.
Rename from 'E:/projekte/mies-igor/.git/objects/info/commit-graph.lock' to 'E:/projekte/mies-igor/.git/objects/info/commit-graph' failed. Should I try again? (y/n)
@dscho
Copy link
Member

dscho commented Feb 26, 2019

This should have been prevented by this call:

https://github.com/git-for-windows/git/blob/v2.21.0-rc2.windows.1/commit-graph.c#L1052

Sorry, without an MCVE I cannot really dig further.

@t-b
Copy link
Author

t-b commented Feb 26, 2019

@dscho Thanks for the code pointer.

My envisoned MWE would be

#!/bin/sh

set -e

rm -rf test

mkdir test
cd test
git init
git config --local gc.auto 10
git config --local gc.writeCommitGraph 1
git config --local core.commitGraph 1
git checkout -b feature
echo "" > file.txt
git add file.txt
for i in `seq 1 100`;
do
  echo $i >> file.txt
  git commit --quiet -m "blah" file.txt
done

git gc

but I can't replicate it with that ATM.

I'll reopen if I can reproduce it again.

@t-b t-b closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants