Skip to content

git bundle create does not close handle to *.lock file #790

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
glhez opened this issue Jun 19, 2016 · 3 comments
Closed

git bundle create does not close handle to *.lock file #790

glhez opened this issue Jun 19, 2016 · 3 comments

Comments

@glhez
Copy link

glhez commented Jun 19, 2016

Hello,

I am running Git 2.9.0 x64 on Windows 7 and git is run under ConEmu 160612 [x64].
Problem arise in mintty too.

$ git version
git version 2.9.0.windows.1

I tried to generate a bundle based on two branch (sync and develop) which are at the same point.
Git fails because the bundle is empty, but it does not remove the lock file because there is still an open handle on it:

git bundle create zeta-bash.2016-06-19.develop.1.home.bundle sync..develop
fatal: Refusing to create empty bundle.
Unlink of file 'E:/git/bundles/zeta-bash.2016-06-19.develop.1.home.bundle.lock' failed. Should I try again? (y/n) n
warning: unable to unlink E:/git/bundles/zeta-bash.2016-06-19.develop.1.home.bundle.lock: Invalid argument

Note: it works on any repository, simply use something like master..master.

I think the problem is here: https://github.com/git-for-windows/git/blob/master/bundle.c#L449

I've forked the git repo: https://github.com/glhez/git/commit/c9d30827cac71e953c5286c431ab5007ff9a1792 but did not have time to test it yet.

@dscho
Copy link
Member

dscho commented Jun 20, 2016

The condition is strange: why going to error label when having ref_count negative, while having no ref_count is also an error ?

The condition ref_count < 0 means that write_bundle_refs() returned an error (printing an error message already). When it is zero instead, the function actually succeeded, and the atexit() handler called implicitly by die() is responsible to roll back the transaction.

@glhez
Copy link
Author

glhez commented Jun 22, 2016

Okay, I've pushed another commit (in fact, I amended it several times) with the removal of curly brace (I do love them, you don't understand the beauty of them :)), with tabs instead of space and with a "better" commit message.

I've created a test, but I don't know if it's well named (tgfw790 for " issue 790").

@dscho
Copy link
Member

dscho commented Jun 23, 2016

Thank you! I will hopefully soon get around to submitting this change upstream, together with other .lock file fixes. Will keep you Cc:ed!

@dscho dscho closed this as completed Jun 23, 2016
dscho pushed a commit that referenced this issue Jul 12, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 16, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 23, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 23, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 23, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 27, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 27, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jul 29, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Aug 2, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Aug 2, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Aug 2, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Aug 2, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Aug 5, 2016
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <[email protected]>
dscho pushed a commit that referenced this issue Jan 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Feb 16, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Mar 23, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Apr 3, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue May 29, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue May 29, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Aug 22, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 23, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 23, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Aug 23, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Aug 28, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 5, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 10, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 11, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 24, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit that referenced this issue Oct 10, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes #790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Oct 11, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where <revlist> resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it don't want to create empty bundle.

However, on Windows the .lock file was still open and could not be
deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Nov 13, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where `<revlist>` resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it does not want to create empty bundle.

However, the `.lock` file was still open and on Windows that means
that it could not be deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
gitster pushed a commit to git/git that referenced this issue Nov 14, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where `<revlist>` resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it does not want to create empty bundle.

However, the `.lock` file was still open and on Windows that means
that it could not be deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
dscho pushed a commit to dscho/git that referenced this issue Nov 14, 2018
When an user tries to create an empty bundle via `git bundle create
<bundle> <revlist>` where `<revlist>` resolves to an empty list (for
example, like `master..master`), the command fails and warns the user
about how it does not want to create empty bundle.

However, the `.lock` file was still open and on Windows that means
that it could not be deleted properly. This patch fixes that issue.

This closes git-for-windows#790

Signed-off-by: Gaël Lhez <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
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