All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>,
	Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Subject: Re: Users of git-check-files?
Date: Wed, 03 Aug 2005 11:07:30 -0700	[thread overview]
Message-ID: <7vy87ic2sd.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0508031048360.3258@g5.osdl.org> (Linus Torvalds's message of "Wed, 3 Aug 2005 10:48:49 -0700 (PDT)")

This patch seems to fix the problem.

 * If the original value of remote ref refers to an object we do
   not have, and if the ref is one of the branches we are trying
   to push, we refuse to update it.

 * Otherwise, we do not attempt to use such an value when
   computing what objects to put in pack, since rev-list would
   fail.

I've tested Josef's two-branches case, one repo updates one
branch and pushes to the central repo, another repo updates the
other branch and pushed to the central repo.  The old code
barfed when invoking rev-list, but this does not seem to.

Josef, could you give it a try please?

---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
jit-diff
# - master: git-send-email-script: minimum whitespace cleanup.
# + (working tree)
diff --git a/send-pack.c b/send-pack.c
--- a/send-pack.c
+++ b/send-pack.c
@@ -43,7 +43,8 @@ static void exec_rev_list(struct ref *re
 		char *buf = malloc(100);
 		if (i > 900)
 			die("git-rev-list environment overflow");
-		if (!is_zero_sha1(refs->old_sha1)) {
+		if (!is_zero_sha1(refs->old_sha1) &&
+		    has_sha1_file(refs->old_sha1)) {
 			args[i++] = buf;
 			snprintf(buf, 50, "^%s", sha1_to_hex(refs->old_sha1));
 			buf += 50;
@@ -208,6 +209,12 @@ static int send_pack(int in, int out, in
 			continue;
 		}
 
+		if (!has_sha1_file(ref->old_sha1)) {
+			error("remote '%s' object %s does not exist on local",
+			      name, sha1_to_hex(ref->old_sha1));
+			continue;
+		}
+
 		/* Ok, mark it for update */
 		memcpy(ref->new_sha1, new_sha1, 20);
 	}

Compilation finished at Wed Aug  3 11:02:15

  reply	other threads:[~2005-08-03 18:08 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 23:10 Users of git-check-files? Johannes Schindelin
2005-08-03  2:43 ` Linus Torvalds
2005-08-03  6:17   ` Junio C Hamano
2005-08-03 14:21     ` Johannes Schindelin
2005-08-03 18:00       ` Linus Torvalds
2005-08-03 22:09         ` Johannes Schindelin
2005-08-03 15:09     ` Linus Torvalds
2005-08-03 15:51       ` Junio C Hamano
2005-08-03 16:17         ` Linus Torvalds
2005-08-03 16:36           ` Junio C Hamano
2005-08-03 16:45             ` Linus Torvalds
2005-08-03 16:50               ` Johannes Schindelin
2005-08-03 17:08                 ` Josef Weidendorfer
2005-08-03 17:30                   ` Junio C Hamano
2005-08-03 17:46                   ` Josef Weidendorfer
2005-08-03 18:08                   ` Linus Torvalds
2005-08-03 23:25                     ` [PATCH] (preview) Renaming push Junio C Hamano
2005-08-03 23:48                       ` Linus Torvalds
2005-08-04  0:05                         ` Junio C Hamano
2005-08-04  0:13                           ` Linus Torvalds
2005-08-04  1:02                         ` Junio C Hamano
2005-08-04  5:26                         ` Junio C Hamano
2005-08-04  5:42                           ` Linus Torvalds
2005-08-04  8:09                             ` Junio C Hamano
2005-08-04  9:34                             ` [PATCH] Teach rev-list since..til notation Junio C Hamano
2005-08-03 18:02                 ` Users of git-check-files? Linus Torvalds
2005-08-03 17:02               ` Junio C Hamano
2005-08-03 17:23                 ` Linus Torvalds
2005-08-03 17:37                   ` Junio C Hamano
2005-08-03 17:46                     ` Josef Weidendorfer
2005-08-03 18:10                       ` Linus Torvalds
2005-08-03 17:48                     ` Linus Torvalds
2005-08-03 18:07                       ` Junio C Hamano [this message]
2005-08-03 18:31                         ` Josef Weidendorfer
2005-08-03 16:46             ` Johannes Schindelin
2005-08-04 20:59       ` Junio C Hamano
2005-08-04 21:10         ` 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=7vy87ic2sd.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Josef.Weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.