Code

git.git
19 years agoCustomize git command for installations that lack certain commands.
Junio C Hamano [Sun, 2 Oct 2005 07:20:45 +0000 (00:20 -0700)]
Customize git command for installations that lack certain commands.

When the platform lacks certain git subcommands, omit them from the
list of subcommands that are available from "git" wrapper.

Noticed by Geert Bosch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git on OpenBSD
Han Boetes [Sat, 1 Oct 2005 06:23:26 +0000 (08:23 +0200)]
[PATCH] git on OpenBSD

iconv is installed in /usr/local.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Re-instate index file write optimization
Linus Torvalds [Sat, 1 Oct 2005 20:39:47 +0000 (13:39 -0700)]
[PATCH] Re-instate index file write optimization

This makes "git-update-index" avoid the new index file write if it didn't
make any changes to the index.

It still doesn't make things like "git status" be read-only operations in
general, but if the index file doesn't need refreshing, it now will at
least avoid making unnecessary changes.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Better error reporting for "git status"
Linus Torvalds [Sat, 1 Oct 2005 20:24:27 +0000 (13:24 -0700)]
[PATCH] Better error reporting for "git status"

Instead of "git status" ignoring (and hiding) potential errors from the
"git-update-index" call, make it exit if it fails, and show the error.

In order to do this, use the "-q" flag (to ignore not-up-to-date files)
and add a new "--unmerged" flag that allows unmerged entries in the index
without any errors.

This also avoids marking the index "changed" if an entry isn't actually
modified, and makes sure that we exit with an understandable error message
if the index is corrupt or unreadable. "read_cache()" no longer returns an
error for the caller to check.

Finally, make die() and usage() exit with recognizable error codes, if we
ever want to check the failure reason in scripts.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMore portability.
Junio C Hamano [Fri, 30 Sep 2005 20:31:16 +0000 (13:31 -0700)]
More portability.

 - The location of openssl development files got customizable.
 - The location of iconv development files got customizable.
 - Pass $TAR down to t5000 test so that the user can override with
   'gmake TAR=gtar'.
 - Solaris 'bc' does not seem to grok "define abs()".  There is no
   reason to use bc there -- expr would do.

Signed-off-by: Junio C Hamano <junio@twinsun.com>
19 years agoAdd git-symbolic-ref
Junio C Hamano [Fri, 30 Sep 2005 21:26:57 +0000 (14:26 -0700)]
Add git-symbolic-ref

This adds the counterpart of git-update-ref that lets you read
and create "symbolic refs".  By default it uses a symbolic link
to represent ".git/HEAD -> refs/heads/master", but it can be compiled
to use the textfile symbolic ref.

The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah
.git/HEAD' have been converted to use new git-symbolic-ref command, so
that they can deal with either implementation.

Signed-off-by: Junio C Hamano <junio@twinsun.com>
19 years agoUse resolve_ref() to implement read_ref().
Junio C Hamano [Fri, 30 Sep 2005 21:08:25 +0000 (14:08 -0700)]
Use resolve_ref() to implement read_ref().

Symbolic refs are understood by resolve_ref(), so existing read_ref()
users will automatically understand them as well.

Signed-off-by: Junio C Hamano <junio@twinsun.com>
19 years ago[PATCH] Allow reading "symbolic refs" that point to other refs
Linus Torvalds [Sun, 25 Sep 2005 16:59:37 +0000 (09:59 -0700)]
[PATCH] Allow reading "symbolic refs" that point to other refs

This extends the ref reading to understand a "symbolic ref": a ref file
that starts with "ref: " and points to another ref file, and thus
introduces the notion of ref aliases.

This is in preparation of allowing HEAD to eventually not be a symlink,
but one of these symbolic refs instead.

[jc: Linus originally required the prefix to be "ref: " five bytes
 and nothing else, but I changed it to allow and strip any number of
 leading whitespaces to match what update-ref.c does.]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoTeach update-ref about a symbolic ref stored in a textfile.
Junio C Hamano [Mon, 26 Sep 2005 02:30:24 +0000 (19:30 -0700)]
Teach update-ref about a symbolic ref stored in a textfile.

A symbolic ref is a regular file whose contents is "ref:", followed by
optional leading whitespaces, followed by a GIT_DIR relative pathname,
followed by optional trailing whitespaces (the optional whitespaces
are unconditionally removed, so you cannot have leading nor trailing
whitespaces).  This can be used in place of a traditional symbolic
link .git/HEAD that usually points at "refs/heads/master".  You can
instead have a regular file .git/HEAD whose contents is
"ref: refs/heads/master".

[jc: currently the code does not enforce the symbolic ref to begin with
 refs/, unlike the symbolic link case.  It may be worthwhile to require
 either case to begin with refs/ and not have any /./ nor /../ in them.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git fetch --tags
Linus Torvalds [Thu, 29 Sep 2005 21:35:15 +0000 (14:35 -0700)]
[PATCH] git fetch --tags

You can do

git fetch --tags <linus-kernel-repo>

and it should fetch all my tags automatically.

[jc: The original by Linus fetched and overwrote branch heads with
 --all, which felt dangerous and wrong, so I removed it.  Also this
 version does not use any refs that resulted as --tags for later
 merge. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] HTTP partial transfer support fix.
Nick Hengeveld [Fri, 30 Sep 2005 23:27:47 +0000 (16:27 -0700)]
[PATCH] HTTP partial transfer support fix.

Don't unlink the temp file when an object transfer fails, so next attempt
will pick up where the failed transfer left off

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUpdate partial HTTP transfers.
Junio C Hamano [Fri, 30 Sep 2005 07:07:39 +0000 (00:07 -0700)]
Update partial HTTP transfers.

Add the sanity checks discussed on the list with Nick Hengeveld in
<20050927000931.GA15615@reactrix.com>.

 * unlink of previous and rename from temp to previous can fail for
   reasons other than benign ones (missing previous and missing temp).
   Report these failures when we encounter them, to make diagnosing
   problems easier.

 * when rewinding the partially written result, make sure to
   truncate the file.

Also verify the pack after downloading by calling
verify_packfile().

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] HTTP partial transfer support for object, pack, and index transfers
Nick Hengeveld [Wed, 28 Sep 2005 17:14:04 +0000 (10:14 -0700)]
[PATCH] HTTP partial transfer support for object, pack, and index transfers

HTTP partial transfer support for object, pack, and index transfers

[jc: this should not be placed in "master" -- it does not have any
 fixes requested on the list.]

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoPass CVSps generated A U Thor <author@domain.xz> intact.
Junio C Hamano [Fri, 30 Sep 2005 08:48:57 +0000 (01:48 -0700)]
Pass CVSps generated A U Thor <author@domain.xz> intact.

Alexey Nezhdanov updated CVSps to generate author-name and
author-email information in its output.

If the input looks like it has that already properly formatted,
use that without our own munging.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] archimport: Actually cope with merges from "remote" repositories. Plus: Nicer...
Martin Langhoff [Fri, 30 Sep 2005 07:15:12 +0000 (19:15 +1200)]
[PATCH] archimport: Actually cope with merges from "remote" repositories. Plus: Nicer messages.

archimport was refusing to import commits that had merges from repositories
that it didn't know about. Fixed.

Also brings in nicer messages.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoHonor extractor's umask in git-tar-tree.
Junio C Hamano [Sat, 1 Oct 2005 19:01:07 +0000 (12:01 -0700)]
Honor extractor's umask in git-tar-tree.

The archive generated with git-tar-tree had 0755 and 0644 mode bits.
This inconvenienced the extractor with umask 002 by robbing g+w bit
unconditionally.  Just write it out with loose permissions bits and
let the umask of the extractor do its job.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoHonor user's umask.
Junio C Hamano [Sat, 1 Oct 2005 18:58:43 +0000 (11:58 -0700)]
Honor user's umask.

Fix the last two holdouts that forced mode bits stricter than the user's umask.
Noticed by Wolfgang Denk and fixed by Linus.

[jc: applied the same fix to mailsplit just for the sake of consistency.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Flag empty patches as errors
Linus Torvalds [Sat, 1 Oct 2005 06:25:23 +0000 (23:25 -0700)]
[PATCH] Flag empty patches as errors

A patch that contains no actual diff, and that doesn't change any
meta-data is bad. It shouldn't be a patch at all, and git-apply shouldn't
just accept it.

This caused a corrupted patch to be silently applied as an empty change in
the kernel, because the corruption ended up making the patch look empty.

An example of such a patch is one that contains the patch header, but
where the initial fragment header (the "@@ -nr,.." line) is missing,
causing us to not parse any fragments.

The real "patch" program will also flag such patches as bad, with the
message

patch: **** Only garbage was found in the patch input.

and we should do likewise.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoConsolidate null_sha1[].
Junio C Hamano [Fri, 30 Sep 2005 21:02:47 +0000 (14:02 -0700)]
Consolidate null_sha1[].

Signed-off-by: Junio C Hamano <junio@twinsun.com>
19 years agoStill installing the old command names.
Junio C Hamano [Fri, 30 Sep 2005 07:27:11 +0000 (00:27 -0700)]
Still installing the old command names.

After seeing Jeff's guide, I changed my mind about the
big-rename transition plan.  Even if Porcelains are kept up to
date, those web documents that describes older world order would
live longer and people will stumble across them via google
searches.  And who knows how many mirrored copies there are.

The backward compatible symbolic links *will* be removed before
1.0.  But that will not happen in 0.99.8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoTell which packfile is corrupt when we die.
Junio C Hamano [Fri, 30 Sep 2005 07:09:04 +0000 (00:09 -0700)]
Tell which packfile is corrupt when we die.

The core part detected and died upon seeing a corrupted packfile, but
did not help the user by telling which packfile is corrupt and how.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Make logerror() and loginfo() static
Pavel Roskin [Thu, 29 Sep 2005 20:53:14 +0000 (16:53 -0400)]
[PATCH] Make logerror() and loginfo() static

Make logerror() and loginfo() static

logerror() and loginfo() in daemon.c are never declared and never called
from other files, therefore they should be declared static.  Found by
sparse.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Old curl does not know about CURLOPT_SSLKEY
Johannes Schindelin [Thu, 29 Sep 2005 16:19:50 +0000 (18:19 +0200)]
[PATCH] Old curl does not know about CURLOPT_SSLKEY

... so try to set it only in later versions.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUse git-merge in git-pull (second try).
Junio C Hamano [Mon, 26 Sep 2005 02:43:51 +0000 (19:43 -0700)]
Use git-merge in git-pull (second try).

This again makes git-pull to use git-merge, so that different merge
strategy can be specified from the command line.  Without explicit
strategy parameter, it defaults to git-merge-resolve if only one
remote is pulled, and git-merge-octopus otherwise, to keep the
default behaviour of the command the same as the original.

Also this brings another usability measure: -n flag from the command
line, if given, is passed to git-merge to prevent it from running the
diffstat at the end of the merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUse git-update-ref in scripts.
Junio C Hamano [Wed, 28 Sep 2005 01:14:27 +0000 (18:14 -0700)]
Use git-update-ref in scripts.

This uses the git-update-ref command in scripts for safer updates.
Also places where we used to read HEAD ref by using "cat" were fixed
to use git-rev-parse.  This will matter when we start using symbolic
references.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Make some needlessly global stuff static
Peter Hagervall [Wed, 28 Sep 2005 12:04:54 +0000 (14:04 +0200)]
[PATCH] Make some needlessly global stuff static

Insert 'static' where appropriate.

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Support for more CURL SSL settings via environment variables
Nick Hengeveld [Tue, 27 Sep 2005 17:45:27 +0000 (10:45 -0700)]
[PATCH] Support for more CURL SSL settings via environment variables

Added support for additional CURL SSL settings via environment variables.
Client certificate/key files can be specified as well as alternate CA
information.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Add new programs to .gitignore.
Tom Prince [Tue, 27 Sep 2005 07:06:05 +0000 (01:06 -0600)]
[PATCH] Add new programs to .gitignore.

Signed-off-by: Tom Prince <tom.prince@ualberta.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFastpath the normal case by not checking that index matches HEAD.
Junio C Hamano [Wed, 28 Sep 2005 23:29:11 +0000 (16:29 -0700)]
Fastpath the normal case by not checking that index matches HEAD.

The merge strategy would check this itself and typically does it
by using git-read-tree -m -u 3-way merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix default pull not to do an unintended Octopus.
Junio C Hamano [Mon, 26 Sep 2005 05:54:23 +0000 (22:54 -0700)]
Fix default pull not to do an unintended Octopus.

The refspecs specified in the .git/remotes/<remote> on the "Pull: "
lines are for fetching multiple heads in one go, but most of the time
making an Octopus out of them is not what is wanted.  Make git-fetch
leave the marker in .git/FETCH_HEAD file so that later stages can
tell which heads are for merging and which are not.

Tom Prince made me realize how stupid the original behaviour was.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUpdate the case table in t/t1000.
Junio C Hamano [Wed, 28 Sep 2005 19:56:18 +0000 (12:56 -0700)]
Update the case table in t/t1000.

It still talked about "the proposed alternative semantics" but we have
used those alternative semantics for quite some time.  Update them to
avoid confusion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge master.kernel.org:/home/hpa/git/daemon
Junio C Hamano [Wed, 28 Sep 2005 00:05:41 +0000 (17:05 -0700)]
Merge master.kernel.org:/home/hpa/git/daemon

19 years agogit-commit: use update-index --stdin, instead of xargs.
Junio C Hamano [Tue, 27 Sep 2005 01:13:53 +0000 (18:13 -0700)]
git-commit: use update-index --stdin, instead of xargs.

Now update-index supports '-z --stdin', we do not have to rely on
platform xargs to support -0 option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoupdate-index: document --stdin and -z
Junio C Hamano [Tue, 27 Sep 2005 01:13:32 +0000 (18:13 -0700)]
update-index: document --stdin and -z

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoupdate-index: --stdin and -z
Junio C Hamano [Tue, 27 Sep 2005 01:13:08 +0000 (18:13 -0700)]
update-index: --stdin and -z

The new option --stdin reads list of paths to be updated from the
standard input.  As usual, -z means the paths are terminated with NUL
characters, as opposed to LF without that option.

This is useful to use git-diff-files -z and git-ls-files -z when the
platform xargs does not support -0 option, and obviously saves one
process even when xargs can take -0.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoCOPTS -> CFLAGS
H. Peter Anvin [Tue, 27 Sep 2005 16:02:24 +0000 (09:02 -0700)]
COPTS -> CFLAGS

19 years agoParallelize the build
H. Peter Anvin [Tue, 27 Sep 2005 16:01:08 +0000 (09:01 -0700)]
Parallelize the build

19 years agoMerge with git+ssh://master.kernel.org/pub/scm/git/git.git
H. Peter Anvin [Tue, 27 Sep 2005 15:50:08 +0000 (08:50 -0700)]
Merge ... git+ssh://kernel.org/pub/scm/git/git.git

19 years agoRestore chdir(".git")
H. Peter Anvin [Tue, 27 Sep 2005 15:49:40 +0000 (08:49 -0700)]
Restore chdir(".git")

19 years ago[PATCH] Return CURL error message when object transfer fails
Nick Hengeveld [Mon, 26 Sep 2005 17:52:11 +0000 (10:52 -0700)]
[PATCH] Return CURL error message when object transfer fails

Return CURL error message when object transfer fails

[jc: added similar curl_errorstr errors to places where we
 use curl_easy_perform() to run fetch that _must_ succeed.]

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Implement --recover for git-*-fetch
Daniel Barkalow [Tue, 27 Sep 2005 01:38:08 +0000 (21:38 -0400)]
[PATCH] Implement --recover for git-*-fetch

With the --recover option, we verify that we have absolutely
everything reachable from the target, not assuming that things
reachable from refs will be complete.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Provide access to git_dir through get_git_dir().
Sven Verdoolaege [Mon, 26 Sep 2005 20:54:01 +0000 (22:54 +0200)]
[PATCH] Provide access to git_dir through get_git_dir().

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Make the test more shell generic and fix missing Solaris find option
Peter Eriksen [Sat, 24 Sep 2005 19:50:29 +0000 (21:50 +0200)]
[PATCH] Make the test more shell generic and fix missing Solaris find option

This is from Peter Eriksen, but further fixed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoReally require tk 8.4 (RPM)
Junio C Hamano [Tue, 27 Sep 2005 07:15:45 +0000 (00:15 -0700)]
Really require tk 8.4 (RPM)

**BLUSH**
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoSupport a modicum of path validation, and allow an export all trees option.
H. Peter Anvin [Tue, 27 Sep 2005 02:10:55 +0000 (19:10 -0700)]
Support a modicum of path validation, and allow an export all trees option.

19 years agoRequire tk 8.4 (RPM)
Junio C Hamano [Tue, 27 Sep 2005 01:29:26 +0000 (18:29 -0700)]
Require tk 8.4 (RPM)
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge http://www.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Tue, 27 Sep 2005 01:23:47 +0000 (18:23 -0700)]
Merge http://www.kernel.org/pub/scm/gitk/gitk

19 years agogit-fetch: send informational output to >&2 consistently.
Junio C Hamano [Mon, 26 Sep 2005 02:49:49 +0000 (19:49 -0700)]
git-fetch: send informational output to >&2 consistently.

Only the "Fetching ... using http" was leaking to stdout.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoGive default merge message after failed automerge.
Junio C Hamano [Sun, 25 Sep 2005 07:12:06 +0000 (00:12 -0700)]
Give default merge message after failed automerge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDo not require clean tree when reverting and cherry-picking.
Junio C Hamano [Sun, 25 Sep 2005 05:52:32 +0000 (22:52 -0700)]
Do not require clean tree when reverting and cherry-picking.

My stupidity deserved to be yelled at by Linus ... there is no reason
to require the working tree to be clean when merging -- the only
requirements are index to match HEAD commit and the paths involved in
merge are up to date in the working tree.  Revert and cherry-pick are
just specialized forms of merge, and the requirements should be the
same.

Remove the 'general purpose routine to make sure tree is clean' from
git-sh-setup, to prevent me from getting tempted again.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix overzealous cleanliness check in git-merge
Junio C Hamano [Fri, 23 Sep 2005 07:43:04 +0000 (00:43 -0700)]
Fix overzealous cleanliness check in git-merge

Being able to try multiple strategies and automatically picking one
that seems to give less conflicting result may or may not much sense
in practice.  At least that should not force normal use case to
additionally require the working tree to be fully clean.  As Linus
shouted, local changes do not matter unless they interfere with the
merge.

This commit changes git-merge not to require a clean working tree.
Only when we will iterate through more than one merge strategies,
local changes are stashed away before trying the first merge, and
restored before second and later merges are attempted.

The index file must be in sync with HEAD in any case -- otherwise the
merge result would contain changes since HEAD that was done locally
and registered in the index.  This check is already enforced by
three-way read-tree existing merge strategies use, but is done here as
a safeguard as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-clone: check out "master" by default.
Junio C Hamano [Tue, 27 Sep 2005 00:17:09 +0000 (17:17 -0700)]
git-clone: check out "master" by default.

And with -n flag you can tell it not to.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUse "$@" rather than "${1+$@}" when invoking wish.
Paul Mackerras [Tue, 27 Sep 2005 00:29:41 +0000 (10:29 +1000)]
Use "$@" rather than "${1+$@}" when invoking wish.

19 years agoPlug a small race in update-ref.c.
Junio C Hamano [Sun, 25 Sep 2005 23:28:51 +0000 (16:28 -0700)]
Plug a small race in update-ref.c.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoChange wish8.4 back to wish
Paul Mackerras [Mon, 26 Sep 2005 00:22:43 +0000 (10:22 +1000)]
Change wish8.4 back to wish

Checking in the change from wish to wish8.4 was a mistake; I had
changed it for a test but forgot to change it back before checking
in a patch.

19 years ago[PATCH] Add "git-update-ref" to update the HEAD (or other) ref
Linus Torvalds [Sun, 25 Sep 2005 18:43:05 +0000 (11:43 -0700)]
[PATCH] Add "git-update-ref" to update the HEAD (or other) ref

This is a careful version of the script stuff that currently just
blindly writes HEAD with a new value.

You can use

git-update-ref HEAD <newhead>

or

git-update-ref HEAD <newhead> <oldhead>

where the latter version verifies that the old value of HEAD matches
oldhead.

It basically allows a "ref" file to be a symbolic pointer to another ref
file by starting with the four-byte header sequence of "ref:".

More importantly, it allows the update of a ref file to follow these
symbolic pointers, whether they are symlinks or these "regular file
symbolic refs".

NOTE! It follows _real_ symlinks only if they start with "refs/":
otherwise it will just try to read them and update them as a regular file
(ie it will allow the filesystem to follow them, but will overwrite such a
symlink to somewhere else with a regular filename).

In general, using

git-update-ref HEAD "$head"

should be a _lot_ safer than doing

echo "$head" > "$GIT_DIR/HEAD"

both from a symlink following standpoint _and_ an error checking
standpoint.  The "refs/" rule for symlinks means that symlinks that point
to "outside" the tree are safe: they'll be followed for reading but not
for writing (so we'll never write through a ref symlink to some other
tree, if you have copied a whole archive by creating a symlink tree).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] More descriptive messages for conflict cases in merges
Fredrik Kuivinen [Sun, 25 Sep 2005 14:49:02 +0000 (16:49 +0200)]
[PATCH] More descriptive messages for conflict cases in merges

The merge strategies can give more descriptive error messages for
conflict cases if they are given the actual branch names instead of
the SHA1s.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] recursive-merge: Don't print a stack trace when read-tree fails.
Fredrik Kuivinen [Sun, 25 Sep 2005 14:48:24 +0000 (16:48 +0200)]
[PATCH] recursive-merge: Don't print a stack trace when read-tree fails.

If the working tree is dirty read-tree will fail, and we don't want an
ugly stack trace in that case. Also make sure we don't print stack
traces when we use 'die'.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDiff: --name-status output format.
Junio C Hamano [Wed, 21 Sep 2005 07:20:06 +0000 (00:20 -0700)]
Diff: --name-status output format.

The new output format shows only the status letter and paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDiff: -l<num> to limit rename/copy detection.
Junio C Hamano [Wed, 21 Sep 2005 07:18:27 +0000 (00:18 -0700)]
Diff: -l<num> to limit rename/copy detection.

When many paths are modified, rename detection takes a lot of time.
The new option -l<num> can be used to disable rename detection when
more than <num> paths are possibly created as renames.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDiff clean-up.
Junio C Hamano [Wed, 21 Sep 2005 07:00:47 +0000 (00:00 -0700)]
Diff clean-up.

This is a long overdue clean-up to the code for parsing and passing
diff options.  It also tightens some constness issues.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge branch 'fixes'
Junio C Hamano [Sun, 25 Sep 2005 06:50:36 +0000 (23:50 -0700)]
Merge branch 'fixes'

19 years agoClean generated files a bit more.
Junio C Hamano [Sun, 25 Sep 2005 06:48:29 +0000 (23:48 -0700)]
Clean generated files a bit more.

Now we conditionally compile things in compat/, so we should remove
object files there.  Python execution can leave *.pyc and *.pyo, which
need to be cleaned as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoStop installing the backward compatible symlinks.
Junio C Hamano [Sun, 25 Sep 2005 06:42:34 +0000 (23:42 -0700)]
Stop installing the backward compatible symlinks.

Also cmd-renames.sh can now be used to remove the backward compatible
symlinks -- this is not used by default in any way.

As discussed on the list with Pasky, git-ssh-push and git-ssh-pull will
keep calling each other for a while longer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoshow-branch: fix commit naming breakage.
Junio C Hamano [Sun, 25 Sep 2005 06:33:02 +0000 (23:33 -0700)]
show-branch: fix commit naming breakage.

It was ignoring the generation number of the commit when naming 2nd
and later parents, showing "(linus^n)^2" for any <n> incorrectly as
"linus^2".

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Finish documenting trivial merge rules
Daniel Barkalow [Sun, 25 Sep 2005 03:50:04 +0000 (23:50 -0400)]
[PATCH] Finish documenting trivial merge rules

Fix missing symbol explanations, a few incorrect cases, and add
two-way merge rules.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-grep: fix 'git grep -e $pattern' handling
Junio C Hamano [Sat, 24 Sep 2005 22:09:48 +0000 (15:09 -0700)]
git-grep: fix 'git grep -e $pattern' handling

People typically say 'grep -e $pattern' because $pattern has a leading
dash which would be mistaken as a grep flag.  Make sure we pass -e in
front of $pattern when we invoke grep.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoRemove use of 'xargs -0' from git-reset.
Junio C Hamano [Sat, 24 Sep 2005 22:02:35 +0000 (15:02 -0700)]
Remove use of 'xargs -0' from git-reset.

Even without the trouble it causes to people without GNU xargs,
it was not really necessary to print from Perl and then remove it
outside.  Just unlink it inside Perl.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoUse 0.99.7.GIT as version between 0.99.7 and 0.99.8
Junio C Hamano [Sat, 24 Sep 2005 21:58:57 +0000 (14:58 -0700)]
Use 0.99.7.GIT as version between 0.99.7 and 0.99.8

Pasky taught me how he does his versioning for ELinks.  This will sort
after 0.99.7 and interim fixes 0.99.7a, and before 0.99.8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoSolaris: give a bit more built-in defaults.
Junio C Hamano [Fri, 23 Sep 2005 17:41:40 +0000 (10:41 -0700)]
Solaris: give a bit more built-in defaults.

Taking the make command line Peter Eriksen uses, give defaults
to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] CURLDIR in Makefile
Patrick Mauritz [Mon, 19 Sep 2005 14:11:19 +0000 (16:11 +0200)]
[PATCH] CURLDIR in Makefile

Support systems that do not install curl headers and libraries
in /usr/{include,lib}.

Signed-off-by: Patrick Mauritz <oxygene@studentenbude.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Rename daemon.c's lognotice() to loginfo()
Petr Baudis [Sat, 24 Sep 2005 14:13:03 +0000 (16:13 +0200)]
[PATCH] Rename daemon.c's lognotice() to loginfo()

The syslog code logs with severity LOG_INFO in the loginfo() function, so make
things less confusing.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git-daemon --syslog to log through syslog
Petr Baudis [Sat, 24 Sep 2005 14:13:01 +0000 (16:13 +0200)]
[PATCH] git-daemon --syslog to log through syslog

Well, this makes it even more clear that we need the packet reader and
friends to use the daemon logging code. :/  Therefore, we at least indicate
in the "Disconnect" log message if the child process exitted with an error
code or not.

Idea by Linus.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Update git-daemon documentation wrt. the --verbose parameter
Petr Baudis [Sat, 24 Sep 2005 14:12:58 +0000 (16:12 +0200)]
[PATCH] Update git-daemon documentation wrt. the --verbose parameter

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoReally ignore generated distribution material.
Junio C Hamano [Sat, 24 Sep 2005 18:19:07 +0000 (11:19 -0700)]
Really ignore generated distribution material.
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agodaemon.c: pid_t is not int.
Junio C Hamano [Sat, 24 Sep 2005 06:26:55 +0000 (23:26 -0700)]
daemon.c: pid_t is not int.

Reported by Morten Welinder <mwelinder@gmail.com>.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge 'fixes' branch.
Junio C Hamano [Sat, 24 Sep 2005 01:46:34 +0000 (18:46 -0700)]
Merge 'fixes' branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFurther clarify licensing status of compat/subprocess.py.
Junio C Hamano [Sat, 24 Sep 2005 01:43:53 +0000 (18:43 -0700)]
Further clarify licensing status of compat/subprocess.py.

PSF license explicitly states the files in Python distribution is
compatible with GPL, and upstream clarified the licensing terms by
shortening its file header.  This version is a verbatim copy from
release24-maint branch form Python CVS.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] rsh.c unterminated string
H. Peter Anvin [Fri, 23 Sep 2005 23:30:50 +0000 (16:30 -0700)]
[PATCH] rsh.c unterminated string

The change I made to rsh.c would leave the string unterminated under
certain conditions, which unfortunately always applied!  This patch
fixes this.  For some reason this never bit on i386 or ppc, but bit me
on x86-64.

Fix situation where the buffer was not properly null-terminated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git-local-fetch: Avoid confusing error messages on packed repositories
Sergey Vlasov [Fri, 23 Sep 2005 12:28:38 +0000 (16:28 +0400)]
[PATCH] git-local-fetch: Avoid confusing error messages on packed repositories

If the source repository was packed, and git-local-fetch needed to
fetch a pack file, it spewed a misleading error message about not
being able to find the unpacked object.  Fixed by adding the
warn_if_not_exists argument to copy_file(), which controls printing
of error messages in case the source file does not exist.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Fix "git-local-fetch -s" with packed source repository
Sergey Vlasov [Fri, 23 Sep 2005 12:28:33 +0000 (16:28 +0400)]
[PATCH] Fix "git-local-fetch -s" with packed source repository

"git-local-fetch -s" did not work with a packed repository, because
symlink() happily created a link to a non-existing object file,
therefore fetch_file() always returned success, and fetch_pack() was
not called.  Fixed by calling stat() before symlink() to ensure the
file really exists.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git-local-fetch: Avoid calling close(-1)
Sergey Vlasov [Fri, 23 Sep 2005 12:28:28 +0000 (16:28 +0400)]
[PATCH] git-local-fetch: Avoid calling close(-1)

After open() failure, copy_file() called close(ifd) with ifd == -1
(harmless, but causes Valgrind noise).  The same thing was possible
for the destination file descriptor.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] git-local-fetch: Fix error checking and leak in setup_indices()
Sergey Vlasov [Fri, 23 Sep 2005 12:28:23 +0000 (16:28 +0400)]
[PATCH] git-local-fetch: Fix error checking and leak in setup_indices()

setup_indices() did not check the return value of opendir(), and
did not have a corresponding closedir() call.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Plug memory leak in process_tree()
Sergey Vlasov [Fri, 23 Sep 2005 12:28:18 +0000 (16:28 +0400)]
[PATCH] fetch.c: Plug memory leak in process_tree()

When freeing a tree entry, must free its name too.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Do not build object ref lists
Sergey Vlasov [Fri, 23 Sep 2005 12:28:13 +0000 (16:28 +0400)]
[PATCH] fetch.c: Do not build object ref lists

The fetch code does not need object ref lists; by disabling them we
can save some time and memory.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] document command to show diff of a commit
Robert Watson [Fri, 23 Sep 2005 10:06:04 +0000 (11:06 +0100)]
[PATCH] document command to show diff of a commit

Document the best way to show the change introduced by a
commit, based on the suggestion by Linus on the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoIgnore a bit more generated files.
Junio C Hamano [Fri, 23 Sep 2005 21:02:57 +0000 (14:02 -0700)]
Ignore a bit more generated files.
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge branch 'fixes'
Junio C Hamano [Fri, 23 Sep 2005 07:53:43 +0000 (00:53 -0700)]
Merge branch 'fixes'

19 years agoMake 'git diff --cached' synonymous to 'git diff --cached HEAD'.
Junio C Hamano [Fri, 23 Sep 2005 07:53:02 +0000 (00:53 -0700)]
Make 'git diff --cached' synonymous to 'git diff --cached HEAD'.

When making changes to different files (i.e. dirty working tree) and
committing logically separate changes in groups, often it is necessary
to run 'git diff --cached HEAD' to make sure that the changes being
committed makes sense.  Saying 'git diff --cached' by mistake gives
rather uninformative error message from git-diff-files complaining it
does not understand --cached flag.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove call to parse_object() from process()
Sergey Vlasov [Wed, 21 Sep 2005 16:34:29 +0000 (20:34 +0400)]
[PATCH] fetch.c: Remove call to parse_object() from process()

The call to parse_object() in process() is not actually needed - if
the object type is unknown, parse_object() will be called by loop();
if the type is known, the object will be parsed by the appropriate
process_*() function.

After this change blobs which exist locally are no longer parsed,
which gives about 2x CPU usage improvement; the downside is that there
will be no warnings for existing corrupted blobs, but detecting such
corruption is the job of git-fsck-objects, not the fetch programs.
Newly fetched objects are still checked for corruption in http-fetch.c
and ssh-fetch.c (local-fetch.c does not seem to do it, but the removed
parse_object() call would not be reached for new objects anyway).

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Clean up object flag definitions
Sergey Vlasov [Wed, 21 Sep 2005 16:34:24 +0000 (20:34 +0400)]
[PATCH] fetch.c: Clean up object flag definitions

Remove holes left after deleting flags, and use shifts to emphasize
that flags are single bits.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove redundant test of TO_SCAN in process()
Sergey Vlasov [Wed, 21 Sep 2005 16:34:19 +0000 (20:34 +0400)]
[PATCH] fetch.c: Remove redundant test of TO_SCAN in process()

If the SEEN flag was not set, the TO_SCAN flag cannot be set,
therefore testing it is pointless.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove some duplicated code in process()
Sergey Vlasov [Wed, 21 Sep 2005 16:34:14 +0000 (20:34 +0400)]
[PATCH] fetch.c: Remove some duplicated code in process()

It does not matter if we call prefetch() or set the TO_SCAN flag before
or after adding the object to process_queue.  However, doing it before
object_list_insert() allows us to kill 3 lines of duplicated code.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove redundant TO_FETCH flag
Sergey Vlasov [Wed, 21 Sep 2005 16:34:09 +0000 (20:34 +0400)]
[PATCH] fetch.c: Remove redundant TO_FETCH flag

The TO_FETCH flag also became redundant after adding the SEEN flag -
it was set and checked in process() to prevent adding the same object
to process_queue multiple times, but now SEEN guards against this.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove redundant SCANNED flag
Sergey Vlasov [Wed, 21 Sep 2005 16:34:04 +0000 (20:34 +0400)]
[PATCH] fetch.c: Remove redundant SCANNED flag

After adding the SEEN flag, the SCANNED flag became obviously
redundant - each object can get into process_queue through process()
only once, and therefore multiple calls to process_object() for the
same object are not possible.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Make process() look at each object only once
Sergey Vlasov [Wed, 21 Sep 2005 16:33:59 +0000 (20:33 +0400)]
[PATCH] fetch.c: Make process() look at each object only once

The process() function is very often called multiple times for the
same object (because lots of trees refer to the same blobs), but did
not have a fast check for this, therefore a lot of useless calls to
has_sha1_file() and parse_object() were made before discovering that
nothing needs to be done.

This patch adds the SEEN flag which is used in process() to make it
look at each object only once.  When testing git-local-fetch on the
repository of GIT, this gives a 14x improvement in CPU usage (mainly
because the redundant calls to parse_object() are now avoided -
parse_object() always unpacks and parses the object data, even if it
was already parsed before).

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] fetch.c: Remove useless lookup_object_type() call in process()
Sergey Vlasov [Wed, 21 Sep 2005 16:33:54 +0000 (20:33 +0400)]
[PATCH] fetch.c: Remove useless lookup_object_type() call in process()

In all places where process() is called except the one in pull() (which
is executed only once) the pointer to the object is already available,
so pass it as the argument to process() instead of sha1 and avoid an
unneeded call to lookup_object_type().

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDo not give alarming error message from rsync in fetch and clone.
Junio C Hamano [Tue, 20 Sep 2005 06:52:33 +0000 (23:52 -0700)]
Do not give alarming error message from rsync in fetch and clone.

When we check the optional objects/info/alternates file at the remote
repository, we forgot to really squelch error message from rsync.

Not having that file is not a crime.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 89d844d084f14bc9506f63cd3c9aa44b21b49067 commit)

19 years ago[PATCH] Retitle 'inspecting what happened' section.
Jon Loeliger [Thu, 22 Sep 2005 15:51:57 +0000 (10:51 -0500)]
[PATCH] Retitle 'inspecting what happened' section.

In the tutorial, there is a section entitled "Checking it out"
that shows how to use diff log and whatchanged to insect some
of the repository state.

As the phrase "checkout" ususally carries some baggage WRT
other revision control mechanism, I suggest that we re-title
this section something like "Inspecting Changes".

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoPrettyprint octopus merge message.
Junio C Hamano [Thu, 22 Sep 2005 07:55:22 +0000 (00:55 -0700)]
Prettyprint octopus merge message.

Including the current branch in the list of heads being merged
was not a good idea, so drop it.  And shorten the message by
grouping branches and tags together to form a single line.

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