git.git
18 years agoFix typos and minor format issues.
jdl@freescale.com [Tue, 29 Nov 2005 14:59:56 +0000 (08:59 -0600)]
Fix typos and minor format issues.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agohttp-push cleanup
Nick Hengeveld [Tue, 29 Nov 2005 17:33:36 +0000 (09:33 -0800)]
http-push cleanup

The malloc patch from Jan Andres fixed the problem that was causing a
segfault when freeing the lock token, and Johannes Schindelin found
and fixed a problem when no URL is specified on the command line.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-clone --shared should imply --local
Pavel Roskin [Tue, 29 Nov 2005 06:20:49 +0000 (01:20 -0500)]
git-clone --shared should imply --local

The "--shared" option to git-clone is silently ignored if "--local" is
not specified.  The manual doesn't mention such dependency.  Make
"--shared" imply "--local".

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agohash-object.c: type-fix to squelch compiler warnings.
Junio C Hamano [Mon, 28 Nov 2005 11:19:03 +0000 (03:19 -0800)]
hash-object.c: type-fix to squelch compiler warnings.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agodefine die() for scripts that use it.
Junio C Hamano [Mon, 28 Nov 2005 07:33:54 +0000 (23:33 -0800)]
define die() for scripts that use it.

As a fallout from not using git-sh-setup in scripts that can
operate from a subdirectory, we lost definition of die() from
them.  It might make sense to do some cleanup to consolidate
them back again, but this should suffice for now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoverify-tag: make it operable from a subdirectory.
Junio C Hamano [Mon, 28 Nov 2005 07:19:58 +0000 (23:19 -0800)]
verify-tag: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agotag: make it operable from a subdirectory.
Junio C Hamano [Mon, 28 Nov 2005 07:19:06 +0000 (23:19 -0800)]
tag: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agolost-found: make it operable from a subdirectory.
Junio C Hamano [Mon, 28 Nov 2005 07:18:04 +0000 (23:18 -0800)]
lost-found: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agobranch: make it operable from a subdirectory.
Junio C Hamano [Mon, 28 Nov 2005 07:16:15 +0000 (23:16 -0800)]
branch: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agols-remote: define die() now we do not use git-sh-setup
Junio C Hamano [Mon, 28 Nov 2005 07:15:02 +0000 (23:15 -0800)]
ls-remote: define die() now we do not use git-sh-setup

Another interesting "property" is that from inside a git managed
tree, "git-ls-remote ." names the current repository no matter
how deep a subdirectory you are in.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agocount-objects: make it operable from a subdirectory.
Junio C Hamano [Mon, 28 Nov 2005 06:53:20 +0000 (22:53 -0800)]
count-objects: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMake the rest of commands work from a subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 08:50:02 +0000 (00:50 -0800)]
Make the rest of commands work from a subdirectory.

These commands are converted to run from a subdirectory.

    commit-tree convert-objects merge-base merge-index mktag
    pack-objects pack-redundant prune-packed read-tree tar-tree
    unpack-file unpack-objects update-server-info write-tree

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMake networking commands to work from a subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 08:47:59 +0000 (00:47 -0800)]
Make networking commands to work from a subdirectory.

These are whole-tree operations and there is not much point
making them operable from within a subdirectory, but it is easy
to do so, and using setup_git_directory() upfront helps git://
proxy specification picked up from the correct place.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agols-tree: work from subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 08:40:50 +0000 (00:40 -0800)]
ls-tree: work from subdirectory.

This makes ls-tree to work from subdirectory.  It defaults to
show the paths under the current subdirectory, and interprets
user-supplied paths as relative to the current subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agohash-object: work within subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 08:30:07 +0000 (00:30 -0800)]
hash-object: work within subdirectory.

When -w is given, it needs to find out where the .git directory
is, so run the setup_git_directory() when we see a -w.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agocheckout-index: work from subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 08:22:48 +0000 (00:22 -0800)]
checkout-index: work from subdirectory.

With this, git-checkout-index from a subdirectory works as
expected.  Note that "git-checkout-index -a" checks out files
only in the current directory and under.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agofsck-objects: work from subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 07:52:04 +0000 (23:52 -0800)]
fsck-objects: work from subdirectory.

Not much point making it work from subdirectory, but for a
consistency make it so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agopeek-remote: honor proxy config even from subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 07:50:21 +0000 (23:50 -0800)]
peek-remote: honor proxy config even from subdirectory.

Use setup_git_directory_gently() at the beginning of peek-remote
so that git:// proxy can be picked up from the configuration
file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-apply: work from subdirectory.
Junio C Hamano [Sat, 26 Nov 2005 07:14:15 +0000 (23:14 -0800)]
git-apply: work from subdirectory.

When applying a patch to index file, we need to know where GIT_DIR is;
use setup_git_directory() to find it out.  This also allows us to work
from a subdirectory if we wanted to.

When git-apply is run from a subdirectory, it applies the given patch
only to the files under the current directory and below.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoworking from subdirectory: preparation
Junio C Hamano [Sat, 26 Nov 2005 07:14:15 +0000 (23:14 -0800)]
working from subdirectory: preparation

 - prefix_filename() is like prefix_path() but can be used to
   name any file on the filesystem, not the files that might go
   into the index file.

 - setup_git_directory_gently() tries to find the GIT_DIR, but does
   not die() if called outside a git repository.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agobisect: quote pathnames for eval safety.
Junio C Hamano [Mon, 28 Nov 2005 01:42:05 +0000 (17:42 -0800)]
bisect: quote pathnames for eval safety.

... and make sure they are on the same line.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agobisect: limit the searchspace by pathspecs
Linus Torvalds [Sun, 27 Nov 2005 19:32:03 +0000 (11:32 -0800)]
bisect: limit the searchspace by pathspecs

It was surprisingly easy to do.

git bisect start <pathspec>

followed by all the normal "git bisect good/bad" stuff.

Almost totally untested, and I guarantee that if your pathnames have
spaces in them (or your GIT_DIR has spaces in it) this won't work. I don't
know how to fix that, my shell programming isn't good enough.

This involves small changes to make "git-rev-list --bisect" work in the
presense of a pathspec limiter, and then truly trivial (and that's the
broken part) changes to make "git bisect" save away and use the pathspec.

I tried one bisection, and a "git bisect visualize", and it all looked
correct. But hey, don't be surprised if it has problems.

Linus

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agols-tree: match the test to the new semantics.
Junio C Hamano [Mon, 28 Nov 2005 10:32:42 +0000 (02:32 -0800)]
ls-tree: match the test to the new semantics.

The diff for this commit is a good illustration of what changed
in ls-tree behaviour.

 - With -r, tree nodes themselves are not shown anymore, but
   blobs in subtrees are shown.

 - The order of paths parameters do not matter, since they are
   not like arguments to /bin/ls, but are filter patterns.

 - When filter patterns overlap, unintuitive things happen.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agols-tree: Resurrect funny name quoting lost during rewrite.
Junio C Hamano [Mon, 28 Nov 2005 10:30:04 +0000 (02:30 -0800)]
ls-tree: Resurrect funny name quoting lost during rewrite.

The rewrite to match ls-files/diff-tree behaviour accidentally
lost the name quoting.  I am not proud about this code, but this
would get the test going.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agols-tree: further tweaks of the rewrite
Linus Torvalds [Mon, 28 Nov 2005 06:48:08 +0000 (22:48 -0800)]
ls-tree: further tweaks of the rewrite

It modifies the selection a bit, so that a pathspec that is a superset of
a particular tree path will always cause it to recurse into that tree.

As an example, let's say that we do

git-ls-tree HEAD drivers/char

_without_ the "-r". What will happen is that it will start out doing all
the base tree, and for "drivers" it will notice that it's a proper subset
of "drivers/char", so it will always recurse into _that_ tree (but not
into other trees).

Then, it will not match anything else than "char" in that subdirectory,
and because that's not a proper superset (it's an exact match), it will
_not_ recurse into it, so you get:

[torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char
040000 tree 9568cda453aae205bb58983747fa73b9696d9d51    drivers/char

which is what you got with the old git-ls-tree too.

But interestingly, if you add the slash, it will become a proper superset
and it will recurse into _that_ subdirectory (but no deeper: so if you
want all subdirectories _below_ drivers/char/, you still need to give
"-r"):

[torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char/
100644 blob 2b6b1d772ed776fff87927fc34adc2e40500218e    drivers/char/.gitignore
100644 blob 56b8a2e76ab10a5c21787cb7068a846075cbaffd    drivers/char/ChangeLog
100644 blob 970f70d498f4c814e1cf3362e33d7e23ac53c299    drivers/char/Kconfig
...

See? This is on top of the previous two diffs, holler if you want a whole
new "everything combined" version..

It hasn't gotten lots of testing, but it should work.

Linus

19 years agols-tree: further cleanup to parallel ls-files.
Linus Torvalds [Sun, 27 Nov 2005 19:00:09 +0000 (11:00 -0800)]
ls-tree: further cleanup to parallel ls-files.

To get more a "git-ls-files" approach, this trivial patch (on top of my
previous one) enables recursion, and doesn't show partial trees.

[jc: after further discussion, this version enables recursion by default,
 and you can disable it with "-d" flag.

git-ls-tree -d HEAD Documentation/no/such/directory

 shows Documentation tree (without -d it shows nothing).

git-ls-tree HEAD

 shows everything from the tree.  Only to get the single level from the top

git-ls-tree -d HEAD

 is needed.  But there is no way to get the single level with pathspec.
 You need to extract the object name of Documentation tree from the parent
 tree and run

git-ls-tree -d $tree_id_of_Documentation_tree

 to get something similar to what you can get from the current

git-ls-tree HEAD Documentation
 ]

19 years agols-tree: major rewrite to do pathspec
Linus Torvalds [Sat, 26 Nov 2005 17:38:20 +0000 (09:38 -0800)]
ls-tree: major rewrite to do pathspec

git-ls-tree should be rewritten to use a pathspec the same way everybody
else does. Right now it's the odd man out: if you do

git-ls-tree HEAD divers/char drivers/

it will show the same files _twice_, which is not how pathspecs in general
work.

How about this patch? It breaks some of the git-ls-tree tests, but it
makes git-ls-tree work a lot more like other git pathspec commands, and it
removes more than 150 lines by re-using the recursive tree traversal (but
the "-d" flag is gone for good, so I'm not pushing this too hard).

Linus

19 years agowrite_name_quoted(): make one of the path a counted string.
Junio C Hamano [Tue, 29 Nov 2005 06:55:25 +0000 (22:55 -0800)]
write_name_quoted(): make one of the path a counted string.

This is to prepare for ls-tree updates.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoDocumentation: Describe merge operation a bit better.
Junio C Hamano [Tue, 29 Nov 2005 06:54:30 +0000 (22:54 -0800)]
Documentation: Describe merge operation a bit better.

In git-merge documentation, add a section to describe what happens to
the index and working tree during merge, and what their cleanliness
requirements are before the merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix typo in http-push.c
Jan Andres [Tue, 29 Nov 2005 00:51:54 +0000 (01:51 +0100)]
Fix typo in http-push.c

Typo resulted in accessing past the beginning of a string causing segfaults.

[jc: signoffs?]

19 years agoname-rev: fix parent counting.
Junio C Hamano [Tue, 29 Nov 2005 04:51:44 +0000 (20:51 -0800)]
name-rev: fix parent counting.

Noticed by linux@horizon.com.  The first merge parent (typically
"our branch") is ^1, not ^0, and the first other branch is ^2.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agorebase: one safety net, one bugfix and one optimization.
Junio C Hamano [Mon, 28 Nov 2005 21:00:31 +0000 (13:00 -0800)]
rebase: one safety net, one bugfix and one optimization.

When a .dotest from a previously failed rebase or patch
application exists, rebase got confused and tried to apply
mixture of what was already there and what is being rebased.
Check the existence of the directory and barf.

It failed with an mysterious "fatal: cannot read mbox" message
if the branch being rebased is fully in sync with the base.
Also if the branch is a proper descendant of the base, there is
no need to run rebase logic.  Prevent these from happening by
checking where the merge-base is.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge http://www.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Mon, 28 Nov 2005 11:11:11 +0000 (03:11 -0800)]
Merge http://www.kernel.org/pub/scm/gitk/gitk

19 years agogit-mv: quote $src in regexp properly.
Junio C Hamano [Mon, 28 Nov 2005 10:54:05 +0000 (02:54 -0800)]
git-mv: quote $src in regexp properly.

Noticed and fixed by Matthias Urlichs and Josef Weidendorfer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] gitk: Use i18n.commitencoding configuration item.
Junio C Hamano [Mon, 28 Nov 2005 00:12:51 +0000 (16:12 -0800)]
[PATCH] gitk: Use i18n.commitencoding configuration item.

Hardcoding "utf-8" in the script breaks projects that use local
encoding, so allow setting i18n.commitEncoding.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
19 years agoconfig.c: constness tightening to avoid compilation warning.
Junio C Hamano [Mon, 28 Nov 2005 09:46:15 +0000 (01:46 -0800)]
config.c: constness tightening to avoid compilation warning.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogitk: Fix diff this->selected and selected->this functions
Paul Mackerras [Mon, 28 Nov 2005 09:41:56 +0000 (20:41 +1100)]
gitk: Fix diff this->selected and selected->this functions

The change in 8b7e5d76e836396a097bb6f61cf930ea872a7bd3, which makes
a couple of git-diff-tree calls supply only one id rather than two,
fixes the display when showing what a single commit did with dense
revlists, but broke the diff this->selected and diff selected->this
right-click menu functions.

Yann Dirson pointed this out and had a patch that fixed the diff
menu functions by passing a "singlecommit" flag around.  This fixes
it a bit differently, by making the ids and diffids variables be
either a single id, in the case of showing what a commit did, or
{oldid newid}, in the case of the diff menu functions.  That way
we can just pass $ids to git-diff-tree as is.  Most of the changes
in fact are just reversing the order of ids in $ids and $diffids,
because they used to be {child parent}, but git-diff-tree requires
old id before new id.

Signed-off-by: Paul Mackerras <paulus@samba.org>
19 years agomailinfo: Do not use -u=<encoding>; say --encoding=<encoding>
Junio C Hamano [Mon, 28 Nov 2005 09:29:52 +0000 (01:29 -0800)]
mailinfo: Do not use -u=<encoding>; say --encoding=<encoding>

Specifying the value for a single letter, single dash option
parameter with equal sign looked funny, and more importantly
calling the flag to override encoding from utf-8 to something
else "-u" (obviously abbreviated from "utf-8") did not make any
sense.  So spell it out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agomailinfo: Use i18n.commitencoding
Junio C Hamano [Mon, 28 Nov 2005 00:29:38 +0000 (16:29 -0800)]
mailinfo: Use i18n.commitencoding

This uses i18n.commitencoding configuration item to pick up the
default commit encoding for the repository when converting form
e-mail encoding to commit encoding (the default is utf8).

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agomailinfo: allow -u to fall back on latin1 to utf8 conversion.
Junio C Hamano [Mon, 28 Nov 2005 00:22:16 +0000 (16:22 -0800)]
mailinfo: allow -u to fall back on latin1 to utf8 conversion.

When the message body does not identify what encoding it is in,
-u assumes it is in latin-1 and converts it to utf8, which is
the recommended encoding for git commit log messages.

With -u=<encoding>, the conversion is made into the specified
one, instead of utf8, to allow project-local policies.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoIntroduce i18n.commitencoding.
Junio C Hamano [Mon, 28 Nov 2005 00:09:40 +0000 (16:09 -0800)]
Introduce i18n.commitencoding.

This is to hold what the project-local rule as to the
charset/encoding for the commit log message is.  Lack of it
defaults to utf-8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix gitk this->selected diffs
Yann Dirson [Sun, 27 Nov 2005 22:29:30 +0000 (23:29 +0100)]
Fix gitk this->selected diffs

The change made in 8b7e5d76e836396a097bb6f61cf930ea872a7bd3 to
accomodate dense revlists in single-commit diffs has broken computing
of diffs between arbitrary trees, which does need to consider two
commit ids.

This patch changes the two git-diff-tree calls to get the necessary
two ids in this case.  It does so by propagating a "singlecommit" flag
through all functions involved via an additional argument.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge http://www.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Sun, 27 Nov 2005 22:42:15 +0000 (14:42 -0800)]
Merge http://www.kernel.org/pub/scm/gitk/gitk

19 years agogit-mv: follow -k request even on failing renames
Josef Weidendorfer [Sun, 27 Nov 2005 21:11:33 +0000 (22:11 +0100)]
git-mv: follow -k request even on failing renames

-k requests to keep running on an error condition.
Previously, git-mv stopped on failing renames even with -k.

There are some error conditions which are not checked in the
first phase of git-mv, eg. 'permission denied'. Still, option
-k should work.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoSmall fixes in Documentation/git-mv.txt
Josef Weidendorfer [Sun, 27 Nov 2005 21:08:33 +0000 (22:08 +0100)]
Small fixes in Documentation/git-mv.txt

The two synopsis lines have to be prefixed with a space
so that asciidoc inserts a line break inbetween for the
manual page.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-mv: fully detect 'directory moved into itself'
Josef Weidendorfer [Sun, 27 Nov 2005 21:06:42 +0000 (22:06 +0100)]
git-mv: fully detect 'directory moved into itself'

This gives a better error message when trying to move a directory
into some subdirectory of itself; ie. no real bug fix: renaming
already failed before, but with a strange "invalid argument".

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-mv: keep git index consistent with file system on failed rename
Josef Weidendorfer [Sun, 27 Nov 2005 21:04:14 +0000 (22:04 +0100)]
git-mv: keep git index consistent with file system on failed rename

When doing multiple renames, and a rename in the middle fails,
git-mv did not store the successful renames in the git index;
this is fixed by delaying the error message on a failed rename
to after the git updating.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-mv: shrink usage, no usage on error
Josef Weidendorfer [Sun, 27 Nov 2005 20:58:52 +0000 (21:58 +0100)]
git-mv: shrink usage, no usage on error

Small fixes to be consistent with other git scripts:
- usage message is only about options and arguments
- on error, exit(1) without the usage message

Additionally, "beautifies" output with -n a little bit

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agosetup_git_directory(): check repository format version.
Junio C Hamano [Sat, 26 Nov 2005 00:08:48 +0000 (16:08 -0800)]
setup_git_directory(): check repository format version.

After figuring out the GIT_DIR location, make sure the
repository is of the right vintage, by calling
check_repository_format(). .

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoinit-db: check template and repository format.
Junio C Hamano [Sat, 26 Nov 2005 00:03:56 +0000 (16:03 -0800)]
init-db: check template and repository format.

This makes init-db repository version aware.

It checks if an existing config file says the repository being
reinitialized is of a wrong version and aborts before doing
further harm.

When copying the templates, it makes sure the they are of the
right repository format version.  Otherwise the templates are
ignored with an warning message.

It copies the templates before creating the HEAD, and if the
config file is copied from the template directory, reads it,
primarily to pick up the value of core.symrefsonly.

It changes the way the result of the filemode reliability test
is written to the configuration file using git_config_set().
The test is done even if the config file was copied from the
templates.

And finally, our own repository format version is written to the
config file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoCheck repository format version in enter_repo().
Junio C Hamano [Fri, 25 Nov 2005 18:48:26 +0000 (10:48 -0800)]
Check repository format version in enter_repo().

After daemon, upload-pack and receive-pack find out where the
git directory is and chdir() there, make sure that repository is
in a format we understand, after putenv("GIT_DIR=.") so that it
knows to pick up the configuration file from there.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoRepository format version check.
Junio C Hamano [Fri, 25 Nov 2005 23:59:09 +0000 (15:59 -0800)]
Repository format version check.

This adds the repository format version code, first done by
Martin Atukunda.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoformat-patch: output filename reported to stdout verbatim.
Junio C Hamano [Sat, 26 Nov 2005 20:09:07 +0000 (12:09 -0800)]
format-patch: output filename reported to stdout verbatim.

Prepending asterisk to the output was just adding noise, and
making scripts like proposed git-send-mail by Andreas Ericsson
do unnecessary work.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoname-rev: fix off-by-one error in --stdin.
Junio C Hamano [Sat, 26 Nov 2005 07:36:58 +0000 (23:36 -0800)]
name-rev: fix off-by-one error in --stdin.

It dropped the last hexdigit in the object name.

[jc: Noticed and patch supplied by ALASCM, reworked to apply at
the right place by me]

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-mv is not able to handle big directories
Alexander Litvinov [Wed, 23 Nov 2005 10:19:41 +0000 (16:19 +0600)]
git-mv is not able to handle big directories

Use update-index --stdin to handle large number of files without
breaking exec() argument storage limit.

[jc: with minor cleanup from the version posted on the list]

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoshell.c: complain on insufficient arguments.
Junio C Hamano [Sat, 26 Nov 2005 04:57:02 +0000 (20:57 -0800)]
shell.c: complain on insufficient arguments.

Originally noticed by Tommi Virtanen, but done slightly differently.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoGIT 0.99.9k v0.99.9k
Junio C Hamano [Sat, 26 Nov 2005 00:35:20 +0000 (16:35 -0800)]
GIT 0.99.9k

This is not 1.0rc4 yet, but to push the recent fixes out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-sh-setup: move the repository check to a core program.
Junio C Hamano [Fri, 25 Nov 2005 23:52:57 +0000 (15:52 -0800)]
git-sh-setup: move the repository check to a core program.

Any core commands that use setup_git_directory() now check if
given GIT_DIR is really a valid repository, so the same check in
git-sh-setup can use it without reimplementing it in shell.
This commit changes git-sh-setup to use git-var command for
that, although any other commands would do.

Note that we export GIT_DIR explicitly when calling git-var;
without it, the caller of this script would use GIT_DIR that we
return (which is to assume ./.git unless the caller has it
elsewhere) while git-var would go up to find a .git directory in
our parent directories, which would be checking a different
directory from what our callers will be using.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agosetup_git_directory: make sure GIT_DIR is a valid repository.
Junio C Hamano [Fri, 25 Nov 2005 23:43:41 +0000 (15:43 -0800)]
setup_git_directory: make sure GIT_DIR is a valid repository.

setup_git_directory() always trusted what the user told where
GIT_DIR was, and assumed that is a valid .git/ directory.  This
commit changes it to at least do the same level validation as
is_toplevel_directory() does -- has refs/, has objects/ unless
GIT_OBJECT_DIRECTORY is set, and has valid HEAD symlink or
symref.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-var: make it work in subdirectory.
Junio C Hamano [Thu, 24 Nov 2005 09:31:01 +0000 (01:31 -0800)]
git-var: make it work in subdirectory.

Use setup_git_directory() so that it can find its .git
directory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-sh-setup: die if outside git repository.
Junio C Hamano [Thu, 24 Nov 2005 08:12:11 +0000 (00:12 -0800)]
git-sh-setup: die if outside git repository.

Now all the users of this script detect its exit status and die,
complaining that it is outside git repository.  So move the code
that dies from all callers to git-sh-setup script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoparse-remote and ls-remote clean-up.
Junio C Hamano [Thu, 24 Nov 2005 07:46:13 +0000 (23:46 -0800)]
parse-remote and ls-remote clean-up.

There is no reason to use git-sh-setup from git-ls-remote.
git-parse-remote can help the caller to use .git/remotes
shortcut if it is run inside a git repository, but can still be
useful outside a git repositoryas long as the caller does not
use any shortcut.  Use "git-rev-parse --git-dir" to figure out
where the GIT_DIR is, instead of using git-sh-setup.

This also makes "git-ls-remote origin" to work from inside a
subdirectory of a git managed repository as a side effect.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoPrevent "git-commit -a path1 path2..."
Junio C Hamano [Fri, 25 Nov 2005 21:33:14 +0000 (13:33 -0800)]
Prevent "git-commit -a path1 path2..."

When you want to create a partial commit, giving -a by mistake
would ignore the given path.  Prevent it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoconfig.c: avoid shadowing global.
Junio C Hamano [Fri, 25 Nov 2005 19:10:49 +0000 (11:10 -0800)]
config.c: avoid shadowing global.

This is purely cosmetic, but avoid shadowing "FILE *config_file"
global in git_config_set_multivar() function.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix a warning about unused value.
YOSHIFUJI Hideaki / 吉藤英明 [Fri, 25 Nov 2005 10:03:05 +0000 (19:03 +0900)]
Fix a warning about unused value.

Fix a warning:
  git.c:276: warning: value computed is not used

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agocvsimport: Don't let local settings hinder cvs user-migration.
Andreas Ericsson [Fri, 25 Nov 2005 01:37:09 +0000 (02:37 +0100)]
cvsimport: Don't let local settings hinder cvs user-migration.

Avoid this by passing "--norc" to cvsps.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoRename git-config-set to git-repo-config
Johannes Schindelin [Thu, 24 Nov 2005 10:36:01 +0000 (11:36 +0100)]
Rename git-config-set to git-repo-config

... and adjust all references.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agov257
Kay Sievers [Thu, 24 Nov 2005 18:44:28 +0000 (19:44 +0100)]
v257

19 years agofix "rename" output
Kay Sievers [Thu, 24 Nov 2005 18:43:53 +0000 (19:43 +0100)]
fix "rename" output

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
19 years agov256
Kay Sievers [Thu, 24 Nov 2005 17:14:44 +0000 (18:14 +0100)]
v256

19 years agofix quoted filename lookup
Kay Sievers [Thu, 24 Nov 2005 17:14:25 +0000 (18:14 +0100)]
fix quoted filename lookup

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
19 years agov255
Kay Sievers [Thu, 24 Nov 2005 16:30:38 +0000 (17:30 +0100)]
v255

19 years agov254
Kay Sievers [Thu, 24 Nov 2005 16:15:30 +0000 (17:15 +0100)]
v254

19 years agoallow utf8 characters in url parameter escape
Kay Sievers [Thu, 24 Nov 2005 15:56:55 +0000 (16:56 +0100)]
allow utf8 characters in url parameter escape

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
19 years agodiff-tree: teach single-commit diff-tree to honour grafts
Junio C Hamano [Tue, 22 Nov 2005 05:49:06 +0000 (21:49 -0800)]
diff-tree: teach single-commit diff-tree to honour grafts

We used to read the commit objects by hand and ignored the grafts.
Rewrite it using lookup_commit() API, to make it grafts-aware.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoTeach update-index to read from ls-tree.
Junio C Hamano [Tue, 22 Nov 2005 05:46:57 +0000 (21:46 -0800)]
Teach update-index to read from ls-tree.

git-update-index --index-info can almost be usable to read from ls-tree
output to update the index (and not the working tree file) to HEAD commit,
but not quite.  It was designed to read from git-apply --index-info
output, and does not want " blob " in ls-tree output.  Accept that as well.

This lets us update "git-checkout <ent> <path>" that used to filter the
extra " blob " string out.  Noted by Luben.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-revert: make --edit default.
Junio C Hamano [Thu, 24 Nov 2005 00:56:55 +0000 (16:56 -0800)]
git-revert: make --edit default.

Revert always should explain why, so make --edit the default,
unless stdin is not a terminal.  If you really don't want to say
anything, you can say "git-revert --no-edit $commit", or if you
are really sick, you could also say "git-revert $commit </dev/null".
But please don't.

You can also say "git-cherry-pick --edit $commit".  Not editting
the commit log message is the default for cherry-pick.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoAllow editing of a revert-message
Linus Torvalds [Wed, 23 Nov 2005 17:57:54 +0000 (09:57 -0800)]
Allow editing of a revert-message

I think all commit operations should allow editing of the message (ie we
should do this for merges too), but that's _particularly_ true of doing a
"git revert".

We should always explain why we needed to revert something.

This patch adds a "-e" or "--edit" flag to "git revert", although I
actually suspect it should be on by default (and we should have a
"--no-edit" flag to disable it, probably together with an automatic
disable if stdin isn't a terminal).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoFix git-mv for moving directories with 1 file
Josef Weidendorfer [Wed, 23 Nov 2005 11:04:23 +0000 (12:04 +0100)]
Fix git-mv for moving directories with 1 file

This is fixed by putting the file into @changedfiles/@addedfiles,
and not the directory this file is in.

Additionally, this fixes the behavior for attempting to overwrite
a file with a directory, and gives a message for all cases where
overwriting is not possible (file->dir,dir->file,dir->dir).

Thanks for Alexander Litvinov for noting this problem.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agogit-merge: make recursive the default strategy
Junio C Hamano [Thu, 24 Nov 2005 00:23:11 +0000 (16:23 -0800)]
git-merge: make recursive the default strategy

git-pull invoked merge with recursive as the default strategy
for some time now; match it in the git-merge itself.  Also avoid
listing more than one strategy on default because we have only
one strategy that can resolve an octopus and we are already
counting heads here.  This reduces the need to stash away local
modifications.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agopack-redundant: type cleanups.
Junio C Hamano [Thu, 24 Nov 2005 00:08:36 +0000 (16:08 -0800)]
pack-redundant: type cleanups.

Binary representation of object names are unsigned char[20], not
signed.  Also verbose output had %lu format printing size_t
without (unsigned long) cast other places already had, so match
that.  Using format %zu was suggested but might not be supported
as widely.

Noted by Morten Welinder, fixed with input from H. Peter Anvin
and Hideaki Yoshifuji.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agov253
Kay Sievers [Wed, 23 Nov 2005 17:00:34 +0000 (18:00 +0100)]
v253

19 years agoset logo output to raw mode
Kay Sievers [Wed, 23 Nov 2005 15:02:13 +0000 (16:02 +0100)]
set logo output to raw mode

19 years agoadd broken latin encoding to test file
Kay Sievers [Wed, 23 Nov 2005 14:16:49 +0000 (15:16 +0100)]
add broken latin encoding to test file

19 years agoadd ut8 test file
Kay Sievers [Wed, 23 Nov 2005 14:09:59 +0000 (15:09 +0100)]
add ut8 test file

It contains Märchen. (\xc3a4)

19 years ago[PATCH] gitk: UTF-8 support
Pavel Roskin [Wed, 23 Nov 2005 04:15:01 +0000 (23:15 -0500)]
[PATCH] gitk: UTF-8 support

Add gitencoding variable and set it to "utf-8".  Use it for converting
git-rev-list output.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
19 years ago[PATCH] gitk: put braces around exprs
Jeff Hobbs [Wed, 23 Nov 2005 01:39:53 +0000 (17:39 -0800)]
[PATCH] gitk: put braces around exprs

This braces all exprs.  It just seemed to be a few that were missed.

Signed-off-by: Paul Mackerras <paulus@samba.org>
19 years agofix utf8 decoding
Kay Sievers [Wed, 23 Nov 2005 03:26:40 +0000 (04:26 +0100)]
fix utf8 decoding

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
19 years agoFixed git:// IPv4 address problem when compiled with -DNO_IPV6.
Paul Serice [Tue, 22 Nov 2005 13:54:23 +0000 (07:54 -0600)]
Fixed git:// IPv4 address problem when compiled with -DNO_IPV6.

Failure to dereference a pointer caused incorrect initialization of
the IPv4 address when calling connect() when compiled with -DNO_IPV6.

With this patch and yesterday's patch for git-daemon, it should now be
possible to use the native git protocol for both the client and server
on Cygwin.

Signed-off-by: Paul Serice <paul@serice.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoarguments cleanup and some formatting
Alex Riesen [Tue, 22 Nov 2005 14:59:22 +0000 (15:59 +0100)]
arguments cleanup and some formatting

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoremove unused variable
Alex Riesen [Tue, 22 Nov 2005 14:58:41 +0000 (15:58 +0100)]
remove unused variable

It is just assigned, nothing more.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agospeedup allocation in pack-redundant.c
Alex Riesen [Tue, 22 Nov 2005 14:56:35 +0000 (15:56 +0100)]
speedup allocation in pack-redundant.c

Reuse discarded nodes of llists

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMake git-pack-redundant take a list of unimportant objs on stdin
Lukas Sandström [Fri, 18 Nov 2005 22:17:50 +0000 (23:17 +0100)]
Make git-pack-redundant take a list of unimportant objs on stdin

This lets us do "git-fsck-objects --full --unreachable | cut -d ' ' -f3 |
git-pack-redundant --all", which will keep git-pack-redundant from keeping
packs just because they contain unreachable objects.

Also add some more --verbose output.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMerge http://www.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Tue, 22 Nov 2005 09:55:15 +0000 (01:55 -0800)]
Merge http://www.kernel.org/pub/scm/gitk/gitk

19 years agogit-var: constness and globalness cleanup.
Junio C Hamano [Tue, 22 Nov 2005 07:44:35 +0000 (23:44 -0800)]
git-var: constness and globalness cleanup.

var.c::git_var read function did not have to return writable
strings; make it and the functions it points at return const char *
instead.

ident.c::get_ident() did not need to be global, so make it
static.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoMove diff.renamelimit out of default configuration.
Junio C Hamano [Tue, 22 Nov 2005 06:52:37 +0000 (22:52 -0800)]
Move diff.renamelimit out of default configuration.

Otherwise we would end up linking all the unneeded stuff into git-daemon
only to link with git_default_config.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agomax-count in terms of intersection
Luben Tuikov [Fri, 18 Nov 2005 21:29:04 +0000 (16:29 -0500)]
max-count in terms of intersection

When a path designation is given, max-count counts the number
of commits therein (intersection), not globally.

This avoids the case where in case path has been inactive
for the last N commits, --max-count=N and path designation
at git-rev-list is given, would give no commits.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoGIT: Fix compilation error in connect.c
YOSHIFUJI Hideaki / 吉藤英明 [Tue, 22 Nov 2005 03:18:23 +0000 (12:18 +0900)]
GIT: Fix compilation error in connect.c

Fix compilation error for gcc-2.95.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agoIntroduce $(ALL_PROGRAMS) for 'all:' and 'install:' to operate on.
Andreas Ericsson [Mon, 21 Nov 2005 23:44:15 +0000 (00:44 +0100)]
Introduce $(ALL_PROGRAMS) for 'all:' and 'install:' to operate on.

Remove $(SIMPLE_PROGRAMS) from $(PROGRAMS) so buildrules don't have
to be overridden.

Put $(SCRIPTS) with the other target-macros so it doesn't get lonely.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years agorename/copy score parsing updates.
H. Peter Anvin [Mon, 21 Nov 2005 22:17:12 +0000 (14:17 -0800)]
rename/copy score parsing updates.

Better variant, which handles stuff like "4.5%" and rejects
"192.168.0.1".  Additionally, make sure numbers are unsigned (I'm making
them unsigned long just for the hell of it), to make sure that
artificial wraparound scenarios don't cause harm.

-hpa

[jc: with this, -M100 changes its meaning back to 10%.  People
wanting to say "pure renames only" should now say -M100% or
-M1.0; sounds a bit like an earthquake, but arguably things are
more consistent this way ;-)]

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