summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-07-13Add a new test for git-merge-resolveLibravatar Miklos Vajna1-0/+46
Actually this is a simple test, just to ensure merge-resolve properly calls read-tree. read-tree itself already has more complex tests. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13t6021: add a new test for git-merge-resolveLibravatar Miklos Vajna1-0/+4
It should fail properly if there are multiple merge bases, but there were no test for this till now. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-10Teach merge.log to "git-merge" againLibravatar Junio C Hamano2-0/+9
The command forgot the configuration variable when rewritten in C. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-07Build in mergeLibravatar Miklos Vajna6-2/+1157
Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-06Fix t7601-merge-pull-config.sh on AIXLibravatar Miklos Vajna1-7/+7
The test failed on AIX (and likely other OS, such as apparently OSX) where wc -l outputs whitespace. Also, avoid unnecessary eval in conflict_count(). Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-06git-commit-tree: make it usable from other builtinsLibravatar Miklos Vajna2-30/+45
Move all functionality (except option parsing) from cmd_commit_tree() to commit_tree(), so that other builtins can use it without a child process. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-06Add new test case to ensure git-merge prepends the custom merge messageLibravatar Miklos Vajna1-0/+37
There was no test for this before, so the testsuite passed, even in case the merge summary was missing from the merge commit message. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Add new test case to ensure git-merge reduces octopus parents when possibleLibravatar Miklos Vajna1-0/+63
The old shell version used show-branch --independent to filter for the ones that cannot be reached from any other reference. The new C version uses reduce_heads() from commit.c for this, so add test to ensure it works as expected. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Introduce reduce_heads()Libravatar Junio C Hamano2-0/+47
The new function reduce_heads() is given a list of commits, and removes ones that can be reached from other commits in the list. It is useful for reducing the commits randomly thrown at the git-merge command and remove redundant commits that the user shouldn't have given to it. The implementation uses the get_merge_bases_many() introduced in the previous commit. If the merge base between one commit taken from the list and the remaining commits is the commit itself, that means the commit is reachable from some of the other commits. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Introduce get_merge_bases_many()Libravatar Junio C Hamano1-18/+38
This introduces a new function get_merge_bases_many() which is a natural extension of two commit merge base computation. It is given one commit (one) and a set of other commits (twos), and computes the merge base of one and a merge across other commits. This is mostly useful to figure out the common ancestor when iterating over heads during an octopus merge. When making an octopus between commits A, B, C and D, we first merge tree of A and B, and then try to merge C with it. If we were making pairwise merge, we would be recording the tree resulting from the merge between A and B as a commit, say M, and then the next round we will be computing the merge base between M and C. o---C...* / . o---B...M / . o---o---A But during an octopus merge, we actually do not create a commit M. In order to figure out that the common ancestor to use for this merge, instead of computing the merge base between C and M, we can call merge_bases_many() with one set to C and twos containing A and B. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Add new test to ensure git-merge handles more than 25 refs.Libravatar Miklos Vajna1-0/+52
The old shell version handled only 25 refs but we no longer have this limitation. Add a test to make sure this limitation will not be introduced again in the future. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Introduce get_octopus_merge_bases() in commit.cLibravatar Miklos Vajna2-0/+28
This is like get_merge_bases() but it works for multiple heads, like show-branch --merge-base. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30git-fmt-merge-msg: make it usable from other builtinsLibravatar Miklos Vajna2-66/+92
Move all functionality (except config and option parsing) from cmd_fmt_merge_msg() to fmt_merge_msg(), so that other builtins can use it without a child process. All functions have been changed to use strbufs, and now only cmd_fmt_merge_msg() reads directly from a file / writes anything to stdout. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Move read_cache_unmerged() to read-cache.cLibravatar Miklos Vajna3-24/+33
builtin-read-tree has a read_cache_unmerged() which is useful for other builtins, for example builtin-merge uses it as well. Move it to read-cache.c to avoid code duplication. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Add new test to ensure git-merge handles pull.twohead and pull.octopusLibravatar Miklos Vajna1-0/+129
Test if the given strategies are used and test the case when multiple strategies are configured using a space separated list. Also test if the best strategy is picked if none is specified. This is done by adding a simple test case where recursive detects a rename, but resolve does not, and verify that finally merge will pick up the previous. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Move parse-options's skip_prefix() to git-compat-util.hLibravatar Miklos Vajna3-19/+32
builtin-remote.c and parse-options.c both have a skip_prefix() function, for the same purpose. Move parse-options's one to git-compat-util.h and let builtin-remote use it as well. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Move commit_list_count() to commit.cLibravatar Miklos Vajna3-8/+9
This function is useful outside builtin-merge-recursive, for example in builtin-merge. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Move split_cmdline() to alias.cLibravatar Miklos Vajna3-53/+55
split_cmdline() is currently used for aliases only, but later it can be useful for other builtins as well. Move it to alias.c for now, indicating that originally it's for aliases, but we'll have it in libgit this way. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30Merge branch 'maint'Libravatar Junio C Hamano1-1/+4
* maint: doc/rev-parse: clarify reflog vs --until for specifying revisions
2008-06-30Add test results directory to t/.gitignoreLibravatar Brian Gernhardt1-0/+1
We don't need test results to be committed if we're fixing a test. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29doc/rev-parse: clarify reflog vs --until for specifying revisionsLibravatar Jeff King1-1/+4
The rev-parse manpage introduces the branch@{date} syntax, and mentions the reflog specifically. However, new users may not be familiar with the distinction between the reflog and the commit date, so let's help them out with a "you may be interested in --until" pointer. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29Update draft release notes for 1.6.0Libravatar Junio C Hamano1-16/+24
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29Documentation: don't assume git-sh-setup and git-parse-remote are in PATHLibravatar jrnieder@uchicago.edu2-2/+2
When git-parse-remote and git-sh-setup are not installed in $(bindir) anymore, the shell script library won't be found on user's $PATH in general. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29t9700: skip when Test::More is not availableLibravatar Junio C Hamano1-0/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28Merge branch 'maint'Libravatar Junio C Hamano4-15/+10
* maint: git-svn: don't sanitize remote names in config git-svn: avoid filling up the disk with temp files. git cat-file: Fix memory leak in batch mode fix git config example syntax avoid off-by-one error in run_upload_archive
2008-06-28git-svn: don't sanitize remote names in configLibravatar Eric Wong1-12/+3
The original sanitization code was just taken from the remotes2config.sh shell script in contrib. Credit to Avery Pennarun for noticing this mistake, and Junio for clarifying the rules for config section names: Junio C Hamano wrote in <7vfxr23s6m.fsf@gitster.siamese.dyndns.org>: > In > > [foo "bar"] baz = value > > foo and baz must be config.c::iskeychar() (and baz must be isalpha()), but > "bar" can be almost anything. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28show_stats(): fix stats width calculationLibravatar Olivier Marin1-6/+6
Before this patch, name_width becomes negative or null for width values less than 15 and name_width values greater than 25 (default: 50). This leads to output random data. This patch checks for minimal width and name_width values. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28Documentation: remove {show,whatchanged}.difftree config optionsLibravatar Olivier Marin2-10/+0
This removes, from the documentation and the bash completion script, the two config options that were introduced by the git-whatchanged.sh script and lost in the C rewrite. Today, we can use aliases as an alternative. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28git-svn: avoid filling up the disk with temp files.Libravatar Avery Pennarun1-1/+4
Commit ffe256f9bac8a40ff751a9341a5869d98f72c285 ("git-svn: Speed up fetch") introduced changes that create a temporary file for each object fetched by svn. These files should be deleted automatically, but perl apparently doesn't do this until the process exits (or perhaps when its garbage collector runs). This means that on a large fetch, especially with lots of branches, we sometimes fill up /tmp completely, which prevents the next temp file from being written completely. This is aggravated by the fact that a new temp file is created for each updated file, even if that update produces a file identical to one already in git. Thus, it can happen even if there's lots of disk space to store the finished repository. We weren't adequately checking for write errors, so this would result in an invalid file getting committed, which caused git-svn to fail later with an invalid checksum. This patch adds a check to syswrite() so similar problems don't lead to corruption in the future. It also unlink()'s each temp file explicitly when we're done with it, so the disk doesn't need to fill up. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Tested-by: Björn Steinbrink <B.Steinbrink@gmx.de> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28git cat-file: Fix memory leak in batch modeLibravatar Björn Steinbrink1-0/+1
When run in batch mode, git cat-file never frees the memory for the blob contents it is printing. This quickly adds up and causes git-svn to be hardly usable for imports of large svn repos, because it uses cat-file in batch mode and cat-file's memory usage easily reaches several hundred MB without any good reason. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28fix git config example syntaxLibravatar Joey Hess1-1/+1
git-config expects a space, not '=' between option and value. Also, quote the value since it contains globs, which some shells will not pass through unchanged, or will abort if the glob doesn't expand. Signed-off-by: Joey Hess <joey@kitenet.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28avoid off-by-one error in run_upload_archiveLibravatar Jochen Voss1-1/+1
Make sure that buf has enough space to store the trailing \0 of the command line argument, too. Signed-off-by: Jochen Voss <voss@seehuhn.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28GIT-VERSION-GEN: do not fail if a 'HEAD' file exists in the working copyLibravatar Lea Wiemann1-1/+1
Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27commit-tree: lift completely arbitrary limit of 16 parentsLibravatar Johannes Schindelin1-23/+20
There is no really good reason to have a merge with more than 16 parents, but we have a history of giving our users rope. Combined with the fact that there was no good reason for that arbitrary limit in the first place, here is an all-too-easy to fix. Kind of wished-for by Len Brown. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27shrink git-shell by avoiding redundant dependenciesLibravatar Dmitry Potapov6-68/+79
A lot of modules that have nothing to do with git-shell functionality were linked in, bloating git-shell more than 8 times. This patch cuts off redundant dependencies by: 1. providing stubs for three functions that make no sense for git-shell; 2. moving quote_path_fully from environment.c to quote.c to make the later self sufficient; 3. moving make_absolute_path into a new separate file. The following numbers have been received with the default optimization settings on master using GCC 4.1.2: Before: text data bss dec hex filename 143915 1348 93168 238431 3a35f git-shell After: text data bss dec hex filename 17670 788 8232 26690 6842 git-shell Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27help: check early if we have a command, if not try a documentation topicLibravatar Christian Couder1-8/+14
Before this patch, something like "git help tutorial" did not work, people had to use "git help gittutorial" which is not very intuitive. This patch uses the "is_git_command" function to test early if the argument passed to "git help" is a git command, and if this is not the case then we prefix the argument with "git" instead of "git-". This way, things like "git help tutorial" or "git help glossary" will work fine. The little downside of this patch is that the "is_git_command" is a little bit slow. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-27Document the double-dash "rev -- path" disambiguatorLibravatar Junio C Hamano1-4/+33
This is a very well established command line convention that old residents of the git mailing list knew by heart and nobody even thought about documenting it explicitly, which was not very nice. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Don't use dash commands (git-foo) in tutorial-2Libravatar Ted Percival1-5/+5
Signed-off-by: Ted Percival <ted@midg3t.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26test-lib.sh: show git init output when in verbose modeLibravatar Lea Wiemann1-1/+1
Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Merge branch 'maint'Libravatar Junio C Hamano5-7/+80
* maint: GIT 1.5.5.5 GIT 1.5.4.6 git-shell: accept "git foo" form diff --check: do not discard error status upon seeing a good line
2008-06-26Merge branch 'maint-1.5.5' into maintLibravatar Junio C Hamano3-4/+67
* maint-1.5.5: GIT 1.5.5.5 GIT 1.5.4.6 git-shell: accept "git foo" form Conflicts: GIT-VERSION-GEN RelNotes
2008-06-26GIT 1.5.5.5Libravatar Junio C Hamano3-2/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Merge branch 'maint-1.5.4' into maint-1.5.5Libravatar Junio C Hamano2-4/+56
* maint-1.5.4: GIT 1.5.4.6 git-shell: accept "git foo" form Conflicts: GIT-VERSION-GEN RelNotes
2008-06-26GIT 1.5.4.6Libravatar Junio C Hamano3-2/+45
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26git-shell: accept "git foo" formLibravatar Junio C Hamano1-4/+13
This is a backport of 0a47dc110e042b5bcc63dc94c8d517e67efe9306 to 'maint' to be included in 1.5.6.2 so that older server side can accept dashless form of request when clients are updated. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26diff --check: do not discard error status upon seeing a good lineLibravatar Junio C Hamano2-3/+13
"git diff --check" should return non-zero when there was any whitespace error but the code only paid attention to the error status of the last new line in the patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26improve for-each-ref test scriptLibravatar Jeff King1-17/+70
Previously, we did a sanity check by doing for-each-ref using each possible format atom. However, we never checked the actual output produced by that atom, which recently let an obvious bug go undetected for some time. While we're at it, also clean up a few '!' into test_must_fail. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Add 'git-p4.allowSubmit' to git-p4Libravatar Jing Xue1-0/+4
I'm working with a perforce repo using git-p4. There are some config files which I need to change locally according to my environment. I'm using a 'local' git branch to park these changes. And I want to avoid accidentally checking them into p4 just by doing "git p4 submit" mindlessly without realizing which branch I'm actually on. This patch adds a new git config, 'git-p4.allowSubmit', which is a whitelist of branch names. "git p4 submit" will only allow submissions from local branches on the list. Useful for preventing inadvertently submitting from a strictly local branch. For backward compatibility, if this config is not set at all, submissions from all branches are allowed. Signed-off-by: Jing Xue <jingxue@digizenstudio.com> Acked-By: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26Start draft release notes for 1.6.0Libravatar Junio C Hamano2-1/+106
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-25update-hook-example: optionally allow non-fast-forwardLibravatar Dmitry Potapov1-33/+53
Sometimes it is desirable to have non-fast-forward branches in a shared repository. A typical example of that is the 'pu' branch. This patch extends the format of allowed-users and allow-groups files by using the '+' sign at the beginning as the mark that non-fast-forward pushes are permitted to the branch. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>