Skip to content

Commit 0d0bac6

Browse files
peffgitster
authored andcommitted
transport: drop support for git-over-rsync
The git-over-rsync protocol is inefficient and broken, and has been for a long time. It transfers way more objects than it needs (grabbing all of the remote's "objects/", regardless of which objects we need). It does its own ad-hoc parsing of loose and packed refs from the remote, but doesn't properly override packed refs with loose ones, leading to garbage results (e.g., expecting the other side to have an object pointed to by a stale packed-refs entry, or complaining that the other side has two copies of the refs[1]). This latter breakage means that nobody could have successfully pulled from a moderately active repository since cd547b4 (fetch/push: readd rsync support, 2007-10-01). We never made an official deprecation notice in the release notes for git's rsync protocol, but the tutorial has marked it as such since 914328a (Update tutorial., 2005-08-30). And on the mailing list as far back as Oct 2005, we can find Junio mentioning it as having "been deprecated for quite some time."[2,3,4]. So it was old news then; cogito had deprecated the transport in July of 2005[5] (though it did come back briefly when Linus broke git-http-pull!). Of course some people professed their love of rsync through 2006, but Linus clarified in his usual gentle manner[6]: > Thanks! This is why I still use rsync, even though > everybody and their mother tells me "Linus says rsync is > deprecated." No. You're using rsync because you're actively doing something _wrong_. The deprecation sentiment was reinforced in 2008, with a mention that cloning via rsync is broken (with no fix)[7]. Even the commit porting rsync over to C from shell (cd547b4) lists it as deprecated! So between the 10 years of informal warnings, and the fact that it has been severely broken since 2007, it's probably safe to simply remove it without further deprecation warnings. [1] http://article.gmane.org/gmane.comp.version-control.git/285101 [2] http://article.gmane.org/gmane.comp.version-control.git/10093 [3] http://article.gmane.org/gmane.comp.version-control.git/17734 [4] http://article.gmane.org/gmane.comp.version-control.git/18911 [5] http://article.gmane.org/gmane.comp.version-control.git/5617 [6] http://article.gmane.org/gmane.comp.version-control.git/19354 [7] http://article.gmane.org/gmane.comp.version-control.git/103635 Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7548842 commit 0d0bac6

File tree

10 files changed

+10
-395
lines changed

10 files changed

+10
-395
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ pack.indexVersion::
20742074
larger than 2 GB.
20752075
+
20762076
If you have an old Git that does not understand the version 2 `*.idx` file,
2077-
cloning or fetching over a non native protocol (e.g. "http" and "rsync")
2077+
cloning or fetching over a non native protocol (e.g. "http")
20782078
that will copy both `*.pack` file and corresponding `*.idx` file from the
20792079
other side may give you a repository that cannot be accessed with your
20802080
older version of Git. If the `*.pack` file is smaller than 2 GB, however,

Documentation/git-bundle.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DESCRIPTION
2020
Some workflows require that one or more branches of development on one
2121
machine be replicated on another machine, but the two machines cannot
2222
be directly connected, and therefore the interactive Git protocols (git,
23-
ssh, rsync, http) cannot be used. This command provides support for
23+
ssh, http) cannot be used. This command provides support for
2424
'git fetch' and 'git pull' to operate by packaging objects and references
2525
in an archive at the originating machine, then importing those into
2626
another repository using 'git fetch' and 'git pull'

Documentation/git-clone.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ objects from the source repository into a pack in the cloned repository.
115115
--quiet::
116116
-q::
117117
Operate quietly. Progress is not reported to the standard
118-
error stream. This flag is also passed to the `rsync'
119-
command when given.
118+
error stream.
120119

121120
--verbose::
122121
-v::

Documentation/git-repack.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ By default, the command passes `--delta-base-offset` option to
133133
'git pack-objects'; this typically results in slightly smaller packs,
134134
but the generated packs are incompatible with versions of Git older than
135135
version 1.4.4. If you need to share your repository with such ancient Git
136-
versions, either directly or via the dumb http or rsync protocol, then you
136+
versions, either directly or via the dumb http protocol, then you
137137
need to set the configuration variable `repack.UseDeltaBaseOffset` to
138138
"false" and repack. Access from old Git versions over the native protocol
139139
is unaffected by this option as the conversion is performed on the fly

Documentation/git.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,6 @@ of clones and fetches.
11231123
- `ssh`: git over ssh (including `host:path` syntax,
11241124
`git+ssh://`, etc).
11251125

1126-
- `rsync`: git over rsync
1127-
11281126
- `http`: git over http, both "smart http" and "dumb http".
11291127
Note that this does _not_ include `https`; if you want both,
11301128
you should specify both as `http:https`.

Documentation/gitcore-tutorial.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ files).
710710
Again, this can all be simplified with
711711

712712
----------------
713-
$ git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ my-git
713+
$ git clone git://git.kernel.org/pub/scm/git/git.git/ my-git
714714
$ cd my-git
715715
$ git checkout
716716
----------------
@@ -1011,20 +1011,6 @@ $ git fetch <remote-repository>
10111011
One of the following transports can be used to name the
10121012
repository to download from:
10131013

1014-
Rsync::
1015-
`rsync://remote.machine/path/to/repo.git/`
1016-
+
1017-
Rsync transport is usable for both uploading and downloading,
1018-
but is completely unaware of what git does, and can produce
1019-
unexpected results when you download from the public repository
1020-
while the repository owner is uploading into it via `rsync`
1021-
transport. Most notably, it could update the files under
1022-
`refs/` which holds the object name of the topmost commits
1023-
before uploading the files in `objects/` -- the downloader would
1024-
obtain head commit object name while that object itself is still
1025-
not available in the repository. For this reason, it is
1026-
considered deprecated.
1027-
10281014
SSH::
10291015
`remote.machine:/path/to/repo.git/` or
10301016
+
@@ -1430,7 +1416,7 @@ while, depending on how active your project is.
14301416

14311417
When a repository is synchronized via `git push` and `git pull`
14321418
objects packed in the source repository are usually stored
1433-
unpacked in the destination, unless rsync transport is used.
1419+
unpacked in the destination.
14341420
While this allows you to use different packing strategies on
14351421
both ends, it also means you may need to repack both
14361422
repositories every once in a while.

Documentation/gittutorial.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ perform clones and pulls using the ssh protocol:
451451
bob$ git clone alice.org:/home/alice/project myrepo
452452
-------------------------------------
453453

454-
Alternatively, Git has a native protocol, or can use rsync or http;
454+
Alternatively, Git has a native protocol, or can use http;
455455
see linkgit:git-pull[1] for details.
456456

457457
Git can also be used in a CVS-like mode, with a central repository

Documentation/urls.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ Depending on the transport protocol, some of this information may be
77
absent.
88

99
Git supports ssh, git, http, and https protocols (in addition, ftp,
10-
and ftps can be used for fetching and rsync can be used for fetching
11-
and pushing, but these are inefficient and deprecated; do not use
12-
them).
10+
and ftps can be used for fetching, but this is inefficient and
11+
deprecated; do not use it).
1312

1413
The native transport (i.e. git:// URL) does no authentication and
1514
should be used with caution on unsecured networks.
@@ -20,7 +19,6 @@ The following syntaxes may be used with them:
2019
- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
2120
- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
2221
- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
23-
- rsync://host.xz/path/to/repo.git/
2422

2523
An alternative scp-like syntax may also be used with the ssh protocol:
2624

t/t5510-fetch.sh

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -314,42 +314,6 @@ test_expect_success 'bundle should be able to create a full history' '
314314
315315
'
316316

317-
! rsync --help > /dev/null 2> /dev/null &&
318-
say 'Skipping rsync tests because rsync was not found' || {
319-
test_expect_success 'fetch via rsync' '
320-
git pack-refs &&
321-
mkdir rsynced &&
322-
(cd rsynced &&
323-
git init --bare &&
324-
git fetch "rsync:../.git" master:refs/heads/master &&
325-
git gc --prune &&
326-
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
327-
git fsck --full)
328-
'
329-
330-
test_expect_success 'push via rsync' '
331-
mkdir rsynced2 &&
332-
(cd rsynced2 &&
333-
git init) &&
334-
(cd rsynced &&
335-
git push "rsync:../rsynced2/.git" master) &&
336-
(cd rsynced2 &&
337-
git gc --prune &&
338-
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
339-
git fsck --full)
340-
'
341-
342-
test_expect_success 'push via rsync' '
343-
mkdir rsynced3 &&
344-
(cd rsynced3 &&
345-
git init) &&
346-
git push --all "rsync:rsynced3/.git" &&
347-
(cd rsynced3 &&
348-
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
349-
git fsck --full)
350-
'
351-
}
352-
353317
test_expect_success 'fetch with a non-applying branch.<name>.merge' '
354318
git config branch.master.remote yeti &&
355319
git config branch.master.merge refs/heads/bigfoot &&

0 commit comments

Comments
 (0)