git.git
18 years ago[PATCH] ssh-push: Don't add '/' to pathname
Sven Verdoolaege [Tue, 14 Jun 2005 10:37:38 +0000 (12:37 +0200)]
[PATCH] ssh-push: Don't add '/' to pathname

Paths in the host:path notation are usually interpreted
relative to the login directory rather than relative to
the root directory.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Unset TZ in t5000
Mark Allen [Tue, 14 Jun 2005 17:09:39 +0000 (10:09 -0700)]
[PATCH] Unset TZ in t5000

Unset TZ to force GMT in test #4 and add a set of parens around
the length function in the awk script.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agoMake 'git' script be a bit more helpful on unrecognized commands
Linus Torvalds [Tue, 14 Jun 2005 18:01:49 +0000 (11:01 -0700)]
Make 'git' script be a bit more helpful on unrecognized commands

18 years agoMake "git commit" handle initial commits too
Linus Torvalds [Tue, 14 Jun 2005 17:20:14 +0000 (10:20 -0700)]
Make "git commit" handle initial commits too

No need to confuse ex-CVS users with a complex initial commit sequence.

18 years agogit-apply: normalize file mode when comparing with expected value
Linus Torvalds [Tue, 14 Jun 2005 03:41:38 +0000 (20:41 -0700)]
git-apply: normalize file mode when comparing with expected value

Sine git only saves the 'x' bit, we shouldn't compare the stat contents
directly.

18 years agoAdd "git diff" script
Linus Torvalds [Mon, 13 Jun 2005 22:09:34 +0000 (15:09 -0700)]
Add "git diff" script

It's a simple helper that depending on the arguments will either
use git-diff-files, git-diff-cache or git-diff-tree.

18 years agoTeach git-rev-parse about revision-specifying arguments
Linus Torvalds [Mon, 13 Jun 2005 18:14:20 +0000 (11:14 -0700)]
Teach git-rev-parse about revision-specifying arguments

Things like "--max-count=xxx" are "rev-only".

18 years agogit-whatchanged: use the git-rev-parse helper
Linus Torvalds [Mon, 13 Jun 2005 17:22:39 +0000 (10:22 -0700)]
git-whatchanged: use the git-rev-parse helper

So now you can say

git-whatchanged -p v2.6.12-rc5.. drivers/usb

and it will show you what changed (as a patch) in drivers/usb since the
v2.6.12-rc5 release.

18 years agogit-rev-parse: split "revs" and "non-revs"
Linus Torvalds [Mon, 13 Jun 2005 17:21:11 +0000 (10:21 -0700)]
git-rev-parse: split "revs" and "non-revs"

Sometimes we only want to output revisions, and sometimes we want to
only see the stuff that wasn't revisions.  Teach git-rev-parse to
understand the "--revs-only" and "--no-revs" flags.

18 years agoMake "git log" use the new git-rev-parse helper
Linus Torvalds [Mon, 13 Jun 2005 17:07:25 +0000 (10:07 -0700)]
Make "git log" use the new git-rev-parse helper

See the previous commit for explanations.

18 years agoAdd 'git-rev-parse' helper script
Linus Torvalds [Mon, 13 Jun 2005 17:06:50 +0000 (10:06 -0700)]
Add 'git-rev-parse' helper script

It's an incredibly cheesy helper that changes human-readable revision
arguments into the git-rev-list argument format.

You can use it to do something like this:

git-rev-list --pretty $(git-rev-parse --default HEAD "$@")

which is what git-log-script will become. Here git-rev-parse will
then allow you to use arguments like "v2.6.12-rc5.." or similar
human-readable ranges.

It's really quite stupid: "a..b" will be converted into "a" and "^b" if
"a" and "b" are valid object pointers.  And the "--default" case will be
used if nothing but flags have been seen, so that you can default to a
certain argument if there are no other ranges.

18 years agogit-apply: fix error handling for nonexistent files
Linus Torvalds [Mon, 13 Jun 2005 04:04:27 +0000 (21:04 -0700)]
git-apply: fix error handling for nonexistent files

Missing argument for error() function. We should really use the
gcc printf format checking capabilities.

18 years ago[PATCH] git cvsimport fuzz argument
Tommy M. McGuire [Fri, 10 Jun 2005 06:38:32 +0000 (01:38 -0500)]
[PATCH] git cvsimport fuzz argument

Add "-z fuzz" argument, passed to cvsps, and clean up argument
processing.  Also, use "cvsps --cvs-direct", which is is somewhat
faster.

Give the user the option of specifying the timestamp fuzz passed to
cvsps.  Looking at the other arguments to it, I can't see anything else
that would be sane to play with.  Also, use --cvs-direct, which speeds
up cvsps for remote repositories and doesn't seem to do anything bad to
local repositories.

Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] cvs-migration.txt
Tommy M. McGuire [Fri, 10 Jun 2005 06:33:44 +0000 (01:33 -0500)]
[PATCH] cvs-migration.txt

Slightly expand the cvsimport description, and make a couple of syntax
edits.

The way I figure it, telling someone why cvsimport is taking so long
will improve their overall user experience.  :-)

Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] git cvsimport sanity checking
Tommy M. McGuire [Fri, 10 Jun 2005 06:27:47 +0000 (01:27 -0500)]
[PATCH] git cvsimport sanity checking

This patch adds some sanity checking to git-cvsimport-script,
specifically forcing the use of cvsps -x (to get the latest information
from the repository, rather than whatever is in the cache) and aborting
early if cvsps does not produce any output.

I debated removing the $MODULE directory following an abort, but I
eventually decided leaving stuff behind would make debugging easier.  On
the other hand, this patch should help with the "cvsimport left me with
an empty repository" complaints.

Call cvsps with the -x flag, to get the current state of the repository,
and abort the cvs import early if cvsps does not produce any output.

Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] cvsimport: allow remote CVS repos
Tommy M. McGuire [Fri, 10 Jun 2005 06:22:06 +0000 (01:22 -0500)]
[PATCH] cvsimport: allow remote CVS repos

Remove unneeded sanity tests.  Remote repositories do, indeed, just
work.

Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] diff-stages: unuglify the too big main() function.
Junio C Hamano [Sat, 11 Jun 2005 01:44:36 +0000 (18:44 -0700)]
[PATCH] diff-stages: unuglify the too big main() function.

Split the core of the program, diff_stage, from one big "main()"
function that does it all and leave only the parameter parsing,
setup and finalize part in the main().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] read-tree: loosen too strict index requirements
Junio C Hamano [Sat, 11 Jun 2005 09:53:57 +0000 (02:53 -0700)]
[PATCH] read-tree: loosen too strict index requirements

This patch teaches read-tree 3-way merge that, when only "the
other tree" changed a path, and if the index file already has
the same change, we are not in a situation that would clobber
the index and the work tree, and lets the merge succeed; this is
case #14ALT in t1000 test.  It does not change the result of the
merge, but prevents it from failing when it does not have to.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Finish making --emu23 equivalent to pure 2-way merge.
Junio C Hamano [Sat, 11 Jun 2005 09:50:51 +0000 (02:50 -0700)]
[PATCH] Finish making --emu23 equivalent to pure 2-way merge.

This adds #3ALT rule (and #2ALT rule for symmetry) to the
read-tree 3-way merge logic that collapses paths that are added
only in one branch and not in the other internally.

This makes --emu23 to succeed in the last remaining case where
the pure 2-way merge succeeded and earlier one failed.  Running
diff between t1001 and t1005 test scripts shows that the only
difference between the two is that --emu23 can leave the states
into separate stages so that the user can use usual 3-way merge
resolution techniques to carry forward the local changes when
pure 2-way merge would have refused to run.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] read-tree: fix too strong index requirement #5ALT
Junio C Hamano [Sat, 11 Jun 2005 01:37:47 +0000 (18:37 -0700)]
[PATCH] read-tree: fix too strong index requirement #5ALT

This fixes too strong index requirement 3-way merge enforces in
one case: the same file is added in both branches.

In this case, the original code insisted that if the index file
has that path, it must match our branch and be up-to-date.
However in this particular case, it only has to match it, and
can be dirty.  We just need to make sure that we keep the
work-tree copy instead of checking out the merge result.

The resolution of such a path, however, cannot be left to
outside script, because we will not keep the original stage0
entries for unmerged paths when read-tree finishes, and at that
point, the knowledge of "if we resolve it to match the new file
added in both branches, the merge succeeds and the work tree
would not lose information, but we should _not_ update the work
tree from the resulting index file" is lost.  For this reason,
the now code needs to resolve this case (#5ALT) internally.

This affects some existing tests in the test suite, but all in
positive ways.  In t1000 (3-way test), this #5ALT case now gets
one stage0 entry, instead of an identical stage2 and stage3
entry pair, for such a path, and one test that checked for merge
failure (because the test assumed the "stricter-than-necessary"
behaviour) does not have to fail anymore.  In t1005 (emu23
test), two tests that involves a case where the work tree
already had a change introduced in the upstream (aka "merged
head"), the merge succeeds instead of failing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] read-tree --emu23.
Junio C Hamano [Sat, 11 Jun 2005 01:36:08 +0000 (18:36 -0700)]
[PATCH] read-tree --emu23.

This new flag causes two-way fast forward to internally use the
three-way merge mechanism.  This behaviour is intended to offer
a better fast forward semantics when used in a dirty work tree.

The new test t1005 is parallel to the existing t1001 "pure
2-way" tests, but some parts that are commented out would fail.
These failures are due to three-way merge enforcing too strict
index requirements for cases that could succeed.  This problem
will be addressed by later patches.

Without even changing three-way mechanism, the --emu23 two-way
fast forward already gives the user an easier-to-handle merge
result when a file that "merged head" updates has local
modifications.  This is demonstrated as "case 16" test in t1005.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Clean up read-tree two-way tests.
Junio C Hamano [Sat, 11 Jun 2005 01:34:34 +0000 (18:34 -0700)]
[PATCH] Clean up read-tree two-way tests.

This is in preparation for "2-way fast-forward emulated with
3-way mechanism" series.  It does not change what the tests for
pure 2-way do.  It only changes how it tests things, to make
reviewing of differences of the two tests easier in later steps.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Add --diff-filter= output restriction to diff-* family.
Junio C Hamano [Sun, 12 Jun 2005 03:57:13 +0000 (20:57 -0700)]
[PATCH] Add --diff-filter= output restriction to diff-* family.

This is a halfway between debugging aid and a helper to write an
ultra-smart merge scripts.  The new option takes a string that
consists of a list of "status" letters, and limits the diff
output to only those classes of changes, with two exceptions:

 - A broken pair (aka "complete rewrite"), does not match D
   (deleted) or N (created).  Use B to look for them.

 - The letter "A" in the diff-filter string does not match
   anything itself, but causes the entire diff that contains
   selected patches to be output (this behaviour is similar to
   that of --pickaxe-all for the -S option).

For example,

    $ git-rev-list HEAD |
      git-diff-tree --stdin -s -v -B -C --diff-filter=BCR

shows a list of commits that have complete rewrite, copy, or
rename.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] diff-tree: --find-copies-harder
Junio C Hamano [Sat, 11 Jun 2005 01:31:02 +0000 (18:31 -0700)]
[PATCH] diff-tree: --find-copies-harder

Normally, diff-tree does not feed unchanged filepair to diffcore
for performance reasons, so copies are detected only when the
source file of the copy happens to be modified in the same
changeset.  This adds --find-copies-harder flag to tell
diff-tree to sacrifice the performance in order to find copies
the same way as other commands in diff-* family.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Tutorial update to adjust for -B fix
Junio C Hamano [Fri, 3 Jun 2005 19:11:07 +0000 (12:11 -0700)]
[PATCH] Tutorial update to adjust for -B fix

Now -B does not say silly "complete rewrite" anymore for small
files such as the one in the tutorial example.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Fix rename/copy when dealing with temporarily broken pairs.
Junio C Hamano [Sun, 12 Jun 2005 03:55:20 +0000 (20:55 -0700)]
[PATCH] Fix rename/copy when dealing with temporarily broken pairs.

When rename/copy uses a file that was broken by diffcore-break
as the source, and the broken filepair gets merged back later,
the output was mislabeled as a rename.  In this case, the source
file ends up staying in the output, so we should label it as a
copy instead.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agogit-whatchanged: make default output format be pretty.
Linus Torvalds [Mon, 13 Jun 2005 03:35:04 +0000 (20:35 -0700)]
git-whatchanged: make default output format be pretty.

If you want the raw stuff, just do

git-whatchanged --pretty=raw

and it wil act like it used to.

18 years agogit-diff-tree: fix output with just "--pretty".
Linus Torvalds [Mon, 13 Jun 2005 03:34:09 +0000 (20:34 -0700)]
git-diff-tree: fix output with just "--pretty".

It set verbose, but didn't set the output prefix to "diff-tree".

18 years ago[PATCH] Support commit_format in diff-tree
Junio C Hamano [Mon, 13 Jun 2005 00:44:21 +0000 (17:44 -0700)]
[PATCH] Support commit_format in diff-tree

This steals --pretty command line option from rev-list and
teaches diff-tree to do the same.  With this change,

    $ git-whatchanged --pretty

would work as expected.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Re-Fix SIGSEGV on unmerged files in git-diff-files -p
Junio C Hamano [Mon, 13 Jun 2005 00:23:15 +0000 (17:23 -0700)]
[PATCH] Re-Fix SIGSEGV on unmerged files in git-diff-files -p

When an unmerged path was fed via diff_unmerged() into diffcore,
it eventually called run_diff() with "one" and "two" parameters
with NULL, but run_diff() was not written carefully enough to
notice this situation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agogit-apply: ignore empty git headers
Linus Torvalds [Sun, 12 Jun 2005 16:37:49 +0000 (09:37 -0700)]
git-apply: ignore empty git headers

A meaningful (ie non-empty) git patch always has more information in the
header than just the "diff --git" line itself: it needs to have either a
patch associated with it (which implies "---" and "+++" lines in the
header) or it needs to have rename/copy/delete/create information in it.

Just ignore git patches which have no change information. Otherwise we'll
end up with a patch that doesn't have filenames etc filled in, and we'll
be unhappy.

18 years ago[PATCH] Bugfix: read-cache.c:write_cache() misrecords number of entries.
Junio C Hamano [Fri, 10 Jun 2005 08:32:37 +0000 (01:32 -0700)]
[PATCH] Bugfix: read-cache.c:write_cache() misrecords number of entries.

When we choose to omit deleted entries, we should subtract
numbers of such entries from the total number in the header.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Oops.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agogit-read-tree: remove deleted files in the working directory
Linus Torvalds [Thu, 9 Jun 2005 22:34:04 +0000 (15:34 -0700)]
git-read-tree: remove deleted files in the working directory

Only when "-u" is used of course.

18 years ago[PATCH] Add git-diff-stages command.
Junio C Hamano [Thu, 9 Jun 2005 22:13:13 +0000 (15:13 -0700)]
[PATCH] Add git-diff-stages command.

The diff-* brothers acquired a sibling, git-diff-stages.  With
an unmerged index file, you specify two stage numbers and it
shows the differences between them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agogit-read-tree: add "--reset" flag
Linus Torvalds [Thu, 9 Jun 2005 19:51:01 +0000 (12:51 -0700)]
git-read-tree: add "--reset" flag

This is the same as "-m", but it will silently ignore any unmerged
entries, which makes it useful for efficiently forcing a new position
regardless of the state of the current index file.

IOW, to reset to a previous HEAD (in case you have had a failed
merge, for example), you'd just do

git-read-tree -u --reset HEAD

which will also update your working tree to the right state.

NOTE! The "update" will not remove files that may have been added by the
merge.  Yet.

18 years agoOne more time.. Clean up git-merge-one-file-script
Linus Torvalds [Thu, 9 Jun 2005 00:56:09 +0000 (17:56 -0700)]
One more time.. Clean up git-merge-one-file-script

This uses git-checkout-file to make sure that the full pathname is
created, instead of the script having to verify it by hand.  Also,
simplify the 3-way merge case by just writing to the right file and
setting the initial index contents early.

18 years agoFix up git-merge-one-file-script
Linus Torvalds [Thu, 9 Jun 2005 00:36:47 +0000 (17:36 -0700)]
Fix up git-merge-one-file-script

Junio points out that we may need to create the path leading
up the the file we merge.

And we need to be more careful with the "exec"s we've done
to exit on success - only do the on the last command in the
pipeline, not the first one ;)

18 years agoMerge my and Petr's git-merge-one-file-script modifications
Linus Torvalds [Wed, 8 Jun 2005 23:54:23 +0000 (16:54 -0700)]
Merge my and Petr's git-merge-one-file-script modifications

18 years ago[PATCH] git-merge-one-file-script cleanups from Cogito
Petr Baudis [Wed, 8 Jun 2005 23:38:20 +0000 (01:38 +0200)]
[PATCH] git-merge-one-file-script cleanups from Cogito

Chain the resolving sequences (e.g. git-cat-file - chmod -
git-update-cache) through &&s so we stop right away in case one of the
command fails, and report the error code to the script caller.

Also add a copyright notice, some blank lines, ;; on a separate line,
and nicer error messages.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agoMake sure we error out if we can't remove a file on automatic merges.
Linus Torvalds [Wed, 8 Jun 2005 23:35:30 +0000 (16:35 -0700)]
Make sure we error out if we can't remove a file on automatic merges.

Pointed out by Junio.

18 years ago[PATCH] Tidy up some rev-list-related stuff
Petr Baudis [Wed, 8 Jun 2005 20:59:43 +0000 (22:59 +0200)]
[PATCH] Tidy up some rev-list-related stuff

This patch tidies up the git-rev-list documentation and epoch.c, which
are in severe clash with the unwritten coding style now, and quite
unreadable.

It also fixes up compile failures with older compilers due to variable
declarations after code.

The patch mostly wraps lines before or on the 80th column, removes
plenty of superfluous empty lines and changes comments from // to /* */.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Add read-tree -m 3-way merge tests.
Junio C Hamano [Wed, 8 Jun 2005 21:55:35 +0000 (14:55 -0700)]
[PATCH] Add read-tree -m 3-way merge tests.

This adds a set of tests to make sure that requirements on
existing cache entries are checked when a read-tree -m 3-way
merge is run with an already populated index file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Fix git-merge-one-file permissions auto-merging
Petr Baudis [Wed, 8 Jun 2005 21:26:55 +0000 (23:26 +0200)]
[PATCH] Fix git-merge-one-file permissions auto-merging

In the automerge case, permissions were not restored properly after the
merge tool was invoked and overwrote the target file.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years agoRemove MERGE_HEAD after committing merge
Linus Torvalds [Wed, 8 Jun 2005 20:44:32 +0000 (13:44 -0700)]
Remove MERGE_HEAD after committing merge

18 years agoMake "git commit" work correctly in the presense of a manual merge
Linus Torvalds [Wed, 8 Jun 2005 20:33:15 +0000 (13:33 -0700)]
Make "git commit" work correctly in the presense of a manual merge

This has gotten only very light testing, but something like this is
clearly necessary and did the right thing for the one case I threw at
it.

18 years agocvs-migration: add more of a header to the "annotate" discussion
Linus Torvalds [Wed, 8 Jun 2005 20:19:31 +0000 (13:19 -0700)]
cvs-migration: add more of a header to the "annotate" discussion

18 years ago[PATCH] Miniscule correction of diff-format.txt
Christian Meder [Thu, 2 Jun 2005 09:55:03 +0000 (11:55 +0200)]
[PATCH] Miniscule correction of diff-format.txt

Add missing "space" element to the description of the diff-format.

Signed-off-by: Christian Meder <chris@absolutegiganten.org>
Acked-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] Anal retentive 'const unsigned char *sha1'
Jason McMullan [Fri, 3 Jun 2005 15:05:39 +0000 (11:05 -0400)]
[PATCH] Anal retentive 'const unsigned char *sha1'

Make 'sha1' parameters const where possible

Signed-off-by: Jason McMullan <jason.mcmullan@timesys.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] git-diff-cache: handle pathspec beginning with a dash
Jonas Fonseca [Mon, 6 Jun 2005 21:27:00 +0000 (23:27 +0200)]
[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>
18 years agoLeave merge failures in the filesystem
Linus Torvalds [Wed, 8 Jun 2005 18:40:59 +0000 (11:40 -0700)]
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.

18 years agoFix SIGSEGV on unmerged files in git-diff-files -p
Linus Torvalds [Wed, 8 Jun 2005 18:31:53 +0000 (11:31 -0700)]
Fix SIGSEGV on unmerged files in git-diff-files -p

NULL is not considered a VALID pathspec.

18 years ago[PATCH] Tests: read-tree -m test updates.
Junio C Hamano [Wed, 8 Jun 2005 09:08:54 +0000 (02:08 -0700)]
[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>
18 years agoMake default merge messages denser.
Linus Torvalds [Wed, 8 Jun 2005 17:09:41 +0000 (10:09 -0700)]
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.

18 years ago[PATCH] three --merge-order bug fixes
Jon Seymour [Wed, 8 Jun 2005 14:37:41 +0000 (00:37 +1000)]
[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>
18 years ago[PATCH] git-cvs2git: create tags
Sven Verdoolaege [Wed, 1 Jun 2005 11:27:23 +0000 (13:27 +0200)]
[PATCH] git-cvs2git: create tags

cvsps seems to put a space after the tag name, so we remove it first.

18 years agogit-apply: creatign empty files is nonfatal
Linus Torvalds [Wed, 8 Jun 2005 15:11:47 +0000 (08:11 -0700)]
git-apply: creatign empty files is nonfatal

(but it will result in a warning)

18 years agoTalk about "git cvsimport" in the cvs migration docs
Linus Torvalds [Tue, 7 Jun 2005 22:52:06 +0000 (15:52 -0700)]
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..

18 years ago[PATCH] Documentation: describe diff tweaking (fix).
Junio C Hamano [Mon, 6 Jun 2005 00:54:10 +0000 (17:54 -0700)]
[PATCH] Documentation: describe diff tweaking (fix).

I cannot count ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years ago[PATCH] Start cvs-migration documentation
Junio C Hamano [Mon, 6 Jun 2005 00:46:06 +0000 (17:46 -0700)]
[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>
18 years agogit-read-tree: -u without -m is meaningless. Don't allow it.
Linus Torvalds [Tue, 7 Jun 2005 22:20:39 +0000 (15:20 -0700)]
git-read-tree: -u without -m is meaningless. Don't allow it.

Also, documetn the "-u" in the usage string.

18 years agogit-read-tree: make one-way merge also honor the "update" flag
Linus Torvalds [Tue, 7 Jun 2005 22:17:33 +0000 (15:17 -0700)]
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.

18 years ago[PATCH] read-tree: update documentation for 3-way merge.
Junio C Hamano [Tue, 7 Jun 2005 21:35:43 +0000 (14:35 -0700)]
[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>
18 years agoAdd CVS import scripts and programs
Linus Torvalds [Tue, 7 Jun 2005 22:11:28 +0000 (15:11 -0700)]
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.

18 years agogit-ssh-push/pull: usability improvements
Linus Torvalds [Tue, 7 Jun 2005 21:23:46 +0000 (14:23 -0700)]
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.

18 years ago[PATCH] Use ntohs instead of htons to convert ce_flags to host byte order
Timo Hirvonen [Tue, 7 Jun 2005 20:35:56 +0000 (20:35 +0000)]
[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>
18 years ago[PATCH] read-tree: save more user hassles during fast-forward.
Junio C Hamano [Tue, 7 Jun 2005 18:36:30 +0000 (11:36 -0700)]
[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>
18 years ago[PATCH] Document git-ssh-pull and git-ssh-push
Daniel Barkalow [Tue, 7 Jun 2005 02:30:39 +0000 (22:30 -0400)]
[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>
18 years agogit-resolve-script: stop when the automated merge fails
Linus Torvalds [Tue, 7 Jun 2005 02:37:25 +0000 (19:37 -0700)]
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.

18 years agoMake fetch/pull scripts terminate cleanly on errors
Linus Torvalds [Tue, 7 Jun 2005 00:40:22 +0000 (17:40 -0700)]
Make fetch/pull scripts terminate cleanly on errors

Don't continue with a merge if the fetch failed.

18 years agogit-resolve-script: don't wait for three seconds any more
Linus Torvalds [Tue, 7 Jun 2005 00:39:14 +0000 (17:39 -0700)]
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.

18 years ago[PATCH] -w support for git-ssh-pull/push
Daniel Barkalow [Mon, 6 Jun 2005 20:43:27 +0000 (16:43 -0400)]
[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>
18 years ago[PATCH] Generic support for pulling refs
Daniel Barkalow [Mon, 6 Jun 2005 20:38:26 +0000 (16:38 -0400)]
[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>
18 years ago[PATCH] rsh.c environment variable
Daniel Barkalow [Mon, 6 Jun 2005 20:35:02 +0000 (16:35 -0400)]
[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>
18 years ago[PATCH] Operations on refs
Daniel Barkalow [Mon, 6 Jun 2005 20:31:29 +0000 (16:31 -0400)]
[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>
18 years agogit-read-tree: some "final" cleanups
Linus Torvalds [Mon, 6 Jun 2005 21:33:11 +0000 (14:33 -0700)]
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.

18 years agogit-read-tree: simplify merge loops enormously
Linus Torvalds [Mon, 6 Jun 2005 21:01:58 +0000 (14:01 -0700)]
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.

18 years ago[PATCH] index locking like everybody else
Junio C Hamano [Mon, 6 Jun 2005 19:20:55 +0000 (12:20 -0700)]
[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>
18 years agoAdd "__noreturn__" attribute to die() and usage()
Linus Torvalds [Mon, 6 Jun 2005 17:12:31 +0000 (10:12 -0700)]
Add "__noreturn__" attribute to die() and usage()

Only with gcc. It fixes some warnings for certain versions
of gcc, but not apparently all.

18 years agogit-rev-list: make sure to link with ssl libraries
Linus Torvalds [Mon, 6 Jun 2005 16:09:43 +0000 (09:09 -0700)]
git-rev-list: make sure to link with ssl libraries

Needed for the bignum stuff used by merge-order.

18 years ago[PATCH] Modify git-rev-list to linearise the commit history in merge order.
jon@blackcubes.dyndns.org [Mon, 6 Jun 2005 15:39:40 +0000 (15:39 +0000)]
[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 337cb3fb8da45f10fe9a0c3cf571600f55ead2ce.

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>
18 years agoFix off-by-one in new three-way-merge updates
Linus Torvalds [Mon, 6 Jun 2005 06:38:18 +0000 (23:38 -0700)]
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.

18 years ago[PATCH] 3-way merge tests for new "git-read-tree -m"?
Junio C Hamano [Mon, 6 Jun 2005 06:18:16 +0000 (23:18 -0700)]
[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>
18 years agoThree-way merge: fix silly bug that made trivial merges not work
Linus Torvalds [Mon, 6 Jun 2005 06:32:53 +0000 (23:32 -0700)]
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.

18 years agoFix entry.c dependency and compile problem
Linus Torvalds [Mon, 6 Jun 2005 06:15:40 +0000 (23:15 -0700)]
Fix entry.c dependency and compile problem

Bad Linus.

18 years agogit-read-tree: fix up two-way merge
Linus Torvalds [Mon, 6 Jun 2005 05:59:59 +0000 (22:59 -0700)]
git-read-tree: fix up two-way merge

This is starting to look better.

18 years agoMore work on merging with git-read-tree..
Linus Torvalds [Mon, 6 Jun 2005 05:07:31 +0000 (22:07 -0700)]
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.

18 years agoMake fiel checkout function available to the git library
Linus Torvalds [Mon, 6 Jun 2005 04:59:54 +0000 (21:59 -0700)]
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..

18 years agogit-read-tree: fix up three-way merge tests
Linus Torvalds [Mon, 6 Jun 2005 03:28:33 +0000 (20:28 -0700)]
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.

18 years agogit-read-tree: be a lot more careful about merging dirty trees
Linus Torvalds [Mon, 6 Jun 2005 03:02:31 +0000 (20:02 -0700)]
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.

18 years ago[PATCH] Make git-update-cache --force-remove regular
Petr Baudis [Tue, 31 May 2005 16:52:43 +0000 (18:52 +0200)]
[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>
18 years ago[PATCH] rename git-rpush and git-rpull to git-ssh-push and git-ssh-pull
Junio C Hamano [Sun, 5 Jun 2005 22:41:05 +0000 (15:41 -0700)]
[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>
18 years agodiff 'rename' format change.
Linus Torvalds [Sun, 5 Jun 2005 22:31:52 +0000 (15:31 -0700)]
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.

18 years agogit-apply: consider it an error to apply no changes
Linus Torvalds [Sun, 5 Jun 2005 22:25:28 +0000 (15:25 -0700)]
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.

18 years ago[PATCH] Documentation: describe git extended diff headers.
Junio C Hamano [Sun, 5 Jun 2005 21:39:49 +0000 (14:39 -0700)]
[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>
18 years ago[PATCH] Documentation: describe diff tweaking.
Junio C Hamano [Sun, 5 Jun 2005 21:30:58 +0000 (14:30 -0700)]
[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>
18 years agogit-apply: fix rename header parsing
Linus Torvalds [Sun, 5 Jun 2005 21:26:50 +0000 (14:26 -0700)]
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.

18 years ago[PATCH] pull: gracefully recover from delta retrieval failure.
Junio C Hamano [Sun, 5 Jun 2005 06:11:38 +0000 (23:11 -0700)]
[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>
18 years ago[PATCH] diffcore-break.c: various fixes.
Junio C Hamano [Sat, 4 Jun 2005 06:05:57 +0000 (23:05 -0700)]
[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>
18 years ago[PATCH] diff.c: -B argument passing fix.
Junio C Hamano [Sat, 4 Jun 2005 06:04:07 +0000 (23:04 -0700)]
[PATCH] diff.c: -B argument passing fix.

This fixes a bug that was preventing non-default parameter to -B
option to be passed correctly; you could not give more than 50%
break score.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
18 years ago[PATCH] diff.c: locate_size_cache() fix.
Junio C Hamano [Sat, 4 Jun 2005 06:02:23 +0000 (23:02 -0700)]
[PATCH] diff.c: locate_size_cache() fix.

This fixes two bugs.

 - declaration of auto variable "cmp" was preceeded by a
   statement, causing compilation error on real C compilers;
   noticed and patch given by Yoichi Yuasa.

 - the function's calling convention was overloading its size
   parameter to mean "largest possible value means do not add
   entry", which was a bad taste.  Brought up during a
   discussion with Peter Baudis.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>