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

693 Commits

Author SHA1 Message Date
Jonas Fonseca
e0f0e891c1 [PATCH] git-diff-cache: handle pathspec beginning with a dash
Parse everything after '--' as tree name or pathspec.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08 13:03:25 -07:00
Linus Torvalds
2a68a8659f Leave merge failures in the filesystem
This changes how we handle merges: if a automated merge
fails, we will leave the index as a clean entry pointing
to the original branch, and leave the actual file _dirty_
the way the "merge" program left it.

You can then just do "git-diff-files -p" to see what the
merge conflicts did, fix them up, and commit the end result.

NOTE NOTE NOTE! Do _not_ use "git commit" to commit such
a merge. It won't set the parents right. I'll need to fix
that. In the meantime, you'd need to merge using

	git-commit-tree $(git-write) -p HEAD -p MERGE_HEAD

or something like that by hand.
2005-06-08 11:40:59 -07:00
Linus Torvalds
f9e7750621 Fix SIGSEGV on unmerged files in git-diff-files -p
NULL is not considered a VALID pathspec.
2005-06-08 11:31:53 -07:00
Junio C Hamano
7d95ee9351 [PATCH] Tests: read-tree -m test updates.
This updates t1000 (basic 3-way merge test) to check the merge
results for both successful cases (earlier one checked the
result for only one of them).  Also fixes typos in t1002 that
broke '&&' chain, potentially missing a test failure before the
chain got broken.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08 10:19:53 -07:00
Linus Torvalds
5b1ea09de1 Make default merge messages denser.
In particular, make them readable on one line since that's what all the
tools like git-shortlog and gitk end up showing.
2005-06-08 10:09:41 -07:00
Jon Seymour
4e7346735a [PATCH] three --merge-order bug fixes
This patch fixes three bugs in --merge-order support
    * mark_ancestors_uninteresting was unnecessarily exponential which
      caused a problem when a commit with no parents was merged near the
      head of something like the linux kernel
    * removed a spurious statement from find_base which wasn't
      apparently causing problems now, but wasn't correct either.
    * removed an unnecessarily strict check from find_base_for_list
      that causes a problem if git-rev-list commit ^parent-of-commit
      is specified.
    * added some unit tests which were accidentally omitted from
      original merge-order patch

The fix to mark_ancestors_uninteresting isn't an optimal fix - a full
graph scan will still be performed in this case even though it is
not strictly required. However, a full graph scan is linear
and still no worse than git-rev-list HEAD which runs in less than 2
seconds on a warm cache.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-08 09:37:10 -07:00
Sven Verdoolaege
32798c707e [PATCH] git-cvs2git: create tags
cvsps seems to put a space after the tag name, so we remove it first.
2005-06-08 08:17:29 -07:00
Linus Torvalds
af3f929f95 git-apply: creatign empty files is nonfatal
(but it will result in a warning)
2005-06-08 08:11:47 -07:00
Linus Torvalds
fcbfd5a6b2 Talk about "git cvsimport" in the cvs migration docs
We should add a lot more information about how you copy repositories,
pulling and pushing, merging etc.  Oh, well.  I'm not exactly known for
my documentation skills. Maybe somebody else will help me..
2005-06-07 15:52:06 -07:00
Junio C Hamano
28f8fafff8 [PATCH] Documentation: describe diff tweaking (fix).
I cannot count ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-06-07 15:23:30 -07:00
Junio C Hamano
b0bf8f24e9 [PATCH] Start cvs-migration documentation
This does a section to talk about "cvs annotate".

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-07 15:23:30 -07:00
Linus Torvalds
a57f0b58d7 git-read-tree: -u without -m is meaningless. Don't allow it.
Also, documetn the "-u" in the usage string.
2005-06-07 15:20:39 -07:00
Linus Torvalds
b5b425074e git-read-tree: make one-way merge also honor the "update" flag
It didn't set CE_UPDATE before, so "-u" was a no-op.
2005-06-07 15:17:33 -07:00
Junio C Hamano
ccef66b55a [PATCH] read-tree: update documentation for 3-way merge.
This explains the new merge world order that formally assigns
specific meaning to each of three tree-ish command line
arguments.  It also mentions -u option

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-07 15:13:24 -07:00
Linus Torvalds
d4f8b390a4 Add CVS import scripts and programs
This gets the "cvs2git" program from the old git-tools
archive, and adds a nice script around it that makes it
much easier to use.

With this, you should be able to import a CVS archive
using just a simple

	git cvsimport <cvsroot> <module>

and you're done. At least it worked for my one single test.

NOTE!! This may need tweaking. It currently expects (and
verifies) that cvsps version 2.1 is installed, but you
can't actually set any of the cvsps parameters, like the
time fuzz.
2005-06-07 15:11:28 -07:00
Linus Torvalds
001d4a27db git-ssh-push/pull: usability improvements
Allow traditional ssh path specifiers (host:path), and let the user
override the command name on the other end.

With this, I can push to kernel.org with this script

	export GIT_SSH_PULL=/home/torvalds/bin/git-ssh-pull
	git-ssh-push -a -v -w heads/master heads/master master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

which while not pretty is at least workable.
2005-06-07 14:23:46 -07:00
Timo Hirvonen
972d1bb067 [PATCH] Use ntohs instead of htons to convert ce_flags to host byte order
Use ntohs instead of htons to convert ce_flags to host byte order

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-07 13:44:11 -07:00
Junio C Hamano
c859600954 [PATCH] read-tree: save more user hassles during fast-forward.
This implements the "never lose the current cache information or
the work tree state, but favor a successful merge over merge
failure" principle in the fast-forward two-tree merge operation.

It comes with a set of tests to cover all the cases described in
the case matrix found in the new documentation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-07 11:41:51 -07:00
Daniel Barkalow
63aff4fed9 [PATCH] Document git-ssh-pull and git-ssh-push
This fixes the documentation for git-ssh-push, as called by users (if you
run git-ssh-pull or git-ssh-push on one machine, the other runs on the
other machine, and they transfer data in the specified direction).

This also adds documentation for the -w option and for using filenames for
the commit-id (which does what you'd want: uses the source side's value,
not the value already on the target, even if you're running it on the
target).

It also credits me with the programs and the documentation for
git-ssh-push.

Someone who knows asciidoc should make sure I didn't mess up the
formatting. I'm only sure of the ascii part.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 19:49:45 -07:00
Linus Torvalds
e5b905c448 git-resolve-script: stop when the automated merge fails
No point in doing a tree write that will just throw
confusing messages on the screen.
2005-06-06 19:37:25 -07:00
Linus Torvalds
ed37b5b2b9 Make fetch/pull scripts terminate cleanly on errors
Don't continue with a merge if the fetch failed.
2005-06-06 17:40:22 -07:00
Linus Torvalds
3f4eff7530 git-resolve-script: don't wait for three seconds any more
We used to overwrite peoples dirty state.  We don't any more.  So don't
print the scary message and don't delay, just do the update already.
2005-06-06 17:39:14 -07:00
Daniel Barkalow
c7c4bbe631 [PATCH] -w support for git-ssh-pull/push
This adds support for -w to git-ssh-pull and git-ssh-push to make
receiving side write the commit that was transferred to a reference file.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 17:12:47 -07:00
Daniel Barkalow
cd541a68b3 [PATCH] Generic support for pulling refs
This adds support to pull.c for requesting a reference and writing it to a
file. All of the git-*-pull programs get stubs for now.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 17:11:11 -07:00
Daniel Barkalow
9182f89ab2 [PATCH] rsh.c environment variable
rsh.c used to set the environment variable for the object database when
invoking the remote command. Now that there is a GIT_DIR variable, use
that instead.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 17:09:45 -07:00
Daniel Barkalow
95fc75129a [PATCH] Operations on refs
This patch adds code to read a hash out of a specified file under
{GIT_DIR}/refs/, and to write such files atomically and optionally with an
compare and lock.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 17:09:45 -07:00
Linus Torvalds
451322512f git-read-tree: some "final" cleanups
Looking good, but hey, it's not like I even have a real testcase for any
of this.  But unlike the mess that this was yerstday, today read-cache
is pretty readable and understandable.  Which is always a good sign.
2005-06-06 14:33:11 -07:00
Linus Torvalds
d723c69063 git-read-tree: simplify merge loops enormously
Stop trying to haev this stateful thing that keeps track of what it has
seen, and use a much simpler "gather all the different stages with the
same name together and just merge them in one go" approach.

Makes it a lot more understandable, and allows the different merge
algorithms to share the basic merge loop.
2005-06-06 14:01:58 -07:00
Junio C Hamano
96cd5429a4 [PATCH] index locking like everybody else
This patch teaches read-tree how to use the index file locking
helpers the same way "checkout-cache -u" and "update-cache" do.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 13:13:27 -07:00
Linus Torvalds
90334cf780 Add "__noreturn__" attribute to die() and usage()
Only with gcc. It fixes some warnings for certain versions
of gcc, but not apparently all.
2005-06-06 10:12:31 -07:00
Linus Torvalds
64de356299 git-rev-list: make sure to link with ssl libraries
Needed for the bignum stuff used by merge-order.
2005-06-06 09:09:43 -07:00
jon@blackcubes.dyndns.org
a3437b8c26 [PATCH] Modify git-rev-list to linearise the commit history in merge order.
This patch linearises the GIT commit history graph into merge order
which is defined by invariants specified in Documentation/git-rev-list.txt.

The linearisation produced by this patch is superior in an objective sense
to that produced by the existing git-rev-list implementation in that
the linearisation produced is guaranteed to have the minimum number of
discontinuities, where a discontinuity is defined as an adjacent pair of
commits in the output list which are not related in a direct child-parent
relationship.

With this patch a graph like this:

	a4 ---
	| \   \
	|  b4 |
	|/ |  |
	a3 |  |
	|  |  |
	a2 |  |
	|  |  c3
	|  |  |
	|  |  c2
	|  b3 |
	|  | /|
	|  b2 |
	|  |  c1
	|  | /
	|  b1
	a1 |
	|  |
	a0 |
	| /
	root

Sorts like this:

	= a4
	| c3
	| c2
	| c1
	^ b4
	| b3
	| b2
	| b1
	^ a3
	| a2
	| a1
	| a0
	= root

Instead of this:

	= a4
	| c3
	^ b4
	| a3
	^ c2
	^ b3
	^ a2
	^ b2
	^ c1
	^ a1
	^ b1
	^ a0
	= root

A test script, t/t6000-rev-list.sh, includes a test which demonstrates
that the linearisation produced by --merge-order has less discontinuities
than the linearisation produced by git-rev-list without the --merge-order
flag specified. To see this, do the following:

	cd t
	./t6000-rev-list.sh
	cd trash
	cat actual-default-order
	cat actual-merge-order

The existing behaviour of git-rev-list is preserved, by default. To obtain
the modified behaviour, specify --merge-order or --merge-order --show-breaks
on the command line.

This version of the patch has been tested on the git repository and also on the linux-2.6
repository and has reasonable performance on both - ~50-100% slower than the original algorithm.

This version of the patch has incorporated a functional equivalent of the Linus' output limiting
algorithm into the merge-order algorithm itself. This operates per the notes associated
with Linus' commit 337cb3fb8d.

This version has incorporated Linus' feedback regarding proposed changes to rev-list.c.
(see: [PATCH] Factor out filtering in rev-list.c)

This version has improved the way sort_first_epoch marks commits as uninteresting.

For more details about this change, refer to Documentation/git-rev-list.txt
and http://blackcubes.dyndns.org/epoch/.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-06 09:07:26 -07:00
Linus Torvalds
d925ffbd06 Fix off-by-one in new three-way-merge updates
That's the final one ("Yeah, sure, we believe you").

Anyway, at least the tests pass, which is not saying a lot, since they
don't end up testing all the new the things that the new merge world
order tries to do. But hopefully we're now at least not any worse off
than we were before the rewrite.
2005-06-05 23:38:18 -07:00
Junio C Hamano
c3f13d59f7 [PATCH] 3-way merge tests for new "git-read-tree -m"?
The updated git-tread-tree -m is more strict in that it wants to
have the original cache up to date.  The initial part of t1000
(merge tests from hell) fails due to it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 23:33:38 -07:00
Linus Torvalds
a76d74fb71 Three-way merge: fix silly bug that made trivial merges not work
Making the main loop look more like the one- and two-way cases
introduced a bug where "src" had been updated early, but later
users hadn't been adjusted to match.
2005-06-05 23:32:53 -07:00
Linus Torvalds
6ee67f2610 Fix entry.c dependency and compile problem
Bad Linus.
2005-06-05 23:15:40 -07:00
Linus Torvalds
e6ee623b7b git-read-tree: fix up two-way merge
This is starting to look better.
2005-06-05 22:59:59 -07:00
Linus Torvalds
220a0b527b More work on merging with git-read-tree..
Add a "-u" flag to update the tree as a result of a merge.

Right now this code is way too anal about things, and fails merges it
shouldn't, but let me fix up the different cases and this will allow for
much smoother merging even in the presense of dirty data in the working
tree.
2005-06-05 22:07:31 -07:00
Linus Torvalds
12dccc1654 Make fiel checkout function available to the git library
The merge stuff will want it soon, and we don't want to
duplicate all the work..
2005-06-05 21:59:54 -07:00
Linus Torvalds
76f38347b4 git-read-tree: fix up three-way merge tests
When we collapse three entries, we need to check all of the
collapsed entries against the old pre-merge state.
2005-06-05 20:28:33 -07:00
Linus Torvalds
02ede67ad4 git-read-tree: be a lot more careful about merging dirty trees
We don't want to overwrite state that we haven't committed yet
when merging, so it's better to make git-read-tree fail than
end up with a merge tree that ends up not having the dirty changes.

Update git-resolve-script to fail cleanly when git-read-tree fails.
2005-06-05 20:02:31 -07:00
Petr Baudis
9b63f50148 [PATCH] Make git-update-cache --force-remove regular
Make the --force-remove flag behave same as --add, --remove and
--replace. This means I can do

	git-update-cache --force-remove -- file1.c file2.c

which is probably saner and also makes it easier to use in cg-rm.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 16:57:23 -07:00
Junio C Hamano
418aaf847a [PATCH] rename git-rpush and git-rpull to git-ssh-push and git-ssh-pull
In preparation for 1.0 release, this makes the command names
consistent with others in git-*-pull family.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 16:12:27 -07:00
Linus Torvalds
dc93841715 diff 'rename' format change.
Clearly even Junio felt git "rename" header lines should say "from/to"
instead of "old/new", since he wrote the documentation that way.

This way it also matches "copy".

git-apply will accept both versions, at least for a while.
2005-06-05 15:31:52 -07:00
Linus Torvalds
f7b797073c git-apply: consider it an error to apply no changes
A "--stat" or a "--check" will just be quiet, but if
you try to apply something with no changes, that's an
error.
2005-06-05 15:25:28 -07:00
Junio C Hamano
1a93a7662d [PATCH] Documentation: describe git extended diff headers.
The documentation failed to describe "diff --git" extended diff
headers, so add some.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 15:23:57 -07:00
Junio C Hamano
4a1332d04b [PATCH] Documentation: describe diff tweaking.
This adds documentation for the diffcore mechanism and explains
how numeric parameters to -B/-C/-M options affect the output,
which was left "black magic" so far.

The documentation is not connected to any of the other asciidoc
nodes yet.  Awaiting for suggestions, fixes and help from other
people.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 15:23:57 -07:00
Linus Torvalds
33f4d087a9 git-apply: fix rename header parsing
It's not "rename from" and "rename to", it's "rename old" and "rename new".

Which is illogical and doesn't match the "copy from/to" case, but that's
life. Maybe Junio will fix it up one of these days.
2005-06-05 14:26:50 -07:00
Junio C Hamano
a48e1d67e1 [PATCH] pull: gracefully recover from delta retrieval failure.
This addresses a concern raised by Jason McMullan in the mailing
list discussion.  After retrieving and storing a potentially
deltified object, pull logic tries to check and fulfil its delta
dependency.  When the pull procedure is killed at this point,
however, there was no easy way to recover by re-running pull,
since next run would have found that we already have that
deltified object and happily reported success, without really
checking its delta dependency is satisfied.

This patch introduces --recover option to git-*-pull family
which causes them to re-validate dependency of deltified objects
we are fetching.  A new test t5100-delta-pull.sh covers such a
failure mode.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 14:18:00 -07:00
Junio C Hamano
f78c79c5d4 [PATCH] diffcore-break.c: various fixes.
This fixes three bugs in the -B heuristics.

 - Although it was advertised that the initial break criteria
   used was the same as what diffcore-rename uses, it was using
   something different.  Instead of using smaller of src and dst
   size to compare with "edit" size, (insertion and deletion),
   it was using larger of src and dst, unlike the rename/copy
   detection logic.  This caused the parameter to -B to mean
   something different from the one to -M and -C.  To compensate
   for this change, the default break score is also changed to
   match that of the default for rename/copy.

 - The code would have crashed with division by zero when trying
   to break an originally empty file.

 - Contrary to what the comment said, the algorithm was breaking
   small files, only to later merge them together.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-05 14:14:58 -07:00