git/git.git
15 years ago[PATCH] Typofix an error message in pack-check.c
Junio C Hamano [Thu, 7 Jul 2005 22:12:20 +0000 (15:12 -0700)]
[PATCH] Typofix an error message in pack-check.c

The current error message does not make any sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Prevent t6000 series from dropping useless sed.script in t/
Junio C Hamano [Thu, 7 Jul 2005 18:39:10 +0000 (11:39 -0700)]
[PATCH] Prevent t6000 series from dropping useless sed.script in t/

The Makefile in the test suite directory considers any file
matching t[0-9][0-9][0-9][0-9]-*.sh as the top-level test script
to be executed.  Unfortunately this was not documented, and the
common test library, t6000-lib.sh was named to match that
pattern.  This caused t6000-lib.sh to be called from Makefile as
the top-level program, causing it to leave t/sed.script file
behind.  Rename it to t6000lib.sh to prevent this, and document
the naming convention a bit more clearly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Short-circuit git-clone-pack while cloning locally (take 2).
Junio C Hamano [Wed, 6 Jul 2005 20:04:21 +0000 (13:04 -0700)]
[PATCH] Short-circuit git-clone-pack while cloning locally (take 2).

When we are cloning a repository on a local filesystem, it is
faster to just create a hard linkfarm of .git/object hierarchy
and copy the .git/refs files.  By default, the script uses the
clone-pack method, but it can be told with the -l flag to do the
hard linkfarm (falling back on recursive file copy) to replicate
the .git/object hierarchy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agogit-clone-pack: fix sparse warning
Linus Torvalds [Thu, 7 Jul 2005 01:51:56 +0000 (18:51 -0700)]
git-clone-pack: fix sparse warning

Local function that wasn't marked static

15 years ago[PATCH] Tidy up - remove use of (*f)() idiom from epoch.c
Jon Seymour [Thu, 7 Jul 2005 01:26:43 +0000 (11:26 +1000)]
[PATCH] Tidy up - remove use of (*f)() idiom from epoch.c

Replace (*f)() with f() where the former idiom was used in epoch.c

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Ensure list insertion method does not depend on position of --merge-order...
Jon Seymour [Thu, 7 Jul 2005 00:59:13 +0000 (10:59 +1000)]
[PATCH] Ensure list insertion method does not depend on position of --merge-order argument

This change ensures that git-rev-list --merge-order produces the same result
irrespective of what position the --merge-order argument appears in the argument
list.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Write sed script directly into temp file, rather than a variable
Jon Seymour [Thu, 7 Jul 2005 00:50:07 +0000 (10:50 +1000)]
[PATCH] Write sed script directly into temp file, rather than a variable

When sed uses \n rather than ; as a separator (for BSD sed(1) compat),
it is cleaner to use a file directly, rather than an environment
variable containing \n characters.

This change changes t/t6000 write to sed.script directly and changes
the other tests to remove knowledge of sed.script.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Add t/t6003 with some --topo-order tests
Jon Seymour [Thu, 7 Jul 2005 00:50:04 +0000 (10:50 +1000)]
[PATCH] Add t/t6003 with some --topo-order tests

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agoMake gitk use --topo-order instead of --merge-order
Linus Torvalds [Wed, 6 Jul 2005 23:55:53 +0000 (16:55 -0700)]
Make gitk use --topo-order instead of --merge-order

It's cheaper to calculate, and doesn't give different results depending
on the order of the arguments passed in (and is thus more appropriate
for something like gitk that can validly take the unordered "--all" flag
to show all branches).

The previous dup fix seems to have fixed --topo-order.  Holler if you
still see problems.

15 years agogit-rev-list: remove the DUPCHECK logic, use SEEN instead
Linus Torvalds [Wed, 6 Jul 2005 23:52:49 +0000 (16:52 -0700)]
git-rev-list: remove the DUPCHECK logic, use SEEN instead

That's what we should have done in the first place, since it not only
avoids another unnecessary flag, it also protects the commits from
showing up as duplicates later when they show up as parents of another
commit (in the pop_most_recent_commit() path).

This will hopefully also fix --topo-sort.

15 years agoMake sure we generate the whole commit list before trying to sort it topologically
Linus Torvalds [Wed, 6 Jul 2005 17:51:43 +0000 (10:51 -0700)]
Make sure we generate the whole commit list before trying to sort it topologically

This was my cherry-pickng merge bug.  But topo-order still shows strange
behaviour with multiple heads, so keep gitk using --merge-order for now.

15 years ago[PATCH] Let umask do its work upon filesystem object creation.
Junio C Hamano [Wed, 6 Jul 2005 08:21:46 +0000 (01:21 -0700)]
[PATCH] Let umask do its work upon filesystem object creation.

IIRC our strategy was to let the users' umask take care of the
final mode bits.  This patch fixes places that deviate from it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] clone-pack.c:write_one_ref() - Create leading directories.
Junio C Hamano [Wed, 6 Jul 2005 08:11:52 +0000 (01:11 -0700)]
[PATCH] clone-pack.c:write_one_ref() - Create leading directories.

The function write_one_ref() is passed the list of refs received
from the other end, which was obtained by directory traversal
under $GIT_DIR/refs; this can contain paths other than what
git-init-db prepares and would fail to clone when there is
such.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Fixes a problem with --merge-order A B (A is linear descendent of a merge B)
Jon Seymour [Wed, 6 Jul 2005 16:39:35 +0000 (02:39 +1000)]
[PATCH] Fixes a problem with --merge-order A B (A is linear descendent of a merge B)

This patch passes the test case introduced by the previous patch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Add a t/t6001 test case for a --merge-order bug
Jon Seymour [Wed, 6 Jul 2005 16:39:35 +0000 (02:39 +1000)]
[PATCH] Add a t/t6001 test case for a --merge-order bug

This test case demonstrates a problem with --merge-order.

A
|
B
|\
C D
|/
E
|
F

git-rev-list --merge-order A B doesn't produce the expected output of

A
B
D
C
E
F

The problem is fixed by a subsequent patch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Tidy up - slight simplification of rev-list.c
Jon Seymour [Wed, 6 Jul 2005 16:39:34 +0000 (02:39 +1000)]
[PATCH] Tidy up - slight simplification of rev-list.c

This patch implements a small tidy up of rev-list.c to reduce
(but not eliminate) the amount of ugliness associated
with the merge_order flag.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agoAdd "--topo-order" flag to use new topological sort
Linus Torvalds [Wed, 6 Jul 2005 17:25:04 +0000 (10:25 -0700)]
Add "--topo-order" flag to use new topological sort

15 years ago[PATCH] Add a topological sort procedure to commit.c
Jon Seymour [Wed, 6 Jul 2005 16:39:34 +0000 (02:39 +1000)]
[PATCH] Add a topological sort procedure to commit.c

This introduces an in-place topological sort procedure to commit.c.

Given a list of commits, sort_in_topological_order() will perform an in-place
topological sort of that list.

The invariant that applies to the resulting list is:

       a reachable from b => ord(b) < ord(a)

This invariant is weaker than the --merge-order invariant, but is cheaper
to calculate (assuming the list has been identified) and will serve any
purpose where only a minimal topological order guarantee is required.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agoUse the new git-rev-parse "--[no-]flags" in "git diff".
Linus Torvalds [Wed, 6 Jul 2005 17:09:58 +0000 (10:09 -0700)]
Use the new git-rev-parse "--[no-]flags" in "git diff".

This allows you to do

git diff v2.6.12..v2.6.13-rc1 drivers/pcmcia

to see the diff between v2.6.12 and v2.6.13-rc1 as limited by the
filename argument.

15 years agoAdd "--flags" and "--no-flags" arguments to git-rev-parse
Linus Torvalds [Wed, 6 Jul 2005 17:08:08 +0000 (10:08 -0700)]
Add "--flags" and "--no-flags" arguments to git-rev-parse

The scripts that use this (notably "git diff") will want to split up
flags and file arguments.

15 years agoRemove insane overlapping bit ranges from epoch.c
Linus Torvalds [Wed, 6 Jul 2005 16:56:16 +0000 (09:56 -0700)]
Remove insane overlapping bit ranges from epoch.c

..and move the DUPCHECK to rev-list.c since both the merge-order and the
upcoming topo-sort get confused by dups.

15 years agoClean up commit insertion in git-rev-list
Linus Torvalds [Wed, 6 Jul 2005 16:38:06 +0000 (09:38 -0700)]
Clean up commit insertion in git-rev-list

Jon wants the commits in a different order for merge-order.

15 years agoMake "insert_by_date()" match "commit_list_insert()"
Linus Torvalds [Wed, 6 Jul 2005 16:31:17 +0000 (09:31 -0700)]
Make "insert_by_date()" match "commit_list_insert()"

Same argument order, same return type.  This allows us to use a function
pointer to choose one over the other.

15 years ago[PATCH] Change the sed seperator in t/t6000-lib.sh.
Jon Seymour [Wed, 6 Jul 2005 10:11:29 +0000 (20:11 +1000)]
[PATCH] Change the sed seperator in t/t6000-lib.sh.

This trivial patch removes the semicolon as the sed seperator in the t/t6000-lib.sh test script
and replaces it with white space.  This makes BSD sed(1) much happier.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Introduce unit tests for git-rev-list --bisect
Jon Seymour [Wed, 6 Jul 2005 10:11:27 +0000 (20:11 +1000)]
[PATCH] Introduce unit tests for git-rev-list --bisect

This patch introduces some unit tests for the git-rev-list --bisect functionality.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Factor out useful test case infrastructure from t/t6001... into t/t6000-lib.sh
Jon Seymour [Wed, 6 Jul 2005 10:11:24 +0000 (20:11 +1000)]
[PATCH] Factor out useful test case infrastructure from t/t6001... into t/t6000-lib.sh

Functions that are useful to other t6xxx testcases are moved into t6000-lib.sh

To use these functions in a test case, use a test-case pre-amble like:

. ./test-lib.sh
. ../t6000-lib.sh # t6xxx specific functions

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Fix fd leak in git-cvsimport-script
Sven Verdoolaege [Wed, 6 Jul 2005 06:37:12 +0000 (08:37 +0200)]
[PATCH] Fix fd leak in git-cvsimport-script

Remember to close temporary file

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] sha1_file.c;prepare_packed_git_one() - fix DIR leak
Junio C Hamano [Wed, 6 Jul 2005 06:52:17 +0000 (23:52 -0700)]
[PATCH] sha1_file.c;prepare_packed_git_one() - fix DIR leak

The function calls opendir() without a matching closedir().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agoMerge master.kernel.org:/pub/scm/gitk/gitk
Linus Torvalds [Wed, 6 Jul 2005 02:00:26 +0000 (19:00 -0700)]
Merge master.kernel.org:/pub/scm/gitk/gitk

15 years agoFix up path-cleanup in git_path() properly
Linus Torvalds [Wed, 6 Jul 2005 01:10:59 +0000 (18:10 -0700)]
Fix up path-cleanup in git_path() properly

GIT_DIR=.  ends up being what some of the pack senders use, and we
sometimes messed up when cleaning up the path, ie a ".//HEAD" was
cleaned up into "/HEAD", not "HEAD" like it should be.

We should do some other cleanup, and probably also verify that symlinks
don't point to outside the git area.

15 years agoIncrease the number of possible heads requested from git-upload-pack
Linus Torvalds [Wed, 6 Jul 2005 00:19:20 +0000 (17:19 -0700)]
Increase the number of possible heads requested from git-upload-pack

Now that git-clone-pack exists, we actually have somebody requesting
more than just a single head in a pack.  So allow the Jeff's of this
world to clone things with tens of heads.

15 years agoAdd a "git-show-index" helper that shows the contents of a pack index
Linus Torvalds [Wed, 6 Jul 2005 00:08:02 +0000 (17:08 -0700)]
Add a "git-show-index" helper that shows the contents of a pack index

This was invaluable for debugging the zero-sized compression issue, and
might be useful for scripting too, if people want to see the contents of
a pack.

15 years agoDon't special-case a zero-sized compression.
Linus Torvalds [Wed, 6 Jul 2005 00:06:09 +0000 (17:06 -0700)]
Don't special-case a zero-sized compression.

zlib actually writes a header for that case, and while ignoring that
header will get us the right data, it will also end up messing up our
stream position.  So we actually want zlib to "uncompress" even an empty
object.

15 years agoMake "git clone" use the new git-clone-pack
Linus Torvalds [Tue, 5 Jul 2005 22:47:34 +0000 (15:47 -0700)]
Make "git clone" use the new git-clone-pack

15 years agoAdd "git-clone-pack" program to help with "git clone"
Linus Torvalds [Tue, 5 Jul 2005 22:45:37 +0000 (15:45 -0700)]
Add "git-clone-pack" program to help with "git clone"

15 years agoFix silly thinko in "head_ref()"
Linus Torvalds [Tue, 5 Jul 2005 22:45:00 +0000 (15:45 -0700)]
Fix silly thinko in "head_ref()"

It did a "for_each_ref()" in addition to the HEAD case, which was a
left-over from an early broken test.

15 years agoMove "get_ack()" to common git_connect functions
Linus Torvalds [Tue, 5 Jul 2005 22:44:09 +0000 (15:44 -0700)]
Move "get_ack()" to common git_connect functions

git-clone-pack will want it too. Soon.

15 years agoRemove multi-head support from fetch-pack
Linus Torvalds [Tue, 5 Jul 2005 21:39:30 +0000 (14:39 -0700)]
Remove multi-head support from fetch-pack

It was a misguided attempt to mix fetching and cloning. I'll make
a separate clone thing.

15 years agoRemove unnecessary usage of strncmp() in git-rev-list arg parsing.
Linus Torvalds [Tue, 5 Jul 2005 19:12:50 +0000 (12:12 -0700)]
Remove unnecessary usage of strncmp() in git-rev-list arg parsing.

Not only is it unnecessary, it incorrectly allows extraneous characters
at the end of the argument.

Junio noticed the --merge-order thing, and Jon points out that if we fix
that one, we should fix --show-breaks too.

15 years agoMerge head 'cvs2git' of http://netz.smurf.noris.de/git/git
Linus Torvalds [Tue, 5 Jul 2005 19:03:14 +0000 (12:03 -0700)]
Merge head 'cvs2git' of netz.smurf.noris.de/git/git

15 years agoWork around git-http-pull breakage in git-fetch-script
Linus Torvalds [Tue, 5 Jul 2005 19:02:10 +0000 (12:02 -0700)]
Work around git-http-pull breakage in git-fetch-script

Need to add a final slash.  And make it verbose by default, since it's
so slow that otherwise people will think it's died.

15 years agogit-fetch-script: use git-fetch-pack for local and ssh fetches.
Linus Torvalds [Tue, 5 Jul 2005 18:38:37 +0000 (11:38 -0700)]
git-fetch-script: use git-fetch-pack for local and ssh fetches.

Also, clean it up a lot.

15 years agoAdd "git_path()" and "head_ref()" helper functions.
Linus Torvalds [Tue, 5 Jul 2005 18:31:32 +0000 (11:31 -0700)]
Add "git_path()" and "head_ref()" helper functions.

"git_path()" returns a static pathname pointer into the git directory
using a printf-like format specifier.

"head_ref()" works like "for_each_ref()", except for just the HEAD.

15 years agoMerge with Linus' current tree
Matthias Urlichs [Tue, 5 Jul 2005 13:32:29 +0000 (15:32 +0200)]
Merge with Linus' current tree

15 years agoMerge with http://www.liacs.nl/~sverdool/git.git#cvs2git
Matthias Urlichs [Tue, 5 Jul 2005 12:23:36 +0000 (14:23 +0200)]
Merge ... www.liacs.nl/~sverdool/git.git#cvs2git

15 years agocvsimport: getopt accepted a -q option (undocumented and unused).
Matthias Urlichs [Tue, 5 Jul 2005 12:22:53 +0000 (14:22 +0200)]
cvsimport: getopt accepted a -q option (undocumented and unused).
           Removed.

15 years agogit-cvsimport-script: move working directory forward
Sven Verdoolaege [Tue, 5 Jul 2005 11:19:59 +0000 (13:19 +0200)]
git-cvsimport-script: move working directory forward

If HEAD happened to point to a cvs branch, move the
working directory forward to the tip of the branch.
Additionally, if master and "origin" are equal,
move master forward to new origin first.

15 years agogit-rev-list: make sure the output is sorted by recency
Linus Torvalds [Mon, 4 Jul 2005 23:49:37 +0000 (16:49 -0700)]
git-rev-list: make sure the output is sorted by recency

We didn't sort the refs by date, so if you had multiple refs, the end
result would not be properly sorted.

15 years agoMake rev-list flush the stdio buffers after each rev.
Linus Torvalds [Mon, 4 Jul 2005 23:36:48 +0000 (16:36 -0700)]
Make rev-list flush the stdio buffers after each rev.

We'd rather get the revisions in a slow but timely manner than
have to wait for them.

15 years agoMake git-fetch-pack actually do all the unpacking etc.
Linus Torvalds [Mon, 4 Jul 2005 23:35:13 +0000 (16:35 -0700)]
Make git-fetch-pack actually do all the unpacking etc.

It returns the result SHA1 on stdout, so you can do

remote=$(git-fetch-pack host:dir branchname)

and it will unpack the objects and "remote" will be the SHA1 name of the
branch on the other side.  You can then save that off, or merge it, or
whatever.

15 years agoMake git-fetch-pack and git-upload-pack negotiate needs/haves fully
Linus Torvalds [Mon, 4 Jul 2005 22:29:17 +0000 (15:29 -0700)]
Make git-fetch-pack and git-upload-pack negotiate needs/haves fully

Now the only piece missing is actually generating the pack-file.

15 years agoClean up output of "for_each_ref()" when GIT_DIR is "."
Linus Torvalds [Mon, 4 Jul 2005 22:28:19 +0000 (15:28 -0700)]
Clean up output of "for_each_ref()" when GIT_DIR is "."

Remove the "./" at the head, it just looks much nicer.

15 years agogit-cvsimport-script: remove unused variable
Sven Verdoolaege [Mon, 4 Jul 2005 21:18:35 +0000 (23:18 +0200)]
git-cvsimport-script: remove unused variable

15 years agoCommit first cut at "git-fetch-pack"
Linus Torvalds [Mon, 4 Jul 2005 20:26:53 +0000 (13:26 -0700)]
Commit first cut at "git-fetch-pack"

It's meant to be used by "git fetch" for the local and ssh case.

It doesn't actually do the fetching now, but it does discover the common
commit point.

15 years agoMove ref path matching to connect.c library
Linus Torvalds [Mon, 4 Jul 2005 20:24:30 +0000 (13:24 -0700)]
Move ref path matching to connect.c library

It's a generic thing for matching refs from the other side.

15 years agoFactor out the ssh connection stuff from send-pack.c
Linus Torvalds [Mon, 4 Jul 2005 18:57:58 +0000 (11:57 -0700)]
Factor out the ssh connection stuff from send-pack.c

I want to use it for git-fetch-pack too.

15 years agogit-cvsimport-script: more error handling
Sven Verdoolaege [Mon, 4 Jul 2005 15:36:25 +0000 (17:36 +0200)]
git-cvsimport-script: more error handling

15 years ago[PATCH] Fixup t/t5300 unit tests broken by 5f3de58ff85c49620ae2a1722d8d4d37c881a054
Jon Seymour [Mon, 4 Jul 2005 13:15:36 +0000 (23:15 +1000)]
[PATCH] Fixup t/t5300 unit tests broken by 5f3de58ff85c49620ae2a1722d8d4d37c881a054

This patch fixes up the t/t5300 unit tests which were broken by the changes in:

Make the name of a pack-file depend on the objects packed there-in.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agogit-cvsimport-script: provide direct support for cvsps -z option
Sven Verdoolaege [Mon, 4 Jul 2005 15:10:06 +0000 (17:10 +0200)]
git-cvsimport-script: provide direct support for cvsps -z option

15 years agogit-cvsimport-script: update cvsps cache instead of rebuilding it
Sven Verdoolaege [Mon, 4 Jul 2005 13:35:30 +0000 (15:35 +0200)]
git-cvsimport-script: update cvsps cache instead of rebuilding it

Updating the cache is sufficient for most purposes.
If users really want to rebuild the cache, they can specify
the option themselves.

15 years agogit-cvsimport-script: fix branch switching
Sven Verdoolaege [Mon, 4 Jul 2005 13:28:36 +0000 (15:28 +0200)]
git-cvsimport-script: fix branch switching

Previous patch broke branch switching.

15 years agogit-cvsimport-script: use private index.
Sven Verdoolaege [Mon, 4 Jul 2005 11:36:59 +0000 (13:36 +0200)]
git-cvsimport-script: use private index.

15 years agogit-rev-parse: support show sha1 names for pack entries
Linus Torvalds [Mon, 4 Jul 2005 04:01:11 +0000 (21:01 -0700)]
git-rev-parse: support show sha1 names for pack entries

This is actually subtly wrong.  If a short match is found in the object
directory, but would _also_ match another SHA1 ID in a pack (or it shows
in one pack but not another), we'll never have done the pack lookup, and
we think it's unique.

I can't find it in myself to care.  You really want to use enough of a
SHA1 that there is never any ambiguity.

15 years agoMake git-rev-parse support cogito-style "short hex names"
Linus Torvalds [Mon, 4 Jul 2005 03:27:06 +0000 (20:27 -0700)]
Make git-rev-parse support cogito-style "short hex names"

Currently only for unpacked objects, but the infrastructure
is there to do it for packed objects too.

15 years agogit-cvsimport-script: leave working directory alone.
Sven Verdoolaege [Sun, 3 Jul 2005 22:43:26 +0000 (00:43 +0200)]
git-cvsimport-script: leave working directory alone.

15 years agoMake the name of a pack-file depend on the objects packed there-in.
Linus Torvalds [Sun, 3 Jul 2005 22:34:04 +0000 (15:34 -0700)]
Make the name of a pack-file depend on the objects packed there-in.

This means that the .git/objects/pack directory is also rsync'able,
since the filenames created there-in are either unique or refer to the
same data.

Otherwise you might not be able to pull from a directory that is partly
packed without having to worry about missing objects due to pack-file
name clashes.

15 years agogit-cvsimport-script: typo head -> heads
Sven Verdoolaege [Sun, 3 Jul 2005 21:40:48 +0000 (23:40 +0200)]
git-cvsimport-script: typo head -> heads

15 years agoAdd "git-prune-packed" that removes objects that exist in a pack.
Linus Torvalds [Sun, 3 Jul 2005 21:27:34 +0000 (14:27 -0700)]
Add "git-prune-packed" that removes objects that exist in a pack.

This, together with "git repack" can be used to clean up unpacked
git archives.

15 years agoAdd "git repack" command that does an incremental pack
Linus Torvalds [Sun, 3 Jul 2005 20:38:01 +0000 (13:38 -0700)]
Add "git repack" command that does an incremental pack

15 years agoAdd "--non-empty" flag to git-pack-objects
Linus Torvalds [Sun, 3 Jul 2005 20:36:58 +0000 (13:36 -0700)]
Add "--non-empty" flag to git-pack-objects

It skips writing the pack-file if it ends up being empty.

15 years ago"git rev-list --unpacked" shows only unpacked commits
Linus Torvalds [Sun, 3 Jul 2005 20:29:54 +0000 (13:29 -0700)]
"git rev-list --unpacked" shows only unpacked commits

More infrastructure to do efficient incremental packs.

15 years agoAdd "--incremental" flag to git-pack-objects
Linus Torvalds [Sun, 3 Jul 2005 20:08:40 +0000 (13:08 -0700)]
Add "--incremental" flag to git-pack-objects

It won't add an object that is already in a pack to the new pack.

15 years agoAdd "--all" flag to rev-parse that shows all refs
Linus Torvalds [Sun, 3 Jul 2005 20:07:52 +0000 (13:07 -0700)]
Add "--all" flag to rev-parse that shows all refs

And make git-rev-list just silently ignore non-commit refs if we're not
asking for all objects.

15 years agoAdd "has_sha1_pack()" function to query whether the object is available in a pack
Linus Torvalds [Sun, 3 Jul 2005 20:06:36 +0000 (13:06 -0700)]
Add "has_sha1_pack()" function to query whether the object is available in a pack

We'll want this for incremental packing.

15 years agoMake git-fsck-cache check HEAD integrity
Linus Torvalds [Sun, 3 Jul 2005 17:40:38 +0000 (10:40 -0700)]
Make git-fsck-cache check HEAD integrity

In particular, check that it's a symlink, and points to refs/heads/.  We
depend on that these days not only for "git checkout", but also because
fsck and others only check for references in the .git/refs/
subdirectory, not things like HEAD itself.

15 years agoFix sparse warnings.
Linus Torvalds [Sun, 3 Jul 2005 17:10:45 +0000 (10:10 -0700)]
Fix sparse warnings.

Mainly making a lot of local functions and variables be marked "static",
but there was a "zero as NULL" warning in there too.

15 years agocvsimport: Missing tests for verbosity flag.
Matthias Urlichs [Sun, 3 Jul 2005 17:03:30 +0000 (19:03 +0200)]
cvsimport: Missing tests for verbosity flag.

15 years agoFix up header file dependencies and add sparse checking rules
Linus Torvalds [Sun, 3 Jul 2005 17:02:35 +0000 (10:02 -0700)]
Fix up header file dependencies and add sparse checking rules

We're pretty sparse-clean already, thanks to earlier efforts, but some
things inevitably creep in.

15 years agoFix up "for_each_ref()" to be more usable, and use it in git-fsck-cache
Linus Torvalds [Sun, 3 Jul 2005 17:01:38 +0000 (10:01 -0700)]
Fix up "for_each_ref()" to be more usable, and use it in git-fsck-cache

It needed to take the GIT_DIR information into account, something that
the original receive-pack usage just never cared about.

15 years agoFix gcc warning in send-pack.c
Linus Torvalds [Sun, 3 Jul 2005 17:00:01 +0000 (10:00 -0700)]
Fix gcc warning in send-pack.c

send_pack() was declared to return "int" (although nobody cared), but
didn't actually return anything.

15 years agoAvoid gcc warnings in sha1_file.c
Linus Torvalds [Sun, 3 Jul 2005 16:58:44 +0000 (09:58 -0700)]
Avoid gcc warnings in sha1_file.c

A couple of bogus "might be used undefined" warnings are avoided
by moving the initializations unnecessarily early.

15 years agoSupport :ext: access method.
Sven Verdoolaege [Sun, 3 Jul 2005 11:02:06 +0000 (13:02 +0200)]
Support :ext: access method.

15 years agoHonour CVS_SERVER.
Sven Verdoolaege [Sun, 3 Jul 2005 10:26:51 +0000 (12:26 +0200)]
Honour CVS_SERVER.

15 years agogit-cvsimport-script: clean up documentation
Sven Verdoolaege [Sun, 3 Jul 2005 09:38:06 +0000 (11:38 +0200)]
git-cvsimport-script: clean up documentation

Remove documentation of irrelevant "type" option.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
15 years agoMake specification of CVS module to convert optional.
Sven Verdoolaege [Sun, 3 Jul 2005 09:34:59 +0000 (11:34 +0200)]
Make specification of CVS module to convert optional.

If we're inside a checked out CVS repository, there is
no need to explicitly specify the module as it is
available in CVS/Repository.
Also read CVS/Root if it's available and -d is not specified.
Finally, explicitly pass root to cvsps as CVS/Root takes
precedence over CVSROOT.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
15 years agoFixed a typo in Documentation/git-cvsimport-script.txt.
Sven Verdoolaege [Sun, 3 Jul 2005 07:43:00 +0000 (09:43 +0200)]
Fixed a typo in Documentation/git-cvsimport-script.txt.

15 years agoGeneralize the "show each ref" code in receice-pack
Linus Torvalds [Sun, 3 Jul 2005 03:23:36 +0000 (20:23 -0700)]
Generalize the "show each ref" code in receice-pack

This turns it into a generic "do xyz for each ref" library function.

15 years ago[PATCH] Show more details of packfile with verify-pack -v.
Junio C Hamano [Fri, 1 Jul 2005 00:17:20 +0000 (17:17 -0700)]
[PATCH] Show more details of packfile with verify-pack -v.

This implements show_pack_info() function used in verify-pack
command when -v flag is used to obtain something like
unpack-objects used to give when it was first written.

It shows the following for each non-deltified object found in
the pack:

    SHA1 type size offset

For deltified objects, it shows this instead:

    SHA1 type size offset depth base_sha1

In order to get the output in the order that appear in the pack
file for debugging purposes, you can do this:

 $ git-verify-pack -v packfile | sort -n -k 4,4

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] verify-pack updates.
Junio C Hamano [Fri, 1 Jul 2005 00:15:39 +0000 (17:15 -0700)]
[PATCH] verify-pack updates.

Nico pointed out that having verify_pack.c and verify-pack.c was
confusing.  Rename verify_pack.c to pack-check.c as suggested,
and enhances the verification done quite a bit.

 - Built-in sha1_file unpacking knows that a base object of a
   deltified object _must_ be in the same pack, and takes
   advantage of that fact.

 - Earlier verify-pack command only checked the SHA1 sum for the
   entire pack file and did not look into its contents.  It now
   checks everything idx file claims to have unpacks correctly.

 - It now has a hook to give more detailed information for
   objects contained in the pack under -v flag.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years ago[PATCH] Avoid unnecessarily inflating and interpreting delta
Junio C Hamano [Fri, 1 Jul 2005 00:13:07 +0000 (17:13 -0700)]
[PATCH] Avoid unnecessarily inflating and interpreting delta

This teaches packed_delta_info() that it only needs to look at
the type of the base object to figure out both type and size of
a deltified object.  This saves quite a many calls to inflate()
when dealing with a deep delta chain.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 years agocvsimport: add documentation.
Matthias Urlichs [Thu, 30 Jun 2005 20:54:33 +0000 (22:54 +0200)]
cvsimport: add documentation.

15 years agocvsimport: Added option '-p': pass options to cvsps
Matthias Urlichs [Thu, 30 Jun 2005 20:54:01 +0000 (22:54 +0200)]
cvsimport: Added option '-p': pass options to cvsps
           Added option '-x' to cvsps call

15 years agocvsimport: Exit if an existing repository doesn't have the right branch.
Matthias Urlichs [Thu, 30 Jun 2005 20:10:32 +0000 (22:10 +0200)]
cvsimport: Exit if an existing repository doesn't have the right branch.

15 years agocvs import: Strip whitespace at the end of the log entry
Matthias Urlichs [Thu, 30 Jun 2005 20:09:42 +0000 (22:09 +0200)]
cvs import: Strip whitespace at the end of the log entry
            for compatibility with old cvs2git.

15 years agoDo ref matching on the sender side rather than on receiver
Linus Torvalds [Thu, 30 Jun 2005 19:28:24 +0000 (12:28 -0700)]
Do ref matching on the sender side rather than on receiver

This makes the receiver always send a full list of valid refs, which
will allow us to do better packs, as well as handle creation of new
refs.  Eventually.  Right now we just moved the matching and enabled it.

So now you can do

git-send-pack host:path branch1 branch2

to only send branches "branch1" and "branch2".

15 years agoAdd support for "forcing" a ref on the remote side
Linus Torvalds [Thu, 30 Jun 2005 18:04:59 +0000 (11:04 -0700)]
Add support for "forcing" a ref on the remote side

A "old ref" of all zeroes is considered a "don't care" ref, and allows
us to say "write the new ref regardless of what the old ref contained
(or even if it existed at all)".

This allows (if git-send-pack were to do it) creating new refs, and
fixing up old ones.

15 years agogit-send-pack: actually send the object pack
Linus Torvalds [Thu, 30 Jun 2005 17:17:39 +0000 (10:17 -0700)]
git-send-pack: actually send the object pack

This concludes this lesson.  I've actually successfully sent an update
using the git-send-pack command.

Probably tons of work still to do, and nasty debugging, but it's now
actually potentially useful.

15 years agogit-receive-pack: implement ref switch command handling
Linus Torvalds [Thu, 30 Jun 2005 17:15:22 +0000 (10:15 -0700)]
git-receive-pack: implement ref switch command handling

After unpacking the object pack successfully, we go through the list of
refs, and verify that they still contain their expected values.  Then we
replace them with the new ones.

15 years agocvsimport: perform string comparison on "HEAD"
Sven Verdoolaege [Thu, 30 Jun 2005 15:23:22 +0000 (17:23 +0200)]
cvsimport: perform string comparison on "HEAD"

15 years agogit-cvsimport-script: Removed redundant @old and @new clear.
Matthias Urlichs [Thu, 30 Jun 2005 10:28:31 +0000 (12:28 +0200)]
git-cvsimport-script: Removed redundant @old and @new clear.