1
0
mirror of https://github.com/git/git.git synced 2024-09-30 11:21:24 +02:00
Commit Graph

2480 Commits

Author SHA1 Message Date
Junio C Hamano
80b1e511d7 diff: --full-index
A new option, --full-index, is introduced to diff family.  This
causes the full object name of pre- and post-images to appear on
the index line of patch formatted output, to be used in
conjunction with --allow-binary-replacement option of git-apply.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 16:20:40 -08:00
Junio C Hamano
011f4274bb apply: allow-binary-replacement.
A new option, --allow-binary-replacement, is introduced.

When you feed a diff that records full SHA1 name of pre- and
post-image blob on its index line to git-apply with this option,
the post-image blob replaces the path if what you have in the
working tree matches the pre-image _and_ post-image blob is
already available in the object directory.

Later we _might_ want to enhance the diff output to also include
the full binary data of the post-image, to make this more
useful, but this is good enough for local rebasing application.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 16:20:40 -08:00
Junio C Hamano
0c15cc921a git-am: --resolved.
After failed patch application, you can manually apply the patch
(this includes resolving the conflicted merge after git-am falls
back to 3-way merge) and run git-update-index on necessary paths
to prepare the index file in a shape a successful patch
application should have produced.  Then re-running git-am --resolved
would record the resulting index file along with the commit log
information taken from the patch e-mail.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 16:19:11 -08:00
Junio C Hamano
92927ed0aa git-apply: fail if a patch cannot be applied.
Recently we fixed 'git-apply --stat' not to barf on a binary
differences.  But it accidentally broke the error detection when
we actually attempt to apply them.

This commit fixes the problem and adds test cases.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 14:12:56 -08:00
Kevin Geiss
5b4525eb8b git-cvsexportcommit.perl: fix typos in output
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:20:59 -08:00
Kevin Geiss
8b3fbeef39 git-cvsexportcommit.perl: exit with non-0 status if patch fails.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:20:59 -08:00
Kevin Geiss
ebdbfa8b55 git-cvsexportcommit.perl: use getopts to get binary flags
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:20:58 -08:00
Kevin Geiss
0ff2ce9d8a git-cvsexportcommit.perl: Fix usage() output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:20:58 -08:00
Alecs King
565cb99114 Documentation/git-log.txt: trivial typo fix.
Signed-off-by: Alecs King <alecsk@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:19:37 -08:00
Pavel Roskin
8366a10ab2 symref support for import scripts
Fix git import script not to assume that .git/HEAD is a symlink.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:19:18 -08:00
Linus Torvalds
c0c35d5e41 Disallow empty pattern in "git grep"
For some reason I've done a "git grep" twice with no pattern, which is
really irritating, since it just grep everything. If I actually wanted
that, I could do "git grep ^" or something.

So add a "usage" message if the pattern is empty.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 13:17:46 -08:00
Junio C Hamano
7dbc2c0402 git wrapper: basic fixes.
Updates to fix the nits found during the list discussion.

 - Lose PATH_TO_MAN; just rely on execlp() to find whereever the
   "man" command is installed.

 - Do not randomly chdir(), but concatenate to the current
   working directory only if the given path is not absolute.

 - Lose use of glob(); read from exec_path and do sorting
   ourselves -- it is not that much more work.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 23:13:30 -08:00
Johannes Schindelin
ad4f4daae8 Give python a chance to find "backported" modules
python 2.2.1 is perfectly capable of executing git-merge-recursive,
provided that it finds heapq and sets. All you have to do is to steal
heapq.py and sets.py from python 2.3 or newer, and drop them in your
GIT_PYTHON_PATH.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 22:10:59 -08:00
Johannes Schindelin
a0fa2a10b4 Fix tests with new git in C
GIT_EXEC_PATH *has* to be set.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 22:10:58 -08:00
Lukas Sandström
1a41e743c6 Fix llist_sorted_difference_inplace in git-pack-redundant
Simplify and actually make llist_sorted_difference_inplace work
by using llist_sorted_remove instead of duplicating parts of the
code.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 21:19:56 -08:00
Andreas Ericsson
97fc6c5fba git --help COMMAND brings up the git-COMMAND man-page.
It's by design a bit stupid (matching ^git rather than ^git-), so as
to work with 'gitk' and 'git' as well.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 16:03:00 -08:00
Andreas Ericsson
cb22bc4447 Update git(7) man-page for the C wrapper.
The program 'git' now has --exec-path which needs explaining.

Renamed old "DESCRIPTION" to "CORE GIT COMMANDS" to make room for
"OPTIONS" while following follow some sort of convention.

Also updated AUTHORS section to pat my own back a bit.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 16:02:59 -08:00
Andreas Ericsson
8e49d50388 C implementation of the 'git' program, take two.
This patch provides a C implementation of the 'git' program and
introduces support for putting the git-* commands in a directory
of their own. It also saves some time on executing those commands
in a tight loop and it prints the currently available git commands
in a nicely formatted list.

The location of the GIT_EXEC_PATH (name discussion's closed, thank gods)
can be obtained by running

	git --exec-path

which will hopefully give porcelainistas ample time to adapt their
heavy-duty loops to call the core programs directly and thus save
the extra fork() / execve() overhead, although that's not really
necessary any more.

The --exec-path value is prepended to $PATH, so the git-* programs
should Just Work without ever requiring any changes to how they call
other programs in the suite.

Some timing values for 10000 invocations of git-var >&/dev/null:
	git.sh: 24.194s
	git.c:   9.044s
	git-var: 7.377s

The git-<tab><tab> behaviour can, along with the someday-to-be-deprecated
git-<command> form of invocation, be indefinitely retained by adding
the following line to one's .bash_profile or equivalent:

	PATH=$PATH:$(git --exec-path)

Experimental libraries can be used by either setting the environment variable
GIT_EXEC_PATH, or by using

	git --exec-path=/some/experimental/exec-path

Relative paths are properly grok'ed as exec-path values.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 16:02:57 -08:00
Junio C Hamano
c0bbbb1ba9 sha1_file.c::add_packed_git(): fix type mismatch.
An object name is 20-byte 'unsigned char', not 'char'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 15:08:28 -08:00
Junio C Hamano
3299c6f6a8 diff: make default rename detection limit configurable.
A while ago, a rename-detection limit logic was implemented as a
response to this thread:

	http://marc.theaimsgroup.com/?l=git&m=112413080630175

where gitweb was found to be using a lot of time and memory to
detect renames on huge commits.  git-diff family takes -l<num>
flag, and if the number of paths that are rename destination
candidates (i.e. new paths with -M, or modified paths with -C)
are larger than that number, skips rename/copy detection even
when -M or -C is specified on the command line.

This commit makes the rename detection limit easier to use.  You
can have:

	[diff]
		renamelimit = 30

in your .git/config file to specify the default rename detection
limit.  You can override this from the command line; giving 0
means 'unlimited':

	git diff -M -l0

We might want to change the default behaviour, when you do not
have the configuration, to limit it to say 20 paths or so.  This
would also help the diffstat generation after a big 'git pull'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 15:08:27 -08:00
Johannes Schindelin
f8348be3be Add config variable core.symrefsonly
This allows you to force git to avoid symlinks for refs. Just add
something like

	[core]
		symrefsonly = true

to .git/config.

Don´t forget to "git checkout your_branch", or it does not do anything...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 11:42:29 -08:00
Sergey Vlasov
4a4e6fd74f Rework object refs tracking to reduce memory usage
Store pointers to referenced objects in a variable sized array instead
of linked list.  This cuts down memory usage of utilities which use
object references; e.g., git-fsck-objects --full on the git.git
repository consumes about 2 MB of memory tracked by Massif instead of
7 MB before the change.  Object refs are still the biggest consumer of
memory (57%), but the malloc overhead for a single block instead of a
linked list is substantially smaller.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 11:42:29 -08:00
Sergey Vlasov
545f229a4b git-fsck-objects: Free tree entries after use
The Massif tool of Valgrind revealed that parsed tree entries occupy
more than 60% of memory allocated by git-fsck-objects.  These entries
can be freed immediately after use, which significantly decreases
memory consumption.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 11:42:28 -08:00
Jonas Fonseca
a52e4ef877 Fix git(1) link to git-index-pack
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 11:42:28 -08:00
Junio C Hamano
cd0a781c38 Documentation: do not blindly run 'cat' .git/HEAD, or echo into it.
Many places in the documentation we still talked about reading
what commit is recorded in .git/HEAD or writing the new head
information into it, both assuming .git/HEAD is a symlink.  That
is not necessarily so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 01:31:04 -08:00
Petr Baudis
313c4714c5 Fix bunch of fd leaks in http-fetch
The current http-fetch is rather careless about fd leakage, causing
problems while fetching large repositories. This patch does not reserve
exhaustiveness, but I covered everything I spotted. I also left some
safeguards in place in case I missed something, so that we get to know,
sooner or later.

Reported by Becky Bruce <becky.bruce@freescale.com>.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 00:34:50 -08:00
Andreas Ericsson
bce8230d5d git-daemon: --inetd implies --syslog
Otherwise nothing is logged anywhere, which is a Bad Thing.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 00:19:32 -08:00
H. Peter Anvin
8b649e27dd git-core-foo -> git-foo, except the core package
This patch renames the tarball "git" rather than "git-core", and changes
the names of various packages from git-core-foo to git-foo.  git-core is
still the true core package; an empty RPM package named "git" pulls in
ALL the git packages -- this makes updates work correctly, and allows
"yum install git" to do the obvious thing.

It also renames the git-(core-)tk package to gitk.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 00:07:46 -08:00
Junio C Hamano
d7bba81575 Update topo-order test.
The recently we updated rev-list --topo-order to show the heads
in date order, but we had a test that expected to see the old
behaviour.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 18:15:30 -08:00
Alex Riesen
08db81a9f1 allow git-update-ref create refs with slashes in names
Make git-update-ref create references with slashes in them. git-branch
and git-checkout already support such reference names.

git-branch can use git-update-ref to create the references in a more
formal manner now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:32 -08:00
Nikolai Weibull
7acab8f167 Documentation nitpicking
This patch fixes some small problems with the documentation.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:32 -08:00
Nikolai Weibull
2db0bfbc04 Document a couple of missing command-line options.
This patch adds documentation to quite a few command-line options.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:32 -08:00
Nikolai Weibull
b2309b7019 Document the -n command-line option to git-unpack-objects
This patch documents the -n command-line option to git-unpack-objects,
as it was previously undocumented.

Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:32 -08:00
Junio C Hamano
9add69b1b1 apply: fix binary patch detection.
The comparison to find "Binary files " string was looking at a
wrong place when offset != 0.

Also, we may have the full 40-byte textual sha1 on the index
line; two off-by-one errors prevented it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 17:15:07 -08:00
Linus Torvalds
2ed02887bd Fix git-rev-list "date order" with --topo-order
This fixes git-rev-list so that when there are multiple branches, we still
sort the heads in proper approximate date order even when sorting the
output topologically.

This makes things like

	gitk --all -d

work sanely and show the branches in date order (where "date order" is
obviously modified by the paren-child dependency requirements of the
topological sort).

The trivial fix is to just build the "work" list in date order rather than
inserting the new work entries at the beginning.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 14:16:38 -08:00
Andreas Ericsson
d4072c9722 git-branch: Mention -d and -D in man-page.
Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 14:16:37 -08:00
Junio C Hamano
b6ebac9e43 Merge branch 'svnup' of http://netz.smurf.noris.de/git/git
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 13:50:05 -08:00
Matthias Urlichs
0f3f5e3f69 Depend on asciidoc 7 (at least). 2005-11-14 17:41:31 +01:00
Josef Weidendorfer
1331df8781 Remove git-rename. git-mv does the same
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 00:50:18 -08:00
Josef Weidendorfer
b0c698a6e4 Bugfix: stop if directory already exists
Fix a typo: We do not want to run the directory as command,
and want to terminate if the directory exists
Additionally, update the usage message

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 00:50:17 -08:00
Junio C Hamano
94d2331770 Separate LDFLAGS and CFLAGS.
Stuffing -L flag and friends meant for the linking phase into
ALL_CFLAGS is not right; honor LDFLAGS and introduce ALL_LDFLAGS
to separate them out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 00:26:49 -08:00
Junio C Hamano
6d5410d651 Merge branch 'svnup' of http://netz.smurf.noris.de/git/git 2005-11-14 00:25:48 -08:00
Matthias Urlichs
4b1ca25e42 Remove trailing slashes
SVN dies a messy death when passed a path with trailing slashes.
2005-11-14 08:31:00 +01:00
Junio C Hamano
0086e2c854 Rename lost+found to lost-found.
Because we use "lost-found" as the directory name to hold
dangling object names, it is confusing to call the command
git-lost+found, although it makes sense and is even cute ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 02:07:02 -08:00
Kai Ruemmler
abacbe4166 Fix compilation warnings in pack-redundant.c
This fixes compilation warnings where "%ld" was used to print values of
type size_t.

Signed-off-by: Kai Ruemmler <kai.ruemmler@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 02:00:36 -08:00
Junio C Hamano
ac0b86dadf Debian: build-depend on libexpat-dev.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 01:57:33 -08:00
Thomas Matysik
ba1dbb61ea Split gitk into seperate RPM package
I don't want to have to install x11-libs and all it's dependencies on
my headless machines, so this patch splits gitk out of the RPM.

The .deb already appears to have gitk split out.

Signed-off-by: Thomas Matysik <thomas@matysik.co.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 01:33:26 -08:00
Thomas Matysik
8614e92323 Add expat and expat-devel dependencies (for http-push) to RPM spec.
Signed-off-by: Thomas Matysik <thomas@matysik.co.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 01:32:21 -08:00
Nick Hengeveld
54a9ba0d44 Fix fd leak in http-fetch
Added a call to finish_request to clean up resources if the server
returned a 404 and there are no alternates left to try.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-12 23:43:11 -08:00
Nick Hengeveld
acc075a8ad Fix for multiple alternates requests in http-fetch
Stop additional alternates requests from starting if one is already in
progress.  This adds an optional callback which is processed after a slot
has finished running.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-12 23:43:11 -08:00