From: "Grégoire Barbier" <gb@gbarbier.org>
To: git@vger.kernel.org
Cc: gitster@pobox.com, "Grégoire Barbier" <gb@gbarbier.org>
Subject: [PATCH] http-push: fail when info/refs exists and is already locked
Date: Sat, 19 Jan 2008 16:22:48 +0100 [thread overview]
Message-ID: <1200756171-11696-2-git-send-email-gb@gbarbier.org> (raw)
In-Reply-To: <1200756171-11696-1-git-send-email-gb@gbarbier.org>
Rationale:
Failing instead of silently not updating remote refs makes the things cleare
for the user when trying to push on a repository while another person do (or
while a dandling locks are waiting for a 10 minutes timeout).
When silently not updating remote refs, the user does not even know that git
has pushed the objects but leaved the refs as they were before (e.g. a new
bunch of commits on branch "master" is uploaded, however the branch by itsel
still points on the previous head commit).
---
http-push.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/http-push.c b/http-push.c
index 2c4e91d..e1984d3 100644
--- a/http-push.c
+++ b/http-push.c
@@ -2243,6 +2243,11 @@ int main(int argc, char **argv)
info_ref_lock = lock_remote("info/refs", LOCK_TIME);
if (info_ref_lock)
remote->can_update_info_refs = 1;
+ else {
+ fprintf(stderr, "Error: cannot lock existing info/refs\n");
+ rc = 1;
+ goto cleanup;
+ }
}
if (remote->has_info_packs)
fetch_indices();
--
1.5.4.rc3.52.g9a5bd-dirty
next prev parent reply other threads:[~2008-01-19 15:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 15:22 [PATCH] http-push: fix webdav lock leak Grégoire Barbier
2008-01-19 15:22 ` Grégoire Barbier [this message]
2008-01-19 15:22 ` [PATCH] http-push: more explicit error message with bad URL or password Grégoire Barbier
2008-01-19 15:22 ` [PATCH] http-push and http-fetch: handle URLs without leading / Grégoire Barbier
2008-01-19 15:22 ` [PATCH] added #define DEFAULT_MAX_REQUESTS for USE_CURL_MULTI mode Grégoire Barbier
2008-01-21 0:13 ` Junio C Hamano
2008-01-21 9:57 ` Grégoire Barbier
2008-01-21 10:19 ` Junio C Hamano
2008-01-19 15:29 ` [PATCH] http-push and http-fetch: handle URLs without leading / Mike Hommey
2008-01-19 23:16 ` Johannes Schindelin
2008-01-19 23:14 ` Johannes Schindelin
2008-01-20 23:00 ` [PATCH] http-push: more explicit error message with bad URL or password Junio C Hamano
2008-01-19 23:08 ` [PATCH] http-push: fix webdav lock leak Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1200756171-11696-2-git-send-email-gb@gbarbier.org \
--to=gb@gbarbier.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).