Merge branch 'maint'

* maint:
  rm: fix bug in recursive subdirectory removal
  Documentation: describe --thin more accurately
This commit is contained in:
Junio C Hamano 2010-02-19 01:31:42 -08:00
commit 50c19c777d
7 changed files with 44 additions and 28 deletions

View file

@ -44,8 +44,8 @@ OPTIONS
locked against repacking.
--thin::
Spend extra cycles to minimize the number of objects to be sent.
Use it on slower connection.
Fetch a "thin" pack, which records objects in deltified form based
on objects not included in the pack to reduce network traffic.
--include-tag::
If the remote side supports it, annotated tags objects will

View file

@ -46,14 +46,10 @@ OPTIONS
'git repack'.
--fix-thin::
It is possible for 'git pack-objects' to build
"thin" pack, which records objects in deltified form based on
objects not included in the pack to reduce network traffic.
Those objects are expected to be present on the receiving end
and they must be included in the pack for that pack to be self
contained and indexable. Without this option any attempt to
index a thin pack will fail. This option only makes sense in
conjunction with --stdin.
Fix a "thin" pack produced by `git pack-objects --thin` (see
linkgit:git-pack-objects[1] for details) by adding the
excluded objects the deltified objects are based on to the
pack. This option only makes sense in conjunction with --stdin.
--keep::
Before moving the index into its final destination

View file

@ -21,16 +21,21 @@ DESCRIPTION
Reads list of objects from the standard input, and writes a packed
archive with specified base-name, or to the standard output.
A packed archive is an efficient way to transfer set of objects
between two repositories, and also is an archival format which
is efficient to access. The packed archive format (.pack) is
designed to be self contained so that it can be unpacked without
any further information, but for fast, random access to the objects
in the pack, a pack index file (.idx) will be generated.
A packed archive is an efficient way to transfer a set of objects
between two repositories as well as an access efficient archival
format. In a packed archive, an object is either stored as a
compressed whole or as a difference from some other object.
The latter is often called a delta.
Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
The packed archive format (.pack) is designed to be self-contained
so that it can be unpacked without any further information. Therefore,
each object that a delta depends upon must be present within the pack.
A pack index file (.idx) is generated for fast, random access to the
objects in the pack. Placing both the index file (.idx) and the packed
archive (.pack) in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
enables git to read from such an archive.
enables git to read from the pack archive.
The 'git unpack-objects' command can read the packed archive and
expand the objects contained in the pack into "one-file
@ -38,10 +43,6 @@ one-object" format; this is typically done by the smart-pull
commands when a pack is created on-the-fly for efficient network
transport by their peers.
In a packed archive, an object is either stored as a compressed
whole, or as a difference from some other object. The latter is
often called a delta.
OPTIONS
-------
@ -179,6 +180,16 @@ base-name::
Add --no-reuse-object if you want to force a uniform compression
level on all data no matter the source.
--thin::
Create a "thin" pack by omitting the common objects between a
sender and a receiver in order to reduce network transfer. This
option only makes sense in conjunction with --stdout.
+
Note: A thin pack violates the packed archive format by omitting
required objects and is thus unusable by git without making it
self-contained. Use `git index-pack --fix-thin`
(see linkgit:git-index-pack[1]) to restore the self-contained property.
--delta-base-offset::
A packed archive can express base object of a delta as
either 20-byte object name or as an offset in the

View file

@ -141,9 +141,10 @@ useful if you write an alias or script around 'git push'.
--thin::
--no-thin::
These options are passed to 'git send-pack'. Thin
transfer spends extra cycles to minimize the number of
objects to be sent and meant to be used on slower connection.
These options are passed to linkgit:git-send-pack[1]. A thin transfer
significantly reduces the amount of sent data when the sender and
receiver share many of the same objects in common. The default is
\--thin.
-v::
--verbose::

View file

@ -48,8 +48,8 @@ OPTIONS
Run verbosely.
--thin::
Spend extra cycles to minimize the number of objects to be sent.
Use it on slower connection.
Send a "thin" pack, which records objects in deltified form based
on objects not included in the pack to reduce network traffic.
<host>::
A remote host to house the repository. When this

2
dir.c
View file

@ -1044,7 +1044,7 @@ int remove_path(const char *name)
slash = dirs + (slash - name);
do {
*slash = '\0';
} while (rmdir(dirs) && (slash = strrchr(dirs, '/')));
} while (rmdir(dirs) == 0 && (slash = strrchr(dirs, '/')));
free(dirs);
}
return 0;

View file

@ -271,4 +271,12 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
test "$status" != 0
'
test_expect_success 'rm removes subdirectories recursively' '
mkdir -p dir/subdir/subsubdir &&
echo content >dir/subdir/subsubdir/file &&
git add dir/subdir/subsubdir/file &&
git rm -f dir/subdir/subsubdir/file &&
! test -d dir
'
test_done