<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.h, branch v2.2.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.2.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.2.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-07-30T18:29:33Z</updated>
<entry>
<title>use a hashmap to make remotes faster</title>
<updated>2014-07-30T18:29:33Z</updated>
<author>
<name>Patrick Reynolds</name>
<email>patrick.reynolds@github.com</email>
</author>
<published>2014-07-29T14:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0da003d5b1e65f6e52920e42582f43b357782ee'/>
<id>urn:sha1:d0da003d5b1e65f6e52920e42582f43b357782ee</id>
<content type='text'>
Remotes are stored as an array, so looking one up or adding one without
duplication is an O(n) operation.  Reading an entire config file full of
remotes is O(n^2) in the number of remotes.  For a repository with tens of
thousands of remotes, the running time can hit multiple minutes.

Hash tables are way faster.  So we add a hashmap from remote name to
struct remote and use it for all lookups.  The time to add a new remote to
a repo that already has 50,000 remotes drops from ~2 minutes to &lt; 1
second.

We retain the old array of remotes so iterators proceed in config-file
order.

Signed-off-by: Patrick Reynolds &lt;patrick.reynolds@github.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: detect local refspec errors early</title>
<updated>2014-03-05T21:23:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-03-05T19:04:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba928c13d75172799f5f06f922e5c2f3232cf114'/>
<id>urn:sha1:ba928c13d75172799f5f06f922e5c2f3232cf114</id>
<content type='text'>
When pushing, we do not even look at our push refspecs until
after we have made contact with the remote receive-pack and
gotten its list of refs. This means that we may go to some
work, including asking the user to log in, before realizing
we have simple errors like "git push origin matser".

We cannot catch all refspec problems, since fully evaluating
the refspecs requires knowing what the remote side has. But
we can do a quick sanity check of the local side and catch a
few simple error cases.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/shallow-clone'</title>
<updated>2014-01-17T20:21:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-17T20:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92251b1b5b5e53ac9de890105e2a2bd9d15e2ecb'/>
<id>urn:sha1:92251b1b5b5e53ac9de890105e2a2bd9d15e2ecb</id>
<content type='text'>
Fetching from a shallow-cloned repository used to be forbidden,
primarily because the codepaths involved were not carefully vetted
and we did not bother supporting such usage. This attempts to allow
object transfer out of a shallow-cloned repository in a controlled
way (i.e. the receiver become a shallow repository with truncated
history).

* nd/shallow-clone: (31 commits)
  t5537: fix incorrect expectation in test case 10
  shallow: remove unused code
  send-pack.c: mark a file-local function static
  git-clone.txt: remove shallow clone limitations
  prune: clean .git/shallow after pruning objects
  clone: use git protocol for cloning shallow repo locally
  send-pack: support pushing from a shallow clone via http
  receive-pack: support pushing to a shallow clone via http
  smart-http: support shallow fetch/clone
  remote-curl: pass ref SHA-1 to fetch-pack as well
  send-pack: support pushing to a shallow clone
  receive-pack: allow pushes that update .git/shallow
  connected.c: add new variant that runs with --shallow-file
  add GIT_SHALLOW_FILE to propagate --shallow-file to subprocesses
  receive/send-pack: support pushing from a shallow clone
  receive-pack: reorder some code in unpack()
  fetch: add --update-shallow to accept refs that update .git/shallow
  upload-pack: make sure deepening preserves shallow roots
  fetch: support fetching from a shallow repository
  clone: support remote shallow repository
  ...
</content>
</entry>
<entry>
<title>Merge branch 'jc/push-refmap'</title>
<updated>2013-12-27T22:57:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-27T22:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7cdebd8a2039cb3ec717b880709ea6dfd824e3c4'/>
<id>urn:sha1:7cdebd8a2039cb3ec717b880709ea6dfd824e3c4</id>
<content type='text'>
Make "git push origin master" update the same ref that would be
updated by our 'master' when "git push origin" (no refspecs) is run
while the 'master' branch is checked out, which makes "git push"
more symmetric to "git fetch" and more usable for the triangular
workflow.

* jc/push-refmap:
  push: also use "upstream" mapping when pushing a single ref
  push: use remote.$name.push as a refmap
  builtin/push.c: use strbuf instead of manual allocation
</content>
</entry>
<entry>
<title>fetch: support fetching from a shallow repository</title>
<updated>2013-12-11T00:14:17Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-12-05T13:02:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4820a33baa963c4559736d7a1c4c35f8dcb37293'/>
<id>urn:sha1:4820a33baa963c4559736d7a1c4c35f8dcb37293</id>
<content type='text'>
This patch just put together pieces from the 8 steps patch. We stop at
step 7 and reject refs that require new shallow commits.

Note that, by rejecting refs that require new shallow commits, we
leave dangling objects in the repo, which become "object islands" by
the next "git fetch" of the same source.

If the first fetch our "ours" set is zero and we do practically
nothing at step 7, "ours" is full at the next fetch and we may need to
walk through commits for reachability test. Room for improvement.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>connect.c: teach get_remote_heads to parse "shallow" lines</title>
<updated>2013-12-11T00:14:16Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-12-05T13:02:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b06dcd7d6829c86afda6b311cadf009ee4b4dd59'/>
<id>urn:sha1:b06dcd7d6829c86afda6b311cadf009ee4b4dd59</id>
<content type='text'>
No callers pass a non-empty pointer as shallow_points at this
stage. As a result, all clients still refuse to talk to shallow
repository on the other end.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote.h: replace struct extra_have_objects with struct sha1_array</title>
<updated>2013-12-11T00:14:15Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-12-05T13:02:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=13eb4626c43b3116bb431671d593565eadc36852'/>
<id>urn:sha1:13eb4626c43b3116bb431671d593565eadc36852</id>
<content type='text'>
The latter can do everything the former can and is used in many more
places.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: use remote.$name.push as a refmap</title>
<updated>2013-12-04T23:11:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-03T23:41:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca02465b41311fe7634acb9bb5b5c61975ef5f38'/>
<id>urn:sha1:ca02465b41311fe7634acb9bb5b5c61975ef5f38</id>
<content type='text'>
Since f2690487 (fetch: opportunistically update tracking refs,
2013-05-11), we stopped taking a non-storing refspec given on the
command line of "git fetch" literally, and instead started mapping
it via remote.$name.fetch refspecs.  This allows

    $ git fetch origin master

from the 'origin' repository, which is configured with

    [remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*

to update refs/remotes/origin/master with the result, as if the
command line were

    $ git fetch origin +master:refs/remotes/origin/master

to reduce surprises and improve usability.  Before that change, a
refspec on the command line without a colon was only to fetch the
history and leave the result in FETCH_HEAD, without updating the
remote-tracking branches.

When you are simulating a fetch from you by your mothership with a
push by you into your mothership, instead of having:

    [remote "satellite"]
        fetch = +refs/heads/*:refs/remotes/satellite/*

on the mothership repository and running:

    mothership$ git fetch satellite

you would have:

    [remote "mothership"]
        push = +refs/heads/*:refs/remotes/satellite/*

on your satellite machine, and run:

    satellite$ git push mothership

Because we so far did not make the corresponding change to the push
side, this command:

    satellite$ git push mothership master

does _not_ allow you on the satellite to only push 'master' out but
still to the usual destination (i.e. refs/remotes/satellite/master).

Implement the logic to map an unqualified refspec given on the
command line via the remote.$name.push refspec.  This will bring a
bit more symmetry between "fetch" and "push".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref_remove_duplicates(): simplify loop logic</title>
<updated>2013-10-30T21:16:41Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-10-30T05:33:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9afe6654db2bfb776db933f832e7e03052adf98'/>
<id>urn:sha1:b9afe6654db2bfb776db933f832e7e03052adf98</id>
<content type='text'>
Change the loop body into the more straightforward

* remove item from the front of the old list
* if necessary, add it to the tail of the new list

and return a pointer to the new list (even though it is currently
always the same as the input argument, because the first element in
the list is currently never deleted).

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/push-cas'</title>
<updated>2013-09-09T21:30:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-09T21:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2233ad4534db8a37b1bf726312d52d4a0a51db0a'/>
<id>urn:sha1:2233ad4534db8a37b1bf726312d52d4a0a51db0a</id>
<content type='text'>
Allow a safer "rewind of the remote tip" push than blind "--force",
by requiring that the overwritten remote ref to be unchanged since
the new history to replace it was prepared.

The machinery is more or less ready.  The "--force" option is again
the big red button to override any safety, thanks to J6t's sanity
(the original round allowed --lockref to defeat --force).

The logic to choose the default implemented here is fragile
(e.g. "git fetch" after seeing a failure will update the
remote-tracking branch and will make the next "push" pass,
defeating the safety pretty easily).  It is suitable only for the
simplest workflows, and it may hurt users more than it helps them.

* jc/push-cas:
  push: teach --force-with-lease to smart-http transport
  send-pack: fix parsing of --force-with-lease option
  t5540/5541: smart-http does not support "--force-with-lease"
  t5533: test "push --force-with-lease"
  push --force-with-lease: tie it all together
  push --force-with-lease: implement logic to populate old_sha1_expect[]
  remote.c: add command line option parser for "--force-with-lease"
  builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN
  cache.h: move remote/connect API out of it
</content>
</entry>
</feed>
