1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-17 14:34:49 +01:00
Commit graph

1762 commits

Author SHA1 Message Date
Junio C Hamano
19397b4521 Revert "[PATCH] plug memory leak in diff.c::diff_free_filepair()"
This reverts 068eac91ce commit.
2005-09-14 14:06:50 -07:00
Linus Torvalds
705a7148ba [PATCH] Fix alloc_filespec() initialization
This simplifies and fixes the initialization of a "diff_filespec" when
allocated.

The old code would not initialize "sha1_valid". Noticed by valgrind.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-14 13:57:34 -07:00
Junio C Hamano
c80522e30f Make merge comment git-pull makes for an octopus a bit prettier.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 23:49:55 -07:00
Junio C Hamano
2ba6c47be1 read-tree: fix bogus debugging statement.
We wanted to detect case #16 which should be rare, but botched the
case when some paths are missing, causing a segfault.  My fault.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 22:27:42 -07:00
Junio C Hamano
74376a6864 git-merge-recursive: Trivial RE fixes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 21:09:03 -07:00
Fredrik Kuivinen
daae669949 [PATCH] Use the 'die' function where it is appropriate.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 15:45:26 -07:00
Fredrik Kuivinen
6511cce24b [PATCH] Use a temporary index file when we merge the common ancestors.
With this change we can get rid of a call to 'git-update-index
--refresh'.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 15:45:25 -07:00
Fredrik Kuivinen
87a71b65ac [PATCH] Adjust git-merge-recursive.py for the new tool names.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 15:45:25 -07:00
Fredrik Kuivinen
0d214b6619 [PATCH] Don't output 'Automatic merge failed, ...'
git-merge.sh does this for us.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 15:45:24 -07:00
Fredrik Kuivinen
d9a23fa6f7 [PATCH] Be more like the 'resolve' strategy.
If there are non-mergeable changes leave the head contents in the
cache and update the working directory with the output from merge(1).

In the add/add and delete/modify conflict cases leave unmerged cache
entries in the index.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 15:45:23 -07:00
Junio C Hamano
ccfd3e9962 [PATCH] Define relative .git/objects/info/alternates semantics.
An entry in the alternates file can name a directory relative to
the object store it describes.  A typical linux-2.6 maintainer
repository would have "../../../torvalds/linux-2.6.git/objects" there,
because the subsystem maintainer object store would live in

    /pub/scm/linux/kernel/git/$u/$system.git/objects/

and the object store of Linus tree is in

    /pub/scm/linux/kernel/git/torvalds/linux-2.6.git/objects/

This unfortunately is different from GIT_ALTERNATE_OBJECT_DIRECTORIES
which is relative to the cwd of the running process, but there is no
way to make it consistent with the behaviour of the environment
variable.  The process typically is run in $system.git/ directory for
a naked repository, or one level up for a repository with a working
tree, so we just define it to be relative to the objects/ directory
to be different from either ;-).

Later, the dumb transport could be updated to read from info/alternates
and make requests for the repository the repository borrows from.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 13:39:23 -07:00
Junio C Hamano
a5cd85e084 Detect ls-remote failure properly.
The part that can fail is before the pipe, so we need to propagate the
error properly to the main process.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 13:39:06 -07:00
Fredrik Kuivinen
e4cf17ce0d [PATCH] Rename the 'fredrik' merge strategy to 'recursive'.
Otherwise we would regret when Fredrik comes up with another merge
algorithm with different pros-and-cons with the current one.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 00:20:54 -07:00
Junio C Hamano
f88ed172e7 Fix off-by-one error in git-merge
'git-merge -s' without a strategy name does not fail and does
not give usage as it should.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 22:52:52 -07:00
Junio C Hamano
22c67ca88e Propagate errors from fetch-pack correctly to git-fetch.
When git-fetch-pack fails, the command does not notice the failure
and instead pretended nothing was fetched and there was nothing wrong.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 22:52:52 -07:00
Junio C Hamano
365527adbf Fix CDPATH problem.
CDPATH has two problems:

 * It takes scripts to unexpected places (somebody had
   CDPATH=..:../..:$HOME and the "cd" in git-clone.sh:get_repo_base
   took him to $HOME/.git when he said "clone foo bar" to clone a
   repository in "foo" which had "foo/.git").  CDPATH mechanism does
   not implicitly give "." at the beginning of CDPATH, which is
   the most irritating part.

 * The extra echo when it does its thing confuses scripts further.

Most of our scripts that use "cd" includes git-sh-setup so the problem
is primarily fixed there.  git-clone starts without a repository, and
it needs its own fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 22:52:51 -07:00
Junio C Hamano
2aba319a52 Document git-grep and link it from the main git(7) page.
Also adjust missing description in the git.txt page while we are at it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 19:39:15 -07:00
Junio C Hamano
7f88c8463c [PATCH] Make 'git checkout' a bit more forgiving when switching branches.
If you make a commit on a path, and then make the path
cache-dirty afterwards without changing its contents, 'git
checkout' to switch to another branch is prevented because
switching the branches done with 'read-tree -m -u $current
$next' detects that the path is cache-dirty, but it does not
bother noticing that the contents of the path has not been
actualy changed.

Since switching branches would involve checking out paths
different in the two branches, hence it is reasonably expensive
operation, we can afford to run update-index before running
read-tree to reduce this kind of false change from triggering
the check needlessly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 19:15:03 -07:00
Junio C Hamano
4a5b63e3e9 [PATCH] Omit patches that have already been merged from format-patch output.
This switches the logic to pick which commits to include in the output
from git-rev-list to git-cherry; as a side effect, 'format-patch ^up mine'
would stop working although up..mine would continue to work.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 19:15:02 -07:00
Horst von Brand
663a5ed5ca [PATCH] There are several undocumented dependencies
There are several undocumented dependencies in the .spec and in the
INSTALL files. The following is from Fedora, perhaps other RPM
distributions call the packages differently.

Also, the manpages aren't always installed gzipped.

Updates to git-core.spec.in file:
 - Some git scripts use Perl
 - gitk needs wish, which is part of TCL/Tk.
 - curl is used all over
 - Need the ssh program from openssh-clients

Updates to INSTALL:
 - Mention wish
 - Mention ssh

Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
2005-09-12 19:15:02 -07:00
Linus Torvalds
5d9d831a51 Improve "git grep" flags handling
This allows any arbitrary flags to "grep", and knows about the few
special grep flags that take an argument too.

It also allows some flags for git-ls-files, although their usefulness
is questionable.

With this, something line

	git grep -w -1 pattern

works, without the script enumerating every possible flag.

[jc: this is the version Linus sent out after I showed him a
 barf-o-meter test version that avoids shell arrays.  He must
 have typed this version blindly, since he said:

    I'm not barfing, but that's probably because my brain just shut
    down and is desperately trying to gouge my eyes out with a spoon.

 I slightly fixed it to catch the remaining arguments meant to be
 given git-ls-files.]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 19:15:02 -07:00
Fredrik Kuivinen
4e48fe3f1c [PATCH] Make the ProgramError class printable.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 14:54:00 -07:00
Fredrik Kuivinen
206e587cb8 [PATCH] Make sure we die if we don't get enough arguments.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 14:53:59 -07:00
Fredrik Kuivinen
654291a2ac [PATCH] Introduce a 'die' function.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 14:53:58 -07:00
Fredrik Kuivinen
ace36858d3 [PATCH] Exit with status code 2 if we get an exception.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 14:53:57 -07:00
Fredrik Kuivinen
8ceba720ba [PATCH] Fix assertion failure when merging common ancestors.
Bug reported by Junio.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 14:53:55 -07:00
Junio C Hamano
540bf654d0 Allow finding things that begin with a dash in 'git grep'
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 13:24:55 -07:00
Linus Torvalds
f22cc3fcbf [PATCH] Add "git grep" helper
Very convenient shorthand for

	git-ls-files [file-patterns] | xargs grep <pattern>

which I tend to do all the time.

Yes, it's trivial, but it's really nice. I can do

	git grep '\<some_variable\>' arch/i386 include/asm-i386

and it does exactly what you'd think it does. And since it just uses the
normal git-ls-files file patterns, you can do things like

	git grep something 'include/*.h'

and it will search all header files under the include/ subdirectory.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 13:20:03 -07:00
Linus Torvalds
ba8a4970c7 [PATCH] Add note about IANA confirmation
The git port (9418) is officially listed by IANA now.

So document it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 13:19:53 -07:00
Junio C Hamano
7fa090844f Use int instead of socklen_t
This should work around the compilation problem Johannes Schindelin
and others had on Mac OS/X.

Quoting Linus:

    Any operating system where socklen_t is anything else than "int" is
    terminally broken. The people who introduced that typedef were confused,
    and I actually had to argue with them that it was fundamentally wrong:
    there is no other valid type than "int" that makes sense for it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 18:55:20 -07:00
Herbert Xu
65a9289d7e [PATCH] Apply N -> A status change in diff-helper
When the git diff status 'N' was changed to 'A', diff-helper.c was
not updated accordingly.  This means that it no longer shows the
diff for newly added files.

This patch makes that change in diff-helper.c.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 18:53:07 -07:00
martin@catalyst.net.nz
127bf00f7d [PATCH] archimport - better handling of temp dirs
Switched from backwards hard-coded tmp directory creation to using
File::Temp::tempdir() to create the directory inside $TMP_PATH or
what the user has provided via the -t parameter.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:57 -07:00
martin@catalyst.net.nz
1d4710d06c [PATCH] archimport - use GIT_DIR instead of hardcoded ".git"
Use GIT_DIR from the environment instead of a hardcoded '.git' string.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:56 -07:00
martin@catalyst.net.nz
241b59675f [PATCH] archimport - update in-script doco, options tidyup
Updated the usage/help message to match asciidoc documentation. The perldoc
documentation now includes the first paragraph from the asciidoc documentation
and points users to the manpage.

Updated TODO section.

Removed some redundant options from the getopt() invocation.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:54 -07:00
martin@catalyst.net.nz
a5c500b76c [PATCH] archimport documentation tidyup
New "merges" headline, clarified some parts that were not easy to understand.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:51 -07:00
martin@catalyst.net.nz
a4c5f9aab7 [PATCH] archimport documentation update
Updated and expanded the command description, and added a reference of the
command line options.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:48 -07:00
Yasushi SHOJI
e1ccf53a60 [PATCH] Escape asciidoc's built-in em-dash replacement
AsciiDoc replace '--' with em-dash (&#8212) by default. em-dash
looks a lot like a single long dash and it's very confusing when
we are talking about command options.

Section 21.2.8 'Replacements' of AsciiDoc's User Guide says that a
backslash in front of double dash prevent the replacement.  This
patch does just that.

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:36 -07:00
Qingning Huo
2c865d9aa7 [PATCH] Fix buffer overflow in ce_flush().
Add a check before appending SHA1 signature to write_buffer,
flush it first if necessary.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-11 10:51:13 -07:00
Junio C Hamano
720d150c48 Add a new merge strategy by Fredrik Kuivinen.
I really wanted to try this out, instead of asking for an adjustment
to the 'git merge' driver and waiting.  For now the new strategy is
called 'fredrik' and not in the list of default strategies to be tried.

The script wants Python 2.4 so this commit also adjusts Debian and RPM
build procecure files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 19:46:53 -07:00
Junio C Hamano
0f69be5376 'git-merge': Documentation.
... and add link from git.txt, as usual.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:30:42 -07:00
Junio C Hamano
2276aa6c09 Use Daniel's read-tree in the merge strategy 'resolve'.
And rename the one Linus kept calling stupid, 'stupid'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:30:41 -07:00
Junio C Hamano
91063bbc6c Multi-backend merge driver.
The new command 'git merge' takes the current head and one or more
remote heads, with the commit log message for the automated case.

If the heads being merged are simple fast-forwards, it acts the
same way as the current 'git resolve'.  Otherwise, it tries
different merge strategies and takes the result from the one that
succeeded auto-merging, if there is any.

If no merge strategy succeeds auto-merging, their results are
evaluated for number of paths needed for hand resolving, and the
one with the least number of such paths is left in the working
tree.  The user is asked to resolve them by hand and make a
commit manually.

The calling convention from the 'git merge' driver to merge
strategy programs is very simple:

 - A strategy program is to be called 'git-merge-<strategy>'.

 - They take input of this form:

	<common1> <common2> ... '--' <head> <remote1> <remote2>...

   That is, one or more the common ancestors, double dash, the
   current head, and one or more remote heads being merged into
   the current branch.

 - Before a strategy program is called, the working tree is
   matched to the current <head>.

 - The strategy program exits with status code 0 when it
   successfully auto-merges the given heads.  It should do
   update-cache for all the merged paths when it does so -- the
   index file will be used to record the merge result as a
   commit by the driver.

 - The strategy program exits with status code 1 when it leaves
   conflicts behind.  It should do update-cache for all the
   merged paths that it successfully auto-merged, and leave the
   cache entry in the index file as the same as <head> for paths
   it could not auto-merge, and leave its best-effort result
   with conflict markers in the working tree when it does so.

 - The strategy program exists with status code other than 0 or
   1 if it does not handle the given merge at all.

As examples, this commit comes with merge strategies based on
'git resolve' and 'git octopus'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:30:41 -07:00
Junio C Hamano
bb97a2a804 Plug leak in Daniel's read-tree.
... and it is ready to be pushed out in the "master" branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:42 -07:00
Junio C Hamano
4d3fe0c5f3 [PATCH] Add debugging help for case #16 to read-tree.c
This will help us detect if real-world example merges have multiple
merge-base candidates and one of them matches one head while another
matches the other head.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:42 -07:00
Junio C Hamano
2ab706a38f [PATCH] Disable debugging from read-tree.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:42 -07:00
Daniel Barkalow
3d89cb4f3f [PATCH] Document the trivial merge rules for 3(+more ancestors)-way merges.
Signed-off-by: Daniel Barkalow
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:41 -07:00
Daniel Barkalow
ee6566e8d7 [PATCH] Rewrite read-tree
Adds support for multiple ancestors, removes --emu23, much simplification.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:41 -07:00
Daniel Barkalow
680bab3d9a [PATCH] Add function to append to an object_list.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:40 -07:00
Daniel Barkalow
77675e2aff [PATCH] Add a function for getting a struct tree for an ent.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:40 -07:00
Junio C Hamano
c9d023b2a6 Fix 'git-show-branch --list <head>'
It mistakenly failed to output anything when given a single head.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:27:20 -07:00