summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-18merge-base --independent to print reduced parent list in a mergeLibravatar Jonathan Nieder3-7/+62
While show-branch --independent does not support more than MAX_REVS revs, git internally supports more with a different algorithm. Expose that functionality as "git merge-base --independent". This should help scripts to catch up with builtin merge in supporting dodecapus. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge-base --octopus to mimic show-branch --merge-baseLibravatar Jonathan Nieder3-10/+46
While show-branch --merge-base does not support more than MAX_REVS revs, git supports more with a different algorithm (v1.6.0-rc0~51^2~13, Introduce get_octopus_merge_bases() in commit.c, 2008-06-27). Expose that functionality. This should help scripts to catch up with builtin merge in supporting dodecapus. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18Documentation: add a SEE ALSO section for merge-baseLibravatar Jonathan Nieder1-0/+6
For example, a person reading the merge-base man page might wonder about the fastest way to check if one commit is an ancestor of another (which would require rev-list). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t6200 (fmt-merge-msg): style nitpicksLibravatar Jonathan Nieder1-160/+120
Guard setup with test_expect_success. Use test_might_fail instead of ignoring the exit code from git config --unset. Point out setup commands that are shared by multiple tests, to make it easy to write GIT_SKIP_TESTS specifications that work. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t6010 (merge-base): modernize styleLibravatar Jonathan Nieder1-143/+160
Guard setup with test_expect_success, put the opening quote starting each test on the same line as the test_expect_* invocation, and combine related actions into single tests. While at it: - use test_cmp instead of expr or test $foo = $bar, for more helpful output with -v when tests fail; - use test_commit for brevity. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t7600 (merge): test merge from branch yet to be bornLibravatar Jonathan Nieder1-0/+21
Some people like to "git fetch origin && merge origin/master" from the unborn branch provided when first initializing a repository. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t7600 (merge): check reflog entryLibravatar Jonathan Nieder1-1/+7
The details of the reflog message are not important, but including something sane in the reflog is. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t7600 (merge): do not launch gitk for --debugLibravatar Jonathan Nieder1-29/+29
Probably as a development aid, this test script runs gitk --all to allow the driver to inspect history between tests when run with --debug. As a result, running all tests with --debug requires closing a long series of gitk displays, one at a time. Use git log --graph --oneline instead. This way, the history is available for viewing with "git show" but the test script finishes without interaction. Longer term, it would be nice to have an option to run a user-specified command between tests. This patch does not do that. Cc: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t7600 (merge): modernize styleLibravatar Jonathan Nieder1-187/+101
Guard setup commands with test_expect_success, so they are easier to visually skip over and get to the good part. While at it: - use "printf '%s\n' a b ..." instead of "cat <<EOF" for test vectors with short lines; - use test_cmp instead of test foo = bar where possible, for better output with -v on failure; - do not go to extraordinary lengths to print a relevant message when test commands fail. There is a patch in flight that could be used to restore the nice error messages in a cleaner way. Cc: Lars Hjemli <hjemli@gmail.com> Cc: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge: do not mistake (ancestor of) tag for branchLibravatar Jonathan Nieder2-5/+13
If no branch 'foo' exists but a tag 'foo' does, then git merge foo^ results in Merge branch 'foo' (early part) as a commit message, because the relevant code path checks that refs/heads/foo is a valid refname for writing rather than for reading. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21Git 1.7.2Libravatar Junio C Hamano3-9/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21tests: correct "does reflog exist?" testsLibravatar Junio C Hamano2-49/+11
These two tests weren't about how "git reflog show <branch>" exits when there is no reflog, but were about "checkout" and "branch" create or not create reflog when creating a new <branch>. Update the tests to check what we are interested in, using "git rev-parse --verify". Also lose tests based on "test -f .git/logs/refs/heads/<branch>" from nearby, to avoid exposing this particular implementation detail unnecessarily. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21t/: work around one-shot variable assignment with test_must_failLibravatar Brandon Casey3-8/+40
See e2007832552ccea9befed9003580c494f09e666e Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21t/README: correct an exception when breaking a && chain in testsLibravatar Jonathan Nieder1-4/+4
The correct advice should have been taken from c289c31 (t/t7006: ignore return status of shell's unset builtin, 2010-06-02). A real-life issue we experienced was with "unset", not with "export" (exporting an unset variable may have similar portability issues, though). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20t/{t5541,lib-httpd}: replace problematic '!()' notation with test_must_failLibravatar Brandon Casey2-2/+2
The '!()' notation is interpreted as a pattern-list on Ksh. The Ksh man page describe it as follows: !(pattern-list) Matches anything except one of the given patterns. Ksh performs a file glob using the pattern-list and then tries to execute the first file in the list. If a space is added between the '!' and the open parens, then Ksh will not interpret it as a pattern list, but in this case, it is preferred to use test_must_fail, so lets do so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20t/t3700: convert two uses of negation operator '!' to use test_must_failLibravatar Brandon Casey1-2/+2
These two lines use the negation '!' operator to negate the result of a simple command. Since these commands do not contain any pipes or other complexities, the test_must_fail function can be used and is preferred since it will additionally detect termination due to a signal. This was noticed because the second use of '!' does not include a space between the '!' and the opening parens. Ksh interprets this as follows: !(pattern-list) Matches anything except one of the given patterns. Ksh performs a file glob using the pattern-list and then tries to execute the first file in the list. If a space is added between the '!' and the open parens, then Ksh will not interpret it as a pattern list, but in this case, it is preferred to use test_must_fail, so lets do so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20Merge branch 'maint'Libravatar Junio C Hamano2-2/+6
* maint: t/README: clarify test_must_fail description Check size of path buffer before writing into it Conflicts: t/README
2010-07-20t/README: clarify test_must_fail descriptionLibravatar Brandon Casey1-0/+8
Some have found the wording of the description to be somewhat ambiguous with respect to when it is desirable to use test_must_fail instead of "! <git-command>". Tweak the wording somewhat to hopefully clarify that it is _because_ test_must_fail can detect segmentation fault that it is desirable to use it instead of "! <git-command>". Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20Check size of path buffer before writing into itLibravatar Greg Brockman1-0/+2
This prevents a buffer overrun that could otherwise be triggered by creating a file called '.git' with contents gitdir: (something really long) Signed-off-by: Greg Brockman <gdb@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19Merge branch 'maint'Libravatar Junio C Hamano2-3/+10
* maint: update-server-info: Shorten read_pack_info_file() Documentation: Explain git-mergetool's use of temporary files
2010-07-19update-server-info: Shorten read_pack_info_file()Libravatar Ralf Thielow1-3/+0
The correct responses to a D and a T line in .git/objects/info/packs are the same, so combine their case arms. In both cases we already ‘goto’ out of the switch so while at it, remove a redundant ‘break’ to avoid yet another line of code. Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com> Reviewed-by: Jonathan Nieder <jrnieder <at> gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19git add: Add --ignore-missing to SYNOPSISLibravatar Ævar Arnfjörð Bjarmason1-1/+2
All the git add options were listed in the synopsis until the --ignore-missing option was added. Change that so that the git add documentation now has the complete listing. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19git submodule add: Remove old docs about implicit -fLibravatar Ævar Arnfjörð Bjarmason1-4/+0
git submodule add no longer implicitly adds with --force. Remove references to the old functionality in the documentation. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19git submodule add: Require the new --force option to add ignored pathsLibravatar Jens Lehmann3-15/+35
To make the behavior of "git submodule add" more consistent with "git add" ignored submodule paths should not be silently added when they match an entry in a .gitignore file. To be able to override that default behavior in the same way as we can do that for "git add", the new option "--force" is introduced. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19Merge branch 'jl/add-n-ignore-missing'Libravatar Junio C Hamano5-6/+47
* jl/add-n-ignore-missing: git add: Add the "--ignore-missing" option for the dry run
2010-07-19Documentation: Explain git-mergetool's use of temporary filesLibravatar David Aguilar1-0/+10
'git mergetool' creates '*.orig' backup files in its default configuration. Mention this in its documentation. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19git-svn: write memoized data explicitly to avoid Storable bugLibravatar Sergey Vlasov1-0/+16
Apparently using the Storable module during global destruction is unsafe - there is a bug which can cause segmentation faults: http://rt.cpan.org/Public/Bug/Display.html?id=36087 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482355 The persistent memoization support introduced in commit 8bff7c538 relied on global destruction to write cached data, which was leading to segfaults in some Perl configurations. Calling Memoize::unmemoize in the END block forces the cache writeout to be performed earlier, thus avoiding the bug. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-07-16Merge branch 'jc/diff-merge-base-multi'Libravatar Junio C Hamano1-13/+0
* jc/diff-merge-base-multi: diff A...B: do not limit the syntax too narrowly
2010-07-16Only run aggregate-results over actual countsLibravatar Thomas Rast2-2/+2
The current make target 'aggregate-results' scanned all files matching test-results/t*-*. Normally these are only the test counts (and the exit values, which are ignored), but with --tee the suite also dumps all output. Furthermore, with --verbose t1450 contains several lines starting with "broken link from ..." which matches the criteria used by aggregate-results.sh. Rename the counts output files to *.counts, and only scan those. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16Add a sample user for the svndump libraryLibravatar Jonathan Nieder4-0/+147
The svn-fe tool takes a Subversion dump file as input and produces a fast-import stream as output. This can be useful as a low-level tool in building other importers, or for debugging the vcs-svn library. make svn-fe make svn-fe.1 to test. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-16diff A...B: do not limit the syntax too narrowlyLibravatar Junio C Hamano1-13/+0
Earlier we tried to make sure that the trees we get are what A...B syntax produced, by checking that earlier ones are all marked uninteresting (which has to be true as they are merge bases), there are two remaining ones that are interesting, and they are marked as non-symmetric-left and symmetric-left respectively. The "the last two must be interesting" condition is however wrong when one is an ancestor of the other between A and B (i.e. fast-forward). In such a case, one of them is marked uninteresting.
2010-07-15Merge branch 'jn/paginate-fix'Libravatar Junio C Hamano2-46/+200
* jn/paginate-fix: git --paginate: paginate external commands again git --paginate: do not commit pager choice too early tests: local config file should be honored from subdirs of toplevel t7006: test pager configuration for several git commands t7006 (pager): introduce helper for parameterized tests Conflicts: t/t7006-pager.sh
2010-07-15Merge branch 'wp/merge-tree-fix'Libravatar Junio C Hamano2-1/+259
* wp/merge-tree-fix: merge-tree: fix where two branches share no changes add basic tests for merge-tree
2010-07-15Merge branch 'js/merge-rr-fix'Libravatar Junio C Hamano2-3/+3
* js/merge-rr-fix: MERGE_RR is in .git, not .git/rr-cache
2010-07-15Merge branch 'jc/diff-merge-base-multi'Libravatar Junio C Hamano1-8/+23
* jc/diff-merge-base-multi: diff A...B: give one possible diff when there are more than one merge-base
2010-07-15Merge branch 'ns/merge-recursive-uptodate'Libravatar Junio C Hamano1-1/+1
* ns/merge-recursive-uptodate: merge-recursive: use "up-to-date" instead of "uptodate" in error message for consistency
2010-07-15Merge branch 'jn/tests'Libravatar Junio C Hamano1-47/+42
* jn/tests: t3000 (ls-files -o): modernize style
2010-07-15Merge branch 'eb/doc-log-manpage'Libravatar Junio C Hamano1-6/+9
* eb/doc-log-manpage: Reorganize `git-log' man page to clarify common diff options.
2010-07-15Merge branch 'jn/grep-open'Libravatar Junio C Hamano2-0/+16
* jn/grep-open: grep -O: Do not pass color sequences as filenames to pager
2010-07-15Merge branch 'mg/revision-doc'Libravatar Junio C Hamano20-222/+257
* mg/revision-doc: Documentation: link to gitrevisions rather than git-rev-parse Documentation: gitrevisions Documentation: split off rev doc into include file
2010-07-15Merge branch 'jk/maint-status-keep-index-timestamp'Libravatar Junio C Hamano1-5/+11
* jk/maint-status-keep-index-timestamp: do not write out index when status does not have to
2010-07-15Merge branch 'jc/rebase-i-commit-msg-fix'Libravatar Junio C Hamano2-9/+28
* jc/rebase-i-commit-msg-fix: rebase-i: do not get fooled by a log message ending with backslash rebase-i: style fix
2010-07-15Merge branch 'ab/submodule-add-f'Libravatar Junio C Hamano3-3/+29
* ab/submodule-add-f: git submodule: add submodules with git add -f <path>
2010-07-15Merge branch 'bc/maint-makefile-fixes'Libravatar Junio C Hamano1-5/+5
* bc/maint-makefile-fixes: Makefile: work around ksh's failure to handle missing list argument to for loop Makefile: remove some unnecessary curly braces
2010-07-15Merge branch 'maint'Libravatar Junio C Hamano3-2/+13
* maint: Documentation: add submodule.* to the big configuration variable list gitmodules.5: url can be a relative path gitweb: fix esc_url
2010-07-15Documentation: add submodule.* to the big configuration variable listLibravatar Jonathan Nieder1-0/+9
The url, path, and the update items in [submodule "foo"] stanzas are nicely explained in the .gitmodules and ‘git submodule’ documentation. Point there from the config documentation. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-15gitmodules.5: url can be a relative pathLibravatar Jonathan Nieder1-0/+3
There is already excellent documentation for this facility in git-submodule.1, but it is not so discoverable. Relative paths in .gitmodules can be useful for serving the same repository over multiple protocols, for example. Thanks to Peter for pointing this out. Cc: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-15gitweb: fix esc_urlLibravatar Pavan Kumar Sunkara1-2/+1
Earlier, 452e225 (gitweb: fix esc_param, 2009-10-13) fixed CGI escaping rules used in esc_url. A very similar logic exists in esc_param and needs to be fixed the same way. Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14git --paginate: paginate external commands againLibravatar Jonathan Nieder2-12/+38
73e25e7c (git --paginate: do not commit pager choice too early, 2010-06-26) failed to take some cases into account. 1b. Builtins that do not use RUN_SETUP (like git config) do not find GIT_DIR set correctly when the pager is launched from run_builtin(). So the core.pager configuration is not honored from subdirectories of the toplevel for them. 4a. External git commands (like git request-pull) relied on the early pager launch to take care of handling the -p option. Ever since 73e25e7c, they do not honor the -p option at all. 4b. Commands invoked through ! aliases (like ls) were also relying on the early pager launch. Fix (4a) by launching the pager (if requested) before running such a “dashed external”. For simplicity, this still does not search for a .git directory before running the external command; when run from a subdirectory of the toplevel, therefore, the “[core] pager” configuration is still not honored. Fix (4b) by launching pager if requested before carrying out such an alias. Actually doing this has no effect, since the pager (if any) would have already been launched in a failed attempt to try a dashed external first. The choice-of-pager-not-honored-from- subdirectory bug still applies here, too. (1b) is not a regression. There is no need to fix it yet. Noticed by Junio. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14MERGE_RR is in .git, not .git/rr-cacheLibravatar Jay Soffian2-3/+3
0af0ac7 (Move MERGE_RR from .git/rr-cache/ into .git/) moved the location of MERGE_RR but I found a few references to the old location. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>