1
0
mirror of https://github.com/git/git.git synced 2024-10-07 09:11:20 +02:00
Commit Graph

1302 Commits

Author SHA1 Message Date
Junio C Hamano
b2cb94254b [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>
2005-07-06 10:39:58 -07:00
Jon Seymour
ff9206e72c [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>
2005-07-06 10:29:30 -07:00
Jon Seymour
4d3a63ba3a [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>
2005-07-06 10:29:30 -07:00
Jon Seymour
d2775a817a [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>
2005-07-06 10:28:02 -07:00
Linus Torvalds
d2d02a4906 Add "--topo-order" flag to use new topological sort 2005-07-06 10:25:04 -07:00
Jon Seymour
ab580acea4 [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>
2005-07-06 10:19:04 -07:00
Linus Torvalds
9e9824ba0e 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.
2005-07-06 10:09:58 -07:00
Linus Torvalds
f79b65aa65 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.
2005-07-06 10:08:08 -07:00
Linus Torvalds
bce6286670 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.
2005-07-06 09:56:16 -07:00
Linus Torvalds
7e21c29b56 Clean up commit insertion in git-rev-list
Jon wants the commits in a different order for merge-order.
2005-07-06 09:38:06 -07:00
Linus Torvalds
f755494cec 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.
2005-07-06 09:31:17 -07:00
Jon Seymour
f6069c5995 [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>
2005-07-06 09:26:13 -07:00
Jon Seymour
8904591a9b [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>
2005-07-06 09:26:13 -07:00
Jon Seymour
ce11895d5c [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>
2005-07-06 09:26:13 -07:00
Sven Verdoolaege
c619ad510b [PATCH] Fix fd leak in git-cvsimport-script
Remember to close temporary file

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-06 08:47:08 -07:00
Junio C Hamano
5b35bcd53a [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>
2005-07-06 08:47:08 -07:00
Linus Torvalds
b43d44779b Merge master.kernel.org:/pub/scm/gitk/gitk 2005-07-05 19:00:26 -07:00
Linus Torvalds
f17a1b1bec 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.
2005-07-05 18:10:59 -07:00
Linus Torvalds
319aae2756 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.
2005-07-05 17:19:20 -07:00
Linus Torvalds
0271611e39 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.
2005-07-05 17:08:02 -07:00
Linus Torvalds
291ec0f2d2 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.
2005-07-05 17:06:09 -07:00
Linus Torvalds
72347a233e Make "git clone" use the new git-clone-pack 2005-07-05 15:47:34 -07:00
Linus Torvalds
1fcc8ea55d Add "git-clone-pack" program to help with "git clone" 2005-07-05 15:45:37 -07:00
Linus Torvalds
2f34ba32dd 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.
2005-07-05 15:45:00 -07:00
Linus Torvalds
41cb7488b9 Move "get_ack()" to common git_connect functions
git-clone-pack will want it too. Soon.
2005-07-05 15:44:09 -07:00
Linus Torvalds
4f7770c87c Remove multi-head support from fetch-pack
It was a misguided attempt to mix fetching and cloning. I'll make
a separate clone thing.
2005-07-05 14:39:30 -07:00
Linus Torvalds
12ba7eaf1d 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.
2005-07-05 12:12:50 -07:00
Linus Torvalds
bbca20acce Merge head 'cvs2git' of http://netz.smurf.noris.de/git/git 2005-07-05 12:03:14 -07:00
Linus Torvalds
f03f2ba0a5 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.
2005-07-05 12:02:10 -07:00
Linus Torvalds
0a623e7ce8 git-fetch-script: use git-fetch-pack for local and ssh fetches.
Also, clean it up a lot.
2005-07-05 11:38:37 -07:00
Linus Torvalds
723c31fea2 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.
2005-07-05 11:31:32 -07:00
Matthias Urlichs
f4b3a4c30b Merge with Linus' current tree 2005-07-05 15:32:29 +02:00
Matthias Urlichs
f13bbe7f56 Merge with http://www.liacs.nl/~sverdool/git.git#cvs2git 2005-07-05 14:23:36 +02:00
Matthias Urlichs
a9174a14fc cvsimport: getopt accepted a -q option (undocumented and unused).
Removed.
2005-07-05 14:22:53 +02:00
Sven Verdoolaege
210569f9ae 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.
2005-07-05 13:19:59 +02:00
Linus Torvalds
7a662e896b 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.
2005-07-04 16:49:37 -07:00
Linus Torvalds
7620d39fcb 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.
2005-07-04 16:36:48 -07:00
Linus Torvalds
75bfc6c232 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.
2005-07-04 16:35:13 -07:00
Linus Torvalds
fb9040cc83 Make git-fetch-pack and git-upload-pack negotiate needs/haves fully
Now the only piece missing is actually generating the pack-file.
2005-07-04 15:29:17 -07:00
Linus Torvalds
6cada6a98d Clean up output of "for_each_ref()" when GIT_DIR is "."
Remove the "./" at the head, it just looks much nicer.
2005-07-04 15:28:19 -07:00
Sven Verdoolaege
fc6e714c83 git-cvsimport-script: remove unused variable 2005-07-04 23:18:35 +02:00
Linus Torvalds
def88e9afb 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.
2005-07-04 13:26:53 -07:00
Linus Torvalds
013e7c7ff4 Move ref path matching to connect.c library
It's a generic thing for matching refs from the other side.
2005-07-04 13:24:30 -07:00
Linus Torvalds
f71925983d Factor out the ssh connection stuff from send-pack.c
I want to use it for git-fetch-pack too.
2005-07-04 11:57:58 -07:00
Sven Verdoolaege
1750113206 git-cvsimport-script: more error handling 2005-07-04 17:36:25 +02:00
Jon Seymour
a61eea6abd [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>
2005-07-04 08:22:32 -07:00
Sven Verdoolaege
28537171e7 git-cvsimport-script: provide direct support for cvsps -z option 2005-07-04 17:10:06 +02:00
Sven Verdoolaege
6e7e37b0bf 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.
2005-07-04 15:35:30 +02:00
Sven Verdoolaege
46e63efc07 git-cvsimport-script: fix branch switching
Previous patch broke branch switching.
2005-07-04 15:28:36 +02:00
Sven Verdoolaege
79ee456cf2 git-cvsimport-script: use private index. 2005-07-04 13:36:59 +02:00