Code

git.git
18 years agoRemove misguided branch disambiguation.
Junio C Hamano [Sat, 17 Dec 2005 07:19:14 +0000 (23:19 -0800)]
Remove misguided branch disambiguation.

This removes the misguided attempt to refuse processing a branch
name xyzzy and insist it to be given as either heads/xyzzy or
tags/xyzzy when a tag xyzzy exists.  There was no reason to do
so --- the search order was predictable and well defined, so if
the user says xyzzy we should have taken the tag xyzzy in such a
case without complaining.

This incidentally fixes another subtle bug related to this.  If
such a duplicate branch/tag name happened to be a unique valid
prefix of an existing commit object name (say, "beef"), we did
not take the tag "beef" but after complaining used the commit
object whose name started with beef.

Another problem this fixes while introducing some confusion is
that there is no longer a reason to forbid a branch name HEAD
anymore.  In other words, now "git pull . ref1:HEAD" would work
as expected, once we revert "We do not like HEAD branch" patch.
It creates "HEAD" branch under ${GIT_DIR-.git}/refs/heads (or
fast-forwards if already exists) using the tip of ref1 branch
from the current repository, and merges it into the current
branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: HTTP needs update-server-info.
Junio C Hamano [Sat, 17 Dec 2005 19:39:39 +0000 (11:39 -0800)]
Documentation: HTTP needs update-server-info.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoComment fixes.
Junio C Hamano [Sat, 17 Dec 2005 07:12:33 +0000 (23:12 -0800)]
Comment fixes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix git-am --skip
Jan Harkes [Sat, 17 Dec 2005 06:01:06 +0000 (01:01 -0500)]
Fix git-am --skip

git-am --skip does not unpack the next patch and ends up reapplying the
old patch, believing that it is the new patch in the sequence.

If the old patch applied successfully it will commit it with the
supposedly skipped log message and ends up dropping the following patch.
If the patch did not apply the user is left with the conflict he tried
to skip and has to unpack the next patch in the sequence by hand to get
git-am back on track.

By clearing the resume variable whenever skips bumps the sequence
counter we correctly unpack the next patch. I also added another
resume= in the case a patch file is missing from the sequence to
avoid the same problem when a file in the sequence was removed.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoForbid pattern maching characters in refnames.
Junio C Hamano [Fri, 16 Dec 2005 02:03:59 +0000 (18:03 -0800)]
Forbid pattern maching characters in refnames.

by marking '?', '*', and '[' as bad_ref_char().

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoExamples of resetting.
Junio C Hamano [Sat, 17 Dec 2005 02:23:33 +0000 (18:23 -0800)]
Examples of resetting.

Morten Welinder says examples of resetting is really about
recovering from botched commit/pulls.  I agree that pointers
from commands that cause a reset to be needed in the first place
would be very helpful.

Also reset examples did not mention "pull/merge" cases.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agorefs.c: off-by-one fix.
Junio C Hamano [Fri, 16 Dec 2005 02:52:51 +0000 (18:52 -0800)]
refs.c: off-by-one fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoWe do not like "HEAD" as a new branch name
Johannes Schindelin [Fri, 16 Dec 2005 01:40:25 +0000 (02:40 +0100)]
We do not like "HEAD" as a new branch name

This makes git-check-ref-format fail for "HEAD". Since the check is only
executed when creating refs, the existing symbolic ref is safe.

Otherwise these commands, most likely are pilot errors, would do
pretty funky stuff:

git checkout -b HEAD
git pull . other:HEAD

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoSort globbed refname in show-branch.
Junio C Hamano [Fri, 16 Dec 2005 01:53:44 +0000 (17:53 -0800)]
Sort globbed refname in show-branch.

"git show-branch bugs/*" shows all branches whose name match the
specified pattern, but in the order readdir() happened to
returned.  Sort them to make the output more predictable.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agosmall cleanup for diff-delta.c
Nicolas Pitre [Thu, 15 Dec 2005 16:10:32 +0000 (11:10 -0500)]
small cleanup for diff-delta.c

This patch removes unused remnants of the original xdiff source.
No functional change.  Possible tiny speed improvement.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-whatchanged: Add usage string
Fredrik Kuivinen [Thu, 15 Dec 2005 22:48:38 +0000 (23:48 +0100)]
git-whatchanged: Add usage string

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-log: Add usage string
Fredrik Kuivinen [Thu, 15 Dec 2005 22:48:26 +0000 (23:48 +0100)]
git-log: Add usage string

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-diff: Usage string clean-up
Fredrik Kuivinen [Thu, 15 Dec 2005 22:47:57 +0000 (23:47 +0100)]
git-diff: Usage string clean-up

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoapplymbox: typofix
Junio C Hamano [Thu, 15 Dec 2005 21:02:25 +0000 (13:02 -0800)]
applymbox: typofix

Sorry, I broke this command completely with the stupid typo.

Noticed by Marco Costalba.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoget_sha1_basic(): corner case ambiguity fix
Junio C Hamano [Thu, 15 Dec 2005 20:54:00 +0000 (12:54 -0800)]
get_sha1_basic(): corner case ambiguity fix

When .git/refs/heads/frotz and .git/refs/tags/frotz existed, and
the object name stored in .git/refs/heads/frotz were corrupt, we
ended up picking tags/frotz without complaining.  Worse yet, if
the corrupt .git/refs/heads/frotz was more than 40 bytes and
began with hexadecimal characters, it silently overwritten the
initial part of the returned result.

This commit adds a couple of tests to demonstrate these cases,
with a fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: tutorial
Junio C Hamano [Thu, 15 Dec 2005 07:08:08 +0000 (23:08 -0800)]
Documentation: tutorial

At the beginning of tutorial, refer the reader to everyday if
she has not done so yet.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agosvnimport: exit cleanly when we are up to date
Martin Langhoff [Thu, 15 Dec 2005 06:26:46 +0000 (19:26 +1300)]
svnimport: exit cleanly when we are up to date

Now we detect that the SVN repo does not have new commits for us and exit
cleanly, removing the lockfile. With this, svnimport supports being run
on a cronjob to maintain a SVN2GIT gateway.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoclone-pack: make it usable for partial branch cloning.
Junio C Hamano [Thu, 15 Dec 2005 05:25:22 +0000 (21:25 -0800)]
clone-pack: make it usable for partial branch cloning.

clone-pack had some logic to accept subset of remote refs from
the command line and clone from there.  However, it was never
used in practice and its problems were not found out so far.

This commit changes the command to output the object names of
refs to the standard output instead of making a clone of the
remote repository when explicit <head> parameters are given; the
output format is the same as fetch-pack.

The traditional behaviour of cloning the whole repository by
giving no explicit <head> parameters stays the same.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit rebase loses author name/email if given bad email address
Amos Waterland [Wed, 14 Dec 2005 22:48:19 +0000 (17:48 -0500)]
git rebase loses author name/email if given bad email address

If GIT_AUTHOR_EMAIL is of a certain form, `git rebase master' will blow
away the author name and email when fast-forward merging commits.  I
have not tracked it down, but here is a testcase that demonstrates the
behavior.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
Acked-by: Michal Ostrowski <mostrows@watson.ibm.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoBugfixes for git-rebase
Lukas Sandström [Wed, 14 Dec 2005 23:36:35 +0000 (00:36 +0100)]
Bugfixes for git-rebase

Fix bugs in git-rebase wrt rebasing another branch than
the current HEAD, rebasing with a dirty working dir,
and rebasing a proper decendant of the target branch.

[jc: with a bit of hand-merging]

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomailinfo and git-am: allow "John Doe <johndoe>"
Junio C Hamano [Thu, 15 Dec 2005 00:31:06 +0000 (16:31 -0800)]
mailinfo and git-am: allow "John Doe <johndoe>"

An isolated developer could have a local-only e-mail, which will
be stripped out by mailinfo because it lacks '@'.  Define a
fallback parser to accomodate that.

At the same time, reject authorless patch in git-am.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodefine MAXPATHLEN for hosts that don't support it
Martin Atukunda [Tue, 13 Dec 2005 12:21:34 +0000 (15:21 +0300)]
define MAXPATHLEN for hosts that don't support it

[jc: Martin says syllable (www.syllable.org) wants this.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDo not let errors pass by unnoticed when running `make check'.
Junio C Hamano [Wed, 14 Dec 2005 21:32:52 +0000 (13:32 -0800)]
Do not let errors pass by unnoticed when running `make check'.

[jc: originally from Amos Waterland.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'hold/am'
Junio C Hamano [Wed, 14 Dec 2005 21:04:43 +0000 (13:04 -0800)]
Merge branch 'hold/am'

18 years agorebase: do not get confused in fast-forward situation.
Junio C Hamano [Wed, 14 Dec 2005 11:11:37 +0000 (03:11 -0800)]
rebase: do not get confused in fast-forward situation.

When switching to another branch and rebasing it in a one-go, it
failed to update the variable that holds the branch head, and
did not detect fast-forward situation correctly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'fk/usage'
Junio C Hamano [Wed, 14 Dec 2005 21:01:01 +0000 (13:01 -0800)]
Merge branch 'fk/usage'

18 years agoDocumentation: topic branches
Junio C Hamano [Wed, 14 Dec 2005 20:57:49 +0000 (12:57 -0800)]
Documentation: topic branches

Recommend git over ssh direct to master.kernel.org, instead of
going over rsync to public machines, since this is meant to be a
procedure for kernel subsystem maintainers.

Also fix an obvious typo.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoapplypatch: no need to do non-portable [[ ... ]]
Junio C Hamano [Wed, 14 Dec 2005 02:19:12 +0000 (18:19 -0800)]
applypatch: no need to do non-portable [[ ... ]]

... when old, proven, case would do.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-repack: Usage string clean-up, emit usage at incorrect invocation
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:32 +0000 (23:30 +0100)]
git-repack: Usage string clean-up, emit usage at incorrect invocation

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-rebase: Usage string clean-up, emit usage string at incorrect invocation
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:32 +0000 (23:30 +0100)]
git-rebase: Usage string clean-up, emit usage string at incorrect invocation

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-prune: Usage string clean-up, use the 'usage' function
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:32 +0000 (23:30 +0100)]
git-prune: Usage string clean-up, use the 'usage' function

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-lost-found: Usage string clean-up, emit usage string at incorrect invocation
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-lost-found: Usage string clean-up, emit usage string at incorrect invocation

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-fetch: Usage string clean-up, emit usage string at unrecognized option
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-fetch: Usage string clean-up, emit usage string at unrecognized option

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-cherry: Usage string clean-up, use the 'usage' function
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-cherry: Usage string clean-up, use the 'usage' function

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-applypatch: Usage string clean-up, emit usage string at incorrect invocation
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-applypatch: Usage string clean-up, emit usage string at incorrect invocation

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-am: Usage string clean-up
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-am: Usage string clean-up

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-revert: Usage string clean-up
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-revert: Usage string clean-up

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-verify-tag: Usage string clean-up, emit usage string at incorrect invocation
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
git-verify-tag: Usage string clean-up, emit usage string at incorrect invocation

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTrivial usage string clean-up
freku045@student.liu.se [Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)]
Trivial usage string clean-up

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agot3200: branch --help does not die anymore.
Junio C Hamano [Tue, 13 Dec 2005 07:38:47 +0000 (23:38 -0800)]
t3200: branch --help does not die anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUsage message clean-up, take #2
Fredrik Kuivinen [Sun, 11 Dec 2005 09:55:49 +0000 (10:55 +0100)]
Usage message clean-up, take #2

There were some problems with the usage message clean-up patch
series. I hadn't realised that subdirectory aware scripts can't source
git-sh-setup. I propose that we change this and let the scripts which
are subdirectory aware set a variable, SUBDIRECTORY_OK, before they
source git-sh-setup.

The scripts will also set USAGE and possibly LONG_USAGE before they
source git-sh-setup. If LONG_USAGE isn't set it defaults to USAGE.

If we go this way it's easy to catch --help in git-sh-setup, print the
(long) usage message to stdout and exit cleanly. git-sh-setup can
define a 'usage' shell function which can be called by the scripts to
print the short usage string to stderr and exit non-cleanly. It will
also be easy to change $0 to basename $0 or something else, if would
like to do that sometime in the future.

What follows is a patch to convert a couple of the commands to this
style. If it's ok with everyone to do it this way I will convert the
rest of the scripts too.

[jc: thrown in to proposed updates queue for comments.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-am support for naked email messages (take 2)
H. Peter Anvin [Wed, 14 Dec 2005 06:39:23 +0000 (22:39 -0800)]
git-am support for naked email messages (take 2)

This allows git-am to accept single-message files as well as mboxes.
Unlike the previous version, this one doesn't need to be explicitly told
which one it is; rather, it looks to see if the first line is a From
line and uses it to select mbox mode or not.

I moved the logic to do all this into git-mailsplit, which got a new
user interface as result, although the old interface is still available
for backwards compatibility.

[jc: applied with two obvious fixes.]

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoEveryday: a bit more examples.
Junio C Hamano [Wed, 14 Dec 2005 08:42:45 +0000 (00:42 -0800)]
Everyday: a bit more examples.

Talk about the following as well:

 * git fetch --tags
 * Use of "git push" as a one-man distributed development vehicle.
 * Show example of remotes file for pulling and pushing.
 * Annotate git-shell setup.
 * Using Carl's update hook in a CVS-style shared repository.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agocheckout-index: fix checking out specific path.
Junio C Hamano [Wed, 14 Dec 2005 05:39:56 +0000 (21:39 -0800)]
checkout-index: fix checking out specific path.

3bd348aeea24709cd9be4b9d741f79b6014cd7e3 commit broke checking
out specific paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMake git-send-pack exit with error when some refs couldn't be pushed out
Petr Baudis [Wed, 14 Dec 2005 00:45:40 +0000 (01:45 +0100)]
Make git-send-pack exit with error when some refs couldn't be pushed out

In case some refs couldn't be pushed out due to an error (mostly the
not-a-proper-subset error), make git-send-pack exit with non-zero status
after the push is over (that is, it still tries to push out the rest
of the refs).

[jc: I adjusted a test for this change.]

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years ago[PATCH] allow merging any committish
Junio C Hamano [Wed, 14 Dec 2005 01:01:23 +0000 (17:01 -0800)]
[PATCH] allow merging any committish

Although "git-merge" is advertised as the end-user level command
(instead of being a "git-pull" backend), it was not prepared to
take tag objects that point at commits and barfed when fed one.
Sanitize the input while we validate them, for which we already
have a loop.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: tell the user a bit more about clone-pack failure.
Junio C Hamano [Tue, 13 Dec 2005 23:58:00 +0000 (15:58 -0800)]
git-clone: tell the user a bit more about clone-pack failure.

When clone-pack has trouble with the remote, it dies unfriendly
"EOF" error message.  We cannot tell the reason why it failed
from the local end; it could be that the repository did not
exist, or configured not to serve over git-daemon, or a network
failure.  At least, saying clone-pack failed makes it a bit more
meaningful.

I am not convinced yet that removing the newly created directory
is the right thing to do, so this commit leaves the new
directory behind.

Reported by Sam Ravnborg.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: not learning core git commands.
Junio C Hamano [Tue, 13 Dec 2005 10:38:24 +0000 (02:38 -0800)]
Documentation: not learning core git commands.

The initial section of tutorial was too heavy on internal
workings for the first-time readers, so rewrite the introductory
section of git(7) to start with "not learning core git commands"
section and refer them to README to grasp the basic concepts,
then Everyday to give overview with task/role oriented examples
for minimum set of commands, and finally the tutorial.

Also add to existing note in the tutorial that many too
technical descriptions can be skipped by a casual reader.

I initially started to review the tutorial, with the objective
of ripping out the detailed technical information altogether,
but I found that the level of details in the initial couple of
sections that talk about refs and the object database in a
hands-on fashion was about rigth, and left all of them there.  I
feel that reading about fsck-index and repack is too abstract
without being aware of these directories and files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: diff examples.
Junio C Hamano [Tue, 13 Dec 2005 09:54:15 +0000 (01:54 -0800)]
Documentation: diff examples.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: fix missing links to git(7)
Junio C Hamano [Tue, 13 Dec 2005 07:55:09 +0000 (23:55 -0800)]
Documentation: fix missing links to git(7)

Also move pack protocol description to technical/.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: more examples.
Junio C Hamano [Tue, 13 Dec 2005 07:24:06 +0000 (23:24 -0800)]
Documentation: more examples.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoEveryday: a bit more example.
Junio C Hamano [Tue, 13 Dec 2005 02:29:53 +0000 (18:29 -0800)]
Everyday: a bit more example.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodiffcore-break: do not break too small filepair.
Junio C Hamano [Tue, 13 Dec 2005 01:15:55 +0000 (17:15 -0800)]
diffcore-break: do not break too small filepair.

Somehow we checked only one side and not the other.  By checking
the filesize upfront, we can bypass generating delta
unnecessarily.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRevert "Add deltifier test."
Junio C Hamano [Tue, 13 Dec 2005 00:43:15 +0000 (16:43 -0800)]
Revert "Add deltifier test."

This reverts e726715a52e25d8035c89d4ea09398599610737e commit,
because reverting diff-delta emptiness change would break this test.

18 years agoRevert "diff-delta.c: allow delta with empty blob."
Junio C Hamano [Tue, 13 Dec 2005 00:42:38 +0000 (16:42 -0800)]
Revert "diff-delta.c: allow delta with empty blob."

This reverts 962537a3eb03a118cf27d9d0da365a3216ed1caa commit to
play safe.

18 years agoEveryday: some examples.
Junio C Hamano [Tue, 13 Dec 2005 00:20:21 +0000 (16:20 -0800)]
Everyday: some examples.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodiff-delta.c: allow delta with empty blob.
Junio C Hamano [Mon, 12 Dec 2005 20:01:52 +0000 (12:01 -0800)]
diff-delta.c: allow delta with empty blob.

Delta computation with an empty blob used to punt and returned NULL.
This commit allows creation with empty blob; all combination of
empty->empty, empty->something, and something->empty are allowed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd deltifier test.
Junio C Hamano [Mon, 12 Dec 2005 20:28:34 +0000 (12:28 -0800)]
Add deltifier test.

This test kicks in only if you built test-delta executable, and
makes sure that the basic delta routine is working properly even
on empty files.

This commit is to make sure we have a test to catch the
breakage.  The delitifier code is still broken, which will be
fixed with the next commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodiffcore-break.c: check diff_delta() return value.
Junio C Hamano [Mon, 12 Dec 2005 20:50:40 +0000 (12:50 -0800)]
diffcore-break.c: check diff_delta() return value.

This bug caused Darrin Thompson to notice that our deltifier was
half broken and punting on an empty blob.

Signed-off-by: Junio C Hamano <junio@twinsun.com>
18 years agot/t6022: a new test for renaming merge.
Junio C Hamano [Sun, 11 Dec 2005 20:44:46 +0000 (12:44 -0800)]
t/t6022: a new test for renaming merge.

This adds a couple of tests to cover the following renaming
merge cases:

 - one side renames and the other side does not, with and without
   content conflicts.

 - both side rename to the same path, with and without content
   conflicts.

The test setup also prepares a case in which both side rename to
different destination, but currently the code collapses these
destination paths and removes the original path, which may be
wrong.  The outcome of this case is not checked by the tests in
this round.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomerge-recursive: cleanup setIndexStages
Junio C Hamano [Sun, 11 Dec 2005 09:55:52 +0000 (01:55 -0800)]
merge-recursive: cleanup setIndexStages

Fredrik points out there is a useful wrapper runProgram() used
everywhere that we can use to feed input into subprocess.  Use
it to catch errors from the subprocess; it is a good cleanup as
well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomerge-recursive: leave unmerged entries in the index.
Junio C Hamano [Sun, 11 Dec 2005 06:05:01 +0000 (22:05 -0800)]
merge-recursive: leave unmerged entries in the index.

This does two things.

 - When one branch renamed and the other branch did not, the
   resulting half-merged file in the working tree used to swap
   branches around and showed as if renaming side was "ours".
   This was confusing and inconsistent (even though the conflict
   markers were marked with branch names, it was not a good
   enough excuse).  This changes the order of arguments to
   mergeFile in such a case to make sure we always see "our"
   change between <<< and ===, and "their" change between ===
   and >>>.

 - When both branches renamed to the same path, and when one
   branch renamed and the other branch did not, we attempt
   mergeFile.  When this automerge conflicted, we used to
   collapse the index.  Now we use update-index --index-info
   to inject higher stage entries to leave the index in unmerged
   state for these two cases.

What this still does _not_ do is to inject unmerged state into
the index when the structural changes conflict.  I have not
thought things through what to do in each case yet, but the
cases this commit cover are the most common ones, so this would
be a good start.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoformat-patch: use same number of digits in numbers
Junio C Hamano [Sun, 11 Dec 2005 06:22:35 +0000 (22:22 -0800)]
format-patch: use same number of digits in numbers

This would help sorting by subject in MUA work saner even though
MUA is too dumb to attempt sorting numbered subjects sanely.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agot0000: catch trivial pilot errors.
Junio C Hamano [Sun, 11 Dec 2005 04:55:32 +0000 (20:55 -0800)]
t0000: catch trivial pilot errors.

People seem to be getting test failure from t6021 not becuase
git is faulty but because they forgot to install "merge".  Check
this and other trivial pilot errors in the first test.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agot3300: funny name test
Junio C Hamano [Sun, 11 Dec 2005 02:36:15 +0000 (18:36 -0800)]
t3300: funny name test

Add double quote character to the test pattern.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAllow saving an object from a pipe
Daniel Barkalow [Sat, 10 Dec 2005 22:25:24 +0000 (17:25 -0500)]
Allow saving an object from a pipe

In order to support getting data into git with scripts, this adds a
--stdin option to git-hash-object, which will make it read from stdin.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoarchimport: fix a in new changeset applyer addition
Eric Wong [Thu, 24 Nov 2005 07:58:16 +0000 (23:58 -0800)]
archimport: fix a in new changeset applyer addition

Fix a stupid bug I introduced when splitting the
accurate and fast changeset appliers.

Also, remove an old debugging statement I added

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: Fix a bug I introduced in the new log parser
Eric Wong [Thu, 24 Nov 2005 07:56:31 +0000 (23:56 -0800)]
archimport: Fix a bug I introduced in the new log parser

This fixes the case (that worked originally in Martin's version)
where the only new/modified files are Arch control files.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: Add the accurate changeset applyer
Eric Wong [Thu, 24 Nov 2005 07:55:04 +0000 (23:55 -0800)]
archimport: Add the accurate changeset applyer

And make it the default.
This includes stats tracking to verbose mode

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: safer log file parsing
Eric Wong [Thu, 24 Nov 2005 07:53:55 +0000 (23:53 -0800)]
archimport: safer log file parsing

Better logfile parsing, no longer confused by 'headers' after the first
blank line.

Re-enabled tag-reading with abrowse (baz and tla compatible)

Remove need to quote args to external processes

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: add -D <depth> and -a switch
Eric Wong [Thu, 24 Nov 2005 07:52:43 +0000 (23:52 -0800)]
archimport: add -D <depth> and -a switch

add -D <depth> option to abrowse add -a switch to attempt to
auto-register archives at mirrors.sourcecontrol.net

(ML: Also removes some std libraries no longer in use)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: remove git wrapper dependency
Eric Wong [Thu, 24 Nov 2005 07:51:33 +0000 (23:51 -0800)]
archimport: remove git wrapper dependency

use git-diff-files instead of git diff-files so we don't rely on the
wrapper being installed (some people may have git as GNU interactive
tools :)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: fix -t tmpdir switch
Eric Wong [Thu, 24 Nov 2005 07:50:27 +0000 (23:50 -0800)]
archimport: fix -t tmpdir switch

set TMPDIR env correctly if -t <tmpdir> is passed from the command-line.
setting TMPDIR => 1 as an argument to tempdir() has no effect otherwise

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: remove String::ShellQuote dependency.
Eric Wong [Thu, 24 Nov 2005 07:48:57 +0000 (23:48 -0800)]
archimport: remove String::ShellQuote dependency.

use safe_pipe_capture() or system() over backticks where
shellquoting may have been necessary.
More changes planned, so I'm not touching the parts I'm
planning on replacing entirely.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoarchimport: first, make sure it still compiles
Eric Wong [Thu, 24 Nov 2005 07:47:39 +0000 (23:47 -0800)]
archimport: first, make sure it still compiles

(ML: And introduce safe_pipe_capture())

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
18 years agoLink Everyday GIT to main documentation tree.
Junio C Hamano [Sat, 10 Dec 2005 07:41:03 +0000 (23:41 -0800)]
Link Everyday GIT to main documentation tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoEveryday GIT with 20 commands
Junio C Hamano [Sat, 10 Dec 2005 07:07:29 +0000 (23:07 -0800)]
Everyday GIT with 20 commands

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUse GIT_EXEC_PATH explicitly for initial git-init-db in tests.
Junio C Hamano [Sat, 10 Dec 2005 01:32:18 +0000 (17:32 -0800)]
Use GIT_EXEC_PATH explicitly for initial git-init-db in tests.

This is just a belts-and-suspenders check, but makes sure we
have both "git" and "git-init-db" built, executable, and
checking.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agouse "git init-db" in tests
Alex Riesen [Thu, 8 Dec 2005 20:25:55 +0000 (21:25 +0100)]
use "git init-db" in tests

This is to catch an error where tests are run without first
building what are being tested.  Relying on prefixing $PATH with
the build directory and expect that the PATH mechanism would
find what we just built would silently run an already installed
binaries from the PATH.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-prune: never lose objects reachable from our refs.
Junio C Hamano [Fri, 9 Dec 2005 07:18:41 +0000 (23:18 -0800)]
git-prune: never lose objects reachable from our refs.

Explicit <head> arguments to git-prune replaces, instead of
extends, the list of heads used for reachability analysis by
fsck-objects.  By giving a subset of heads by mistake, objects
reachable only from other heads can be removed, resulting in a
corrupted repository.

This commit stops replacing the list of heads, and makes the
command line arguments to add to them instead for safety.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoqsort(): ptrdiff_t may be larger than int
Junio C Hamano [Fri, 9 Dec 2005 01:29:11 +0000 (17:29 -0800)]
qsort(): ptrdiff_t may be larger than int

This is a companion patch to e23eff8be92a2a2cb66b53deef020063cff285ed
commit.  The same logic, the same rationale that a comparison
function that returns an int should not just compute a ptrdiff_t
and return it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: git-prune
Junio C Hamano [Fri, 9 Dec 2005 00:30:24 +0000 (16:30 -0800)]
Documentation: git-prune

Not replacing but always including our own refs may be more
desirable (and unarguably much safer), but at the same time I
have a suspicion that that might be forbidding a useful usage I
haven't thought of, so...

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-read-tree.txt: Add --reset to SYNOPSIS.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:06 +0000 (00:28 +0100)]
Documentation/git-read-tree.txt: Add --reset to SYNOPSIS.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-tag.txt: Fix the order of sections (DESCRIPTION should come before...
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-tag.txt: Fix the order of sections (DESCRIPTION should come before OPTIONS).

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-update-server-info.txt: Add -f alias for --force to documentation.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-update-server-info.txt: Add -f alias for --force to documentation.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-http-fetch.txt: Document the commit-id argument.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-http-fetch.txt: Document the commit-id argument.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-repack.txt: Add -l and -n.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-repack.txt: Add -l and -n.

This adds documentation for the -l and -n options to git-repack.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-ls-remote.txt: Add -h and -t.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-ls-remote.txt: Add -h and -t.

-h and -t are aliases for --heads and --tags to git-ls-remote.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-format-patch.txt: Add --signoff, --check, and long option-names.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-format-patch.txt: Add --signoff, --check, and long option-names.

The documentation was lacking descriptions for the --signoff and --check
options to git-format-patch.  It was also missing the following long
option-names: --output-directory (-o), --numbered (-n), --keep-subject
(-k), --author (-a), --date (-d), and --mbox (-m).

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd documentation for the --topo-order option to git-show-branch.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Add documentation for the --topo-order option to git-show-branch.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd documentation for git-revert and git-cherry-pick.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Add documentation for git-revert and git-cherry-pick.

* Added the -e option to the documentation of git-cherry-pick.
* Added the -e and --no-commit option to git-revert.
* Removed redundant case expression for -n as --no-edit (already taken by
  --no-commit).

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-cherry-pick: Add --replay and --no-commit.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-cherry-pick: Add --replay and --no-commit.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-cvsimport.txt: Fix a slight glitch in description heading.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-cvsimport.txt: Fix a slight glitch in description heading.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-verify-pack.txt: added documentation for --.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-verify-pack.txt: added documentation for --.

The -- option has been added to the documentation of git-verify-pack.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation/git-commit.txt: Add long options and -- to documentation.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Documentation/git-commit.txt: Add long options and -- to documentation.

Added the following long options to documentation:

* --all
* --signoff
* --verify
* --no-verify
* --edit

Also added documentation for the -- option for terminating option parsing.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUse uniform description for the '--' option.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Use uniform description for the '--' option.

All descriptions of the '--' option were the same except for that in
Documentation/git-merge-index.txt.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix the description of --utf8 and --keep to git-am.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Fix the description of --utf8 and --keep to git-am.

The git-am script actually transform --utf8 and --keep to -u and -k when
sent to git-mailinfo.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocument the --non-empty command-line option to git-pack-objects.
Nikolai Weibull [Thu, 8 Dec 2005 23:28:05 +0000 (00:28 +0100)]
Document the --non-empty command-line option to git-pack-objects.

This provides (minimal) documentation for the --non-empty command-line
option to the pack-objects command.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshow-branch: comment typo
Junio C Hamano [Thu, 8 Dec 2005 22:10:02 +0000 (14:10 -0800)]
show-branch: comment typo

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: recursive is the default strategy these days.
Junio C Hamano [Thu, 8 Dec 2005 22:04:33 +0000 (14:04 -0800)]
Documentation: recursive is the default strategy these days.

We still said resolve was the default in handful places.

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