Skip to content

Commit c4584ae

Browse files
Junio C HamanoLinus Torvalds
authored andcommitted
[PATCH] Remove "delta" object representation.
Packed delta files created by git-pack-objects seems to be the way to go, and existing "delta" object handling code has exposed the object representation details to too many places. Remove it while we refactor code to come up with a proper interface in sha1_file.c. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent ee85cbc commit c4584ae

25 files changed

+22
-948
lines changed

Documentation/git-fsck-cache.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-fsck-cache - Verifies the connectivity and validity of the objects in the da
99

1010
SYNOPSIS
1111
--------
12-
'git-fsck-cache' [--tags] [--root] [--delta-depth] [--unreachable] [--cache] [<object>*]
12+
'git-fsck-cache' [--tags] [--root] [--unreachable] [--cache] [<object>*]
1313

1414
DESCRIPTION
1515
-----------
@@ -37,9 +37,6 @@ OPTIONS
3737
Consider any object recorded in the cache also as a head node for
3838
an unreachability trace.
3939

40-
--delta-depth::
41-
Report back the length of the longest delta chain found.
42-
4340
It tests SHA1 and general object sanity, and it does full tracking of
4441
the resulting reachability and everything else. It prints out any
4542
corruption it finds (missing or bad objects), and if you use the

Documentation/git-http-pull.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ Downloads a remote GIT repository via HTTP.
2121
Get trees associated with the commit objects.
2222
-a::
2323
Get all the objects.
24-
-d::
25-
Do not check for delta base objects (use this option
26-
only when you know the remote repository is not
27-
deltified).
28-
--recover::
29-
Check dependency of deltified object more carefully than
30-
usual, to recover after earlier pull that was interrupted.
3124
-v::
3225
Report what is downloaded.
3326
-w::

Documentation/git-local-pull.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ OPTIONS
2323
Get trees associated with the commit objects.
2424
-a::
2525
Get all the objects.
26-
-d::
27-
Do not check for delta base objects (use this option
28-
only when you know the remote repository is not
29-
deltified).
30-
--recover::
31-
Check dependency of deltified object more carefully than
32-
usual, to recover after earlier pull that was interrupted.
3326
-v::
3427
Report what is downloaded.
3528
-w::

Documentation/git-mkdelta.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

Documentation/git-ssh-pull.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ commit-id::
3131
Get trees associated with the commit objects.
3232
-a::
3333
Get all the objects.
34-
-d::
35-
Do not check for delta base objects (use this option
36-
only when you know the remote repository is not
37-
deltified).
38-
--recover::
39-
Check dependency of deltified object more carefully than
40-
usual, to recover after earlier pull that was interrupted.
4134
-v::
4235
Report what is downloaded.
4336
-w::

Documentation/git-ssh-push.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ commit-id::
2828
Get tree associated with the requested commit object.
2929
-a::
3030
Get all the objects.
31-
-d::
32-
Do not check for delta base objects (use this option
33-
only when you know the local repository is not
34-
deltified).
35-
--recover::
36-
Check dependency of deltified object more carefully than
37-
usual, to recover after earlier push that was interrupted.
3831
-v::
3932
Report what is uploaded.
4033
-w::

Documentation/git.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ link:git-init-db.html[git-init-db]::
5151
link:git-merge-base.html[git-merge-base]::
5252
Finds as good a common ancestor as possible for a merge
5353

54-
link:git-mkdelta.html[git-mkdelta]::
55-
Creates a delta object
56-
5754
link:git-mktag.html[git-mktag]::
5855
Creates a tag object
5956

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ INSTALL=install
2222

2323
SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
2424
git-pull-script git-tag-script git-resolve-script git-whatchanged \
25-
git-deltafy-script git-fetch-script git-status-script git-commit-script \
25+
git-fetch-script git-status-script git-commit-script \
2626
git-log-script git-shortlog git-cvsimport-script git-diff-script \
2727
git-reset-script git-add-script git-checkout-script git-clone-script \
2828
gitk git-cherry git-rebase-script git-relink-script
@@ -34,7 +34,7 @@ PROG= git-update-cache git-diff-files git-init-db git-write-tree \
3434
git-unpack-file git-export git-diff-cache git-convert-cache \
3535
git-http-pull git-ssh-push git-ssh-pull git-rev-list git-mktag \
3636
git-diff-helper git-tar-tree git-local-pull git-write-blob \
37-
git-get-tar-commit-id git-mkdelta git-apply git-stripspace \
37+
git-get-tar-commit-id git-apply git-stripspace \
3838
git-cvs2git git-diff-stages git-rev-parse git-patch-id \
3939
git-pack-objects git-unpack-objects
4040

@@ -44,7 +44,7 @@ install: $(PROG) $(SCRIPTS)
4444
$(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
4545

4646
LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
47-
tag.o delta.o date.o index.o diff-delta.o patch-delta.o entry.o \
47+
tag.o date.o index.o diff-delta.o patch-delta.o entry.o \
4848
epoch.o refs.o csum-file.o
4949
LIB_FILE=libgit.a
5050
LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h
@@ -117,7 +117,6 @@ git-mktag: mktag.c
117117
git-diff-helper: diff-helper.c
118118
git-tar-tree: tar-tree.c
119119
git-write-blob: write-blob.c
120-
git-mkdelta: mkdelta.c
121120
git-stripspace: stripspace.c
122121
git-cvs2git: cvs2git.c
123122
git-diff-stages: diff-stages.c

README

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ build up a hierarchy of objects.
3232
All objects have a statically determined "type" aka "tag", which is
3333
determined at object creation time, and which identifies the format of
3434
the object (i.e. how it is used, and how it can refer to other
35-
objects). There are currently five different object types: "blob",
36-
"tree", "commit", "tag" and "delta"
35+
objects). There are currently four different object types: "blob",
36+
"tree", "commit" and "tag".
3737

3838
A "blob" object cannot refer to any other object, and is, like the tag
3939
implies, a pure storage object containing some user data. It is used to
@@ -62,16 +62,12 @@ A "tag" object symbolically identifies and can be used to sign other
6262
objects. It contains the identifier and type of another object, a
6363
symbolic name (of course!) and, optionally, a signature.
6464

65-
A "delta" object is used internally by the object database to minimise
66-
disk usage. Instead of storing the entire contents of a revision, git
67-
can behave in a similar manner to RCS et al and simply store a delta.
68-
6965
Regardless of object type, all objects share the following
7066
characteristics: they are all deflated with zlib, and have a header
7167
that not only specifies their tag, but also provides size information
7268
about the data in the object. It's worth noting that the SHA1 hash
73-
that is used to name the object is the hash of the original data or
74-
the delta. (Historical note: in the dawn of the age of git the hash
69+
that is used to name the object is the hash of the original data.
70+
(Historical note: in the dawn of the age of git the hash
7571
was the sha1 of the _compressed_ object)
7672

7773
As a result, the general consistency of an object can always be tested
@@ -219,29 +215,6 @@ verification) has to come from outside.
219215
A tag is created with link:git-mktag.html[git-mktag] and
220216
it's data can be accessed by link:git-cat-file.html[git-cat-file]
221217

222-
Delta Object
223-
~~~~~~~~~~~~
224-
225-
The "delta" object is used internally by the object database to
226-
minimise storage usage by using xdeltas (byte level diffs). Deltas can
227-
form chains of arbitrary length as RCS does (although this is
228-
configureable at creation time). Most operations won't see or even be
229-
aware of delta objects as they are automatically 'applied' and appear
230-
as 'real' git objects In other words, if you write your own routines
231-
to look at the contents of the object database then you need to know
232-
about this - otherwise you don't. Actually, that's not quite true -
233-
one important area where deltas are likely to prove very valuable is
234-
in reducing bandwidth loads - so the more sophisticated network tools
235-
for git repositories will be aware of them too.
236-
237-
Finally, git repositories can (and must) be deltafied in the
238-
background - the work to calculate the differences does not take place
239-
automatically at commit time.
240-
241-
A delta can be created (or undeltafied) with
242-
link:git-mkdelta.html[git-mkdelta] it's raw data cannot be accessed at
243-
present.
244-
245218

246219
The "index" aka "Current Directory Cache"
247220
-----------------------------------------

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ extern char *sha1_file_name(const unsigned char *sha1);
162162
extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
163163
extern int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size);
164164
extern int parse_sha1_header(char *hdr, char *type, unsigned long *sizep);
165-
extern int sha1_delta_base(const unsigned char *, unsigned char *);
166165
extern int sha1_file_size(const unsigned char *, unsigned long *);
167166
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
168167
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);

0 commit comments

Comments
 (0)