summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-18merge script: handle -m --log correctlyLibravatar Jonathan Nieder1-4/+10
Based on v1.7.1.1~23^2 (merge: --log appends shortlog to message if specified, 2010-05-11). Without this change, the scripted (non-builtin) merge does not pass t7604. Cc: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: forbid merge -s indexLibravatar Jonathan Nieder1-0/+5
Some git-merge-* commands are not merge strategies. This is based on v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy, 2008-07-30) but it is less smart: we just use a hard-coded list of forbidden strategy names. It is okay if this falls out of date, since the code is just an example. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: allow custom strategiesLibravatar Jonathan Nieder1-2/+6
The idea comes from v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy, 2008-07-30). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: merge -X<option>Libravatar Jonathan Nieder1-1/+7
Without this support, the scripted merge cannot pass t6037. Based on v1.7.0-rc0~55^2~5 (git merge -X<option>, 2009-11-25). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: improve log message subjectLibravatar Jonathan Nieder1-8/+19
- point out remote-tracking branches as "remote branch 'upstream/master'"; - avoid misleading log messages when a tag and branch share a name. This approximates the builtin merge command's behavior well enough to pass the relevant tests. Based roughly on v1.6.4.2~10^2 (merge: indicate remote tracking branches in merge message, 2009-08-09) and v1.6.4.2~10^2~1 (merge: fix incorrect merge message for ambiguous tag/branch, 2009-08-09). Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: refuse to merge during mergeLibravatar Jonathan Nieder1-0/+3
Check MERGE_HEAD and bail out if it exists. Based on v1.6.3.3~3^2 (refuse to merge during a merge, 2009-06-01). Without this change, the scripted merge does not pass t3030. Cc: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18merge script: tweak unmerged files message to match builtinLibravatar Jonathan Nieder1-1/+1
Before: You are in the middle of a conflicted merge. After: Merge is not possible because you have unmerged files. I prefer the old message, but the new one is more consistent with other commands and tests expect it. In particular, without this change the scripted merge does not pass t3030. Based on v1.7.0-rc0~66^2 (Be more user-friendly when refusing to do something because of conflict., 2010-01-12). 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 script: --squash, --ff from unborn branch are errorsLibravatar Jonathan Nieder1-0/+4
Port v1.6.1-rc1~319 (provide more errors for the "merge into empty head" case, 2008-08-21) to the example merge script. Noticed by comparison with builtin merge. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18fmt-merge-msg -m to override merge titleLibravatar Jonathan Nieder3-4/+55
Since v1.7.1.1~23^2 (merge: --log appends shortlog to message if specified, 2010-05-11), the fmt-merge-msg backend supports custom text to override the merge title "Merge <foo> into <bar>". Expose this functionality for scripted callers. Example: git fmt-merge-msg --log -m \ "$(printf '%s\n' \ "Merge branch 'api-cleanup' into feature" \ '' \ 'This is to use a few functions refactored for this purpose.' )" <.git/FETCH_HEAD Cc: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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