Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make fetch-pack play nicer with servers which do not speak multi_ack
Date: Tue, 25 Oct 2005 01:30:38 -0700	[thread overview]
Message-ID: <7vy84igfrl.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0510250854240.22398@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Tue, 25 Oct 2005 08:59:08 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> +		if (insert)
> +			insert_by_date(commit, &rev_list);
> +		else
>  			commit_list_insert(commit, &rev_list);

Hmph.  I do not think insert_by_date and commit_list_insert on
the same commit_list would play well together, since the former
assumes that the list is already sorted by age (i.e. younger ones
near the head, older ones close to the tail).

But you are right.  If you made 20 commits on top of my "master"
branch head, we should send those 20 (and the commit you based
on your changes, which the other end has), way before sending
the ancient v0.99 tag.  Probably, we should never be sending
v0.99 tag as "have" if we are going to send your "master" branch
head, since the commit that tag refers to is reachable by your
"master" branch head but there are a lot more commit between
them, some of which will give us better "common" selected, and
that v0.99 tag is what the other end said they have so is known
to be ACKed if sent.

Although we are doing a traversal on the fetch side to figure
out the commit ancestry chain, I think we are not fully
utilizing the information we receive from the other end.
Typically we pull specific heads only, so get_remote_heads()
culls the information about remote refs and you would not have a
chance to know that v0.99 tag you have in your .git/refs/tags is
something the remote also has, unless you asked for that
particular tag.  I wonder if we can take advantage of that
information without discarding it.  For example,
get_remote_heads() itself knows the object name of v0.99.8 tag
and the object name of the commit the tag refers to, and you
have those objects locally already.  If you have many local
branches, and v0.99.8 commit is reachable from the heads of all
of your local branches, then you should be able to tell that you
do not have to (and you do not want to) send "have" for v0.99.7
and older tags even though they are also in your .git/refs/,
since you know they are all reachable from v0.99.8 commit and
likely to be worse common than v0.99.8.  The best common is
somewhere between v0.99.8 and the tips of your local branches.

This is a minor nit but I think you no longer need to have the
rev_list_end in this version.  It is only used to maintain
itself and not for any other purpose as far as I can see.

  reply	other threads:[~2005-10-25  8:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-25  6:59 [PATCH] Make fetch-pack play nicer with servers which do not speak multi_ack Johannes Schindelin
2005-10-25  8:30 ` Junio C Hamano [this message]
2005-10-25  9:51   ` Johannes Schindelin
2005-10-25 18:56     ` Junio C Hamano
2005-10-25 23:32     ` Junio C Hamano
2005-10-25 23:53       ` 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=7vy84igfrl.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