From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/5] allow deepening of a shallow repository
Date: Mon, 13 Nov 2006 23:24:53 -0800 [thread overview]
Message-ID: <7vy7qeze0q.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: Pine.LNX.4.63.0610302009390.26682@wbgn013.biozentrum.uni-wuerzburg.de
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Now, by saying "git fetch -depth <n> <repo>" you can deepen
> a shallow repository.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> commit.c | 13 +++++++++++++
> commit.h | 3 ++-
> fetch-pack.c | 22 ++++++++++++++++------
> git-fetch.sh | 12 +++++++++++-
> shallow.c | 8 ++++++--
> upload-pack.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++-----------
> diff --git a/upload-pack.c b/upload-pack.c
> index ebe1e5a..162dd34 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -134,6 +134,7 @@ static void create_pack_file(void)
> } else {
> for (i = 0; i < want_obj.nr; i++) {
> struct object *o = want_obj.objects[i].item;
> + o->flags &= ~UNINTERESTING;
> add_pending_object(&revs, o, NULL);
> }
> for (i = 0; i < have_obj.nr; i++) {
I am puzzled why this is needed in this series. In other words,
do we have a bug in the current upload-pack that does not have
shallow already by not clearing UNINTERESTING bit? In yet other
words, I haven't figured out which part of the shallow series
makes it necessary to clear UNINTERESTING bit from wanted
object.
> @@ -547,23 +554,51 @@ static void receive_needs(void)
>...
> + for (i = 0; i < shallows.nr; i++) {
> + struct object *object = shallows.objects[i].item;
> + if (object->flags & NOT_SHALLOW) {
> + struct commit_list *parents;
> + packet_write(1, "unshallow %s",
> + sha1_to_hex(object->sha1));
> + object->flags &= ~CLIENT_SHALLOW;
> + /* make sure the real parents are parsed */
> + unregister_shallow(object->sha1);
> + parse_commit((struct commit *)object);
> + parents = ((struct commit *)object)->parents;
> + while (parents) {
> + add_object_array(&parents->item->object,
> + NULL, &want_obj);
> + parents = parents->next;
> + }
> + }
I doubt unregister_shallow() is enough to ensure that the next
parse_commit() re-parses to recover its parents. parse_commit()
says "if (item->object.parsed) return 0" upfront. Don't you
need to do:
object->parsed = 0;
before parse_commit()?
next prev parent reply other threads:[~2006-11-14 7:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-30 19:09 [PATCH 4/5] allow deepening of a shallow repository Johannes Schindelin
2006-11-14 7:24 ` Junio C Hamano [this message]
2006-11-14 11:03 ` Johannes Schindelin
2006-11-17 9:09 ` Junio C Hamano
2006-11-17 9:52 ` Johannes Schindelin
2006-11-17 11:35 ` Junio C Hamano
2006-11-18 12:58 ` 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=7vy7qeze0q.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox