Skip to content

Commit

Permalink
transport: drop support for git-over-rsync
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
peff authored and gitster committed Feb 1, 2016
1 parent 7548842 commit 0d0bac6
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 395 deletions.
2 changes: 1 addition & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ pack.indexVersion::
larger than 2 GB.
+
If you have an old Git that does not understand the version 2 `*.idx` file,
cloning or fetching over a non native protocol (e.g. "http" and "rsync")
cloning or fetching over a non native protocol (e.g. "http")
that will copy both `*.pack` file and corresponding `*.idx` file from the
other side may give you a repository that cannot be accessed with your
older version of Git. If the `*.pack` file is smaller than 2 GB, however,
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-bundle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DESCRIPTION
Some workflows require that one or more branches of development on one
machine be replicated on another machine, but the two machines cannot
be directly connected, and therefore the interactive Git protocols (git,
ssh, rsync, http) cannot be used. This command provides support for
ssh, http) cannot be used. This command provides support for
'git fetch' and 'git pull' to operate by packaging objects and references
in an archive at the originating machine, then importing those into
another repository using 'git fetch' and 'git pull'
Expand Down
3 changes: 1 addition & 2 deletions Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ objects from the source repository into a pack in the cloned repository.
--quiet::
-q::
Operate quietly. Progress is not reported to the standard
error stream. This flag is also passed to the `rsync'
command when given.
error stream.

--verbose::
-v::
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-repack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ By default, the command passes `--delta-base-offset` option to
'git pack-objects'; this typically results in slightly smaller packs,
but the generated packs are incompatible with versions of Git older than
version 1.4.4. If you need to share your repository with such ancient Git
versions, either directly or via the dumb http or rsync protocol, then you
versions, either directly or via the dumb http protocol, then you
need to set the configuration variable `repack.UseDeltaBaseOffset` to
"false" and repack. Access from old Git versions over the native protocol
is unaffected by this option as the conversion is performed on the fly
Expand Down
2 changes: 0 additions & 2 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,6 @@ of clones and fetches.
- `ssh`: git over ssh (including `host:path` syntax,
`git+ssh://`, etc).

- `rsync`: git over rsync

- `http`: git over http, both "smart http" and "dumb http".
Note that this does _not_ include `https`; if you want both,
you should specify both as `http:https`.
Expand Down
18 changes: 2 additions & 16 deletions Documentation/gitcore-tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ files).
Again, this can all be simplified with

----------------
$ git clone rsync://rsync.kernel.org/pub/scm/git/git.git/ my-git
$ git clone git://git.kernel.org/pub/scm/git/git.git/ my-git
$ cd my-git
$ git checkout
----------------
Expand Down Expand Up @@ -1011,20 +1011,6 @@ $ git fetch <remote-repository>
One of the following transports can be used to name the
repository to download from:

Rsync::
`rsync://remote.machine/path/to/repo.git/`
+
Rsync transport is usable for both uploading and downloading,
but is completely unaware of what git does, and can produce
unexpected results when you download from the public repository
while the repository owner is uploading into it via `rsync`
transport. Most notably, it could update the files under
`refs/` which holds the object name of the topmost commits
before uploading the files in `objects/` -- the downloader would
obtain head commit object name while that object itself is still
not available in the repository. For this reason, it is
considered deprecated.

SSH::
`remote.machine:/path/to/repo.git/` or
+
Expand Down Expand Up @@ -1430,7 +1416,7 @@ while, depending on how active your project is.

When a repository is synchronized via `git push` and `git pull`
objects packed in the source repository are usually stored
unpacked in the destination, unless rsync transport is used.
unpacked in the destination.
While this allows you to use different packing strategies on
both ends, it also means you may need to repack both
repositories every once in a while.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/gittutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ perform clones and pulls using the ssh protocol:
bob$ git clone alice.org:/home/alice/project myrepo
-------------------------------------

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

Git can also be used in a CVS-like mode, with a central repository
Expand Down
6 changes: 2 additions & 4 deletions Documentation/urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ Depending on the transport protocol, some of this information may be
absent.

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

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

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

Expand Down
36 changes: 0 additions & 36 deletions t/t5510-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,42 +314,6 @@ test_expect_success 'bundle should be able to create a full history' '
'

! rsync --help > /dev/null 2> /dev/null &&
say 'Skipping rsync tests because rsync was not found' || {
test_expect_success 'fetch via rsync' '
git pack-refs &&
mkdir rsynced &&
(cd rsynced &&
git init --bare &&
git fetch "rsync:../.git" master:refs/heads/master &&
git gc --prune &&
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
git fsck --full)
'

test_expect_success 'push via rsync' '
mkdir rsynced2 &&
(cd rsynced2 &&
git init) &&
(cd rsynced &&
git push "rsync:../rsynced2/.git" master) &&
(cd rsynced2 &&
git gc --prune &&
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
git fsck --full)
'

test_expect_success 'push via rsync' '
mkdir rsynced3 &&
(cd rsynced3 &&
git init) &&
git push --all "rsync:rsynced3/.git" &&
(cd rsynced3 &&
test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
git fsck --full)
'
}

test_expect_success 'fetch with a non-applying branch.<name>.merge' '
git config branch.master.remote yeti &&
git config branch.master.merge refs/heads/bigfoot &&
Expand Down
Loading

0 comments on commit 0d0bac6

Please sign in to comment.