summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2013-10-23Merge branch 'hu/cherry-pick-previous-branch'Libravatar Junio C Hamano1-0/+12
"git cherry-pick" without further options would segfault. Could use a follow-up to handle '-' after argv[1] better. * hu/cherry-pick-previous-branch: cherry-pick: handle "-" after parsing options
2013-10-23Merge branch 'mg/more-textconv'Libravatar Junio C Hamano3-15/+60
Make "git grep" and "git show" pay attention to --textconv when dealing with blob objects. * mg/more-textconv: grep: honor --textconv for the case rev:path grep: allow to use textconv filters t7008: demonstrate behavior of grep with textconv cat-file: do not die on --textconv without textconv filters show: honor --textconv for blobs diff_opt: track whether flags have been set explicitly t4030: demonstrate behavior of show with textconv
2013-10-18Merge branch 'jk/clone-progress-to-stderr'Libravatar Junio C Hamano3-5/+11
Some progress and diagnostic messages from "git clone" were incorrectly sent to the standard output stream, not to the standard error stream. * jk/clone-progress-to-stderr: clone: always set transport options clone: treat "checking connectivity" like other progress clone: send diagnostic messages to stderr
2013-10-17Merge branch 'jk/format-patch-from'Libravatar Junio C Hamano1-0/+10
"format-patch --from=<whom>" forgot to omit unnecessary in-body from line, i.e. when <whom> is the same as the real author. * jk/format-patch-from: format-patch: print in-body "From" only when needed
2013-10-17Merge branch 'jk/trailing-slash-in-pathspec'Libravatar Junio C Hamano1-2/+4
Code refactoring. * jk/trailing-slash-in-pathspec: reset: handle submodule with trailing slash rm: re-use parse_pathspec's trailing-slash removal
2013-10-17Sync with maintLibravatar Junio C Hamano1-21/+15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-10-17Merge branch 'nd/git-dir-pointing-at-gitfile' into maintLibravatar Junio C Hamano1-0/+4
* nd/git-dir-pointing-at-gitfile: Make setup_git_env() resolve .git file when $GIT_DIR is not specified
2013-10-17Merge branch 'ap/commit-author-mailmap' into maintLibravatar Junio C Hamano1-0/+11
* ap/commit-author-mailmap: commit: search author pattern against mailmap
2013-10-17Merge branch 'es/rebase-i-no-abbrev' into maintLibravatar Junio C Hamano1-2/+87
* es/rebase-i-no-abbrev: rebase -i: fix short SHA-1 collision t3404: rebase -i: demonstrate short SHA-1 collision t3404: make tests more self-contained Conflicts: t/t3404-rebase-interactive.sh
2013-10-17Merge branch 'rt/rebase-p-no-merge-summary' into maintLibravatar Junio C Hamano1-0/+23
* rt/rebase-p-no-merge-summary: rebase --preserve-merges: ignore "merge.log" config
2013-10-17t4254: modernize testsLibravatar SZEDER Gábor1-21/+15
- Don't start tests with 'test $? = 0' to catch preparation done outside the test_expect_success block. - Move writing the bogus patch and the expected output into the appropriate test_expect_success blocks. - Use the test_must_fail helper instead of manually checking for non-zero exit code. - Use the debug-friendly test_path_is_file helper instead of 'test -f'. - No space after '>'. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-10-16Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano1-0/+67
* git://git.bogomips.org/git-svn: git-svn: Warn about changing default for --prefix in Git v2.0 Documentation/git-svn: Promote the use of --prefix in docs + examples git-svn.txt: elaborate on rev_map files git-svn.txt: replace .git with $GIT_DIR git-svn.txt: reword description of gc command git-svn.txt: fix AsciiDoc formatting error git-svn: fix signed commit parsing
2013-10-15Merge branch 'maint'Libravatar Junio C Hamano1-1/+7
* maint: git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY clone --branch: refuse to clone if upstream repo is empty
2013-10-14Merge branch 'rj/highlight-test-hang'Libravatar Jonathan Nieder1-2/+4
* rj/highlight-test-hang: gitweb test: fix highlight test hang on Linux Mint
2013-10-14gitweb test: fix highlight test hang on Linux MintLibravatar Ramsay Jones1-2/+4
Linux Mint has an implementation of the highlight command (unrelated to the one from http://www.andre-simon.de) that works as a simple filter. The script uses 'sed' to add terminal colour escape codes around text matching a regular expression. When t9500-*.sh attempts to run "highlight --version", the script simply hangs waiting for input. (See https://bugs.launchpad.net/linuxmint/+bug/815005). The tool required by gitweb can be installed from the 'highlight' package. Unfortunately, given the default $PATH, this leads to the tool having lower precedence than the script. In order to avoid hanging the test, add '</dev/null' to the command line of the highlight invocation. Also, since the 'highlight' tool requred by gitweb produces '--version' output (and the script does not), saving the command output allows a simple check for the wrong 'highlight'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-14clone --branch: refuse to clone if upstream repo is emptyLibravatar Ralf Thielow1-1/+7
Since 920b691 (clone: refuse to clone if --branch points to bogus ref) we refuse to clone with option "-b" if the specified branch does not exist in the (non-empty) upstream. If the upstream repository is empty, the branch doesn't exist, either. So refuse the clone too. Reported-by: Robert Mitwicki <robert.mitwicki@opensoftware.pl> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-14Merge branch 'sb/checkout-test-complex-path'Libravatar Jonathan Nieder1-7/+7
* sb/checkout-test-complex-path: checkout test: enable test with complex relative path
2013-10-14Merge branch 'rt/cherry-pick-status'Libravatar Jonathan Nieder1-9/+11
* rt/cherry-pick-status: status: show commit sha1 in "You are currently cherry-picking" message status test: add missing && to <<EOF blocks
2013-10-14Merge branch 'nd/clone-local-with-colon'Libravatar Jonathan Nieder1-1/+45
* nd/clone-local-with-colon: clone: tighten "local paths with colons" check a bit
2013-10-14Merge branch 'jx/clean-interactive'Libravatar Jonathan Nieder1-2/+2
* jx/clean-interactive: path-utils test: rename mingw_path function to print_path
2013-10-14path-utils test: rename mingw_path function to print_pathLibravatar Sebastian Schuberth1-2/+2
mingw_path was introduced in abd4284 to output a mangled path as it is passed as an argument to main(). But the name is misleading because mangling does not come from MinGW, but from MSYS [1]. As abd4284 does not introduce any MSYS or MinGW specific code but just prints out argv[2] as it is passed to main(), give the function the more generic and less confusing name "print_path". [1] http://www.mingw.org/wiki/Posix_path_conversion Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-12git-svn: Warn about changing default for --prefix in Git v2.0Libravatar Johan Herland1-0/+67
In Git v2.0, we will change the default --prefix for init/clone from none/empty to "origin/" (which causes SVN-tracking branches to be placed at refs/remotes/origin/* instead of refs/remotes/*). This patch warns users about the upcoming change, both in the git-svn manual page, and on stderr when running init/clone in the "multi-mode" without providing a --prefix. Cc: Eric Wong <normalperson@yhbt.net> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-10-11status: show commit sha1 in "You are currently cherry-picking" messageLibravatar Ralf Thielow1-4/+6
Especially helpful when cherry-picking multiple commits. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-11status test: add missing && to <<EOF blocksLibravatar Jonathan Nieder1-5/+5
When a test forgets to include && after each command, it is possible for an early command to succeed but the test to fail, which can hide bugs. Checked using the following patch to the test harness: --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -425,7 +425,17 @@ test_eval_ () { eval </dev/null >&3 2>&4 "$*" } +check_command_chaining_ () { + eval >&3 2>&4 "(exit 189) && $*" + eval_chain_ret=$? + if test "$eval_chain_ret" != 189 + then + error 'bug in test script: missing "&&" in test commands' + fi +} + test_run_ () { + check_command_chaining_ "$1" test_cleanup=: expecting_failure=$2 setup_malloc_check Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-10cherry-pick: handle "-" after parsing optionsLibravatar Jeff King1-0/+12
Currently, we only try converting argv[1] from "-" into "@{-1}". This means we do not notice "-" when used together with an option. Worse, when "git cherry-pick" is run with no options, we segfault. Fix this by doing the substitution after we have checked that there is something in argv to cherry-pick and know any remaining options are meant for the revision-listing machinery. This still does not handle "-" after the first non-cherry-pick option. For example, git cherry-pick foo~2 - bar~5 and git cherry-pick --no-merges - will still dump usage. Reported-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-09checkout test: enable test with complex relative pathLibravatar Stefan Beller1-7/+7
This test was added, commented out, in fed1b5ca (git-checkout: Test for relative path use, 2007-11-09). Later git's path handling was improved (d089ebaa, setup: sanitize absolute and funny paths in get_pathspec(), 2008-01-28) but we forgot to enable the now-working test. This test expects to run from a subdirectory, so add a 'cd'. While we're here, examine the content of the checked-out file instead of just checking that it exists. The other checkout tests already do the same. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-09-27clone: tighten "local paths with colons" check a bitLibravatar Nguyễn Thái Ngọc Duy1-1/+45
commit 6000334 (clone: allow cloning local paths with colons in them - 2013-05-04) made it possible to specify a path that has colons in it without file://, e.g. ../foo:bar/somewhere. But the check was a bit sloppy. Consider the url '[foo]:bar'. The '[]' unwrapping code will turn the string to 'foo\0:bar'. In effect this new string is the same as 'foo/:bar' in the check "path < strchrnul(host, '/')", which mistakes it for a local path (with '/' before the first ':') when it's actually not. So disable the check for '/' before ':' when the URL has been mangled by '[]' unwrapping. [jn: with tests from Jeff King] Noticed-by: Morten Stenshorne <mstensho@opera.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-09-24Merge branch 'bc/submodule-status-ignored'Libravatar Jonathan Nieder2-2/+20
* bc/submodule-status-ignored: Improve documentation concerning the status.submodulesummary setting submodule: don't print status output with ignore=all submodule: fix confusing variable name
2013-09-24Merge branch 'cc/replace-with-the-same-type'Libravatar Jonathan Nieder1-3/+22
* cc/replace-with-the-same-type: Doc: 'replace' merge and non-merge commits t6050-replace: use some long option names replace: allow long option names Documentation/replace: add Creating Replacement Objects section t6050-replace: add test to clean up all the replace refs t6050-replace: test that objects are of the same type Documentation/replace: state that objects must be of the same type replace: forbid replacing an object with one of a different type
2013-09-24Merge branch 'jk/shortlog-tolerate-broken-commit'Libravatar Jonathan Nieder1-0/+16
* jk/shortlog-tolerate-broken-commit: shortlog: ignore commits with missing authors
2013-09-24Merge branch 'jc/push-cas'Libravatar Jonathan Nieder1-1/+1
* jc/push-cas: t5541: mark passing c-a-s test as success
2013-09-20Merge branch 'fc/at-head'Libravatar Junio C Hamano1-0/+8
Instead of typing four capital letters "HEAD", you can say "@" now, e.g. "git log @". * fc/at-head: Add new @ shortcut for HEAD sha1-name: pass len argument to interpret_branch_name()
2013-09-20Merge branch 'dw/check-ignore-sans-index'Libravatar Junio C Hamano1-9/+63
"git check-ignore" follows the same rule as "git add" and "git status" in that the ignore/exclude mechanism does not take effect on paths that are already tracked. With "--no-index" option, it can be used to diagnose which paths that should have been ignored have been mistakenly added to the index. * dw/check-ignore-sans-index: check-ignore: Add option to ignore index contents
2013-09-20Merge branch 'bk/refs-multi-update'Libravatar Junio C Hamano1-0/+632
Give "update-refs" a "--stdin" option to read multiple update requests and perform them in an all-or-none fashion. * bk/refs-multi-update: update-ref: add test cases covering --stdin signature update-ref: support multiple simultaneous updates refs: add update_refs for multiple simultaneous updates refs: add function to repack without multiple refs refs: factor delete_ref loose ref step into a helper refs: factor update_ref steps into helpers refs: report ref type from lock_any_ref_for_update reset: rename update_refs to reset_refs
2013-09-20Merge branch 'nr/git-cd-to-a-directory'Libravatar Junio C Hamano1-0/+84
Just like "make -C <directory>", make "git -C <directory> ..." to go there before doing anything else. * nr/git-cd-to-a-directory: t0056: "git -C" test updates git: run in a directory given with -C option
2013-09-20Merge branch 'jh/checkout-auto-tracking'Libravatar Junio C Hamano2-4/+40
Fix a minor regression in v1.8.3.2 and later that made it impossible to base your local work on anything but a local branch of the upstream repository you are tracking from. * jh/checkout-auto-tracking: t3200: fix failure on case-insensitive filesystems branch.c: Relax unnecessary requirement on upstream's remote ref name t3200: Add test demonstrating minor regression in 41c21f2 Refer to branch.<name>.remote/merge when documenting --track t3200: Minor fix when preparing for tracking failure t2024: Fix &&-chaining and a couple of typos
2013-09-20Merge branch 'hu/cherry-pick-previous-branch'Libravatar Junio C Hamano1-0/+20
Just like "git checkout -" knows to check out and "git merge -" knows to merge the branch you were previously on, "git cherry-pick" now understands "git cherry-pick -" to pick from the previous branch. * hu/cherry-pick-previous-branch: cherry-pick: allow "-" as abbreviation of '@{-1}'
2013-09-20Merge branch 'mm/status-without-comment-char'Libravatar Junio C Hamano5-814/+875
"git status" now omits the prefix to make its output a comment in a commit log editor, which is not necessary for human consumption. We may want to tighten the output to omit unnecessary trailing blank lines, but that does not have to be in the scope of this series. * mm/status-without-comment-char: t7508: avoid non-portable sed expression status: add missing blank line after list of "other" files tests: don't set status.displayCommentPrefix file-wide status: disable display of '#' comment prefix by default submodule summary: ignore --for-status option wt-status: use argv_array API builtin/stripspace.c: fix broken indentation
2013-09-20Merge branch 'rh/peeling-tag-to-tag'Libravatar Junio C Hamano1-0/+7
Make "foo^{tag}" to peel a tag to itself, i.e. no-op., and fail if "foo" is not a tag. "git rev-parse --verify v1.0^{tag}" would be a more convenient way to say "test $(git cat-file -t v1.0) = tag". * rh/peeling-tag-to-tag: peel_onion: do not assume length of x_type globals peel_onion(): add support for <rev>^{tag}
2013-09-20Merge branch 'jx/branch-vv-always-compare-with-upstream'Libravatar Junio C Hamano1-4/+85
"git branch -v -v" (and "git status") did not distinguish among a branch that does not build on any other branch, a branch that is in sync with the branch it builds on, and a branch that is configured to build on some other branch that no longer exists. * jx/branch-vv-always-compare-with-upstream: status: always show tracking branch even no change branch: report invalid tracking branch as gone
2013-09-20Merge branch 'nd/fetch-into-shallow'Libravatar Junio C Hamano2-3/+11
When there is no sufficient overlap between old and new history during a fetch into a shallow repository, we unnecessarily sent objects the sending side knows the receiving end has. * nd/fetch-into-shallow: Add testcase for needless objects during a shallow fetch list-objects: mark more commits as edges in mark_edges_uninteresting list-objects: reduce one argument in mark_edges_uninteresting upload-pack: delegate rev walking in shallow fetch to pack-objects shallow: add setup_temporary_shallow() shallow: only add shallow graft points to new shallow file move setup_alternate_shallow and write_shallow_commits to shallow.c
2013-09-20t5541: mark passing c-a-s test as successLibravatar Jeff King1-1/+1
Commit 05c1eb1 (push: teach --force-with-lease to smart-http transport) fixed the compare-and-swap test in t5541. It tried to mark the test as passing by teaching the test helper function to expect an extra "success or failure" parameter, but forgot to actually use the parameter in the helper. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-20format-patch: print in-body "From" only when neededLibravatar Jeff King1-0/+10
Commit a908047 taught format-patch the "--from" option, which places the author ident into an in-body from header, and uses the committer ident in the rfc822 from header. The documentation claims that it will omit the in-body header when it is the same as the rfc822 header, but the code never implemented that behavior. This patch completes the feature by comparing the two idents and doing nothing when they are the same (this is the same as simply omitting the in-body header, as the two are by definition indistinguishable in this case). This makes it reasonable to turn on "--from" all the time (if it matches your particular workflow), rather than only using it when exporting other people's patches. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-19t0056: "git -C" test updatesLibravatar Nazri Ramliy1-6/+8
Instead of repeating the text to record as the commit log message and string we expect to see in "log" output, use the same variable to avoid them going out of sync. Use different names for test files in different directories to improve our chance to catch future breakages that makes "-C <dir>" go to a place that is different from what was specified. Signed-off-by: Nazri Ramliy <ayiehere@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18shortlog: ignore commits with missing authorsLibravatar Jeff King1-0/+16
Most of git's traversals are robust against minor breakages in commit data. For example, "git log" will still output an entry for a commit that has a broken encoding or missing author, and will not abort the whole operation. Shortlog, on the other hand, will die as soon as it sees a commit without an author, meaning that a repository with a broken commit cannot get any shortlog output at all. Let's downgrade this fatal error to a warning, and continue the operation. We simply ignore the commit and do not count it in the total (since we do not have any author under which to file it). Alternatively, we could output some kind of "<empty>" record to collect these bogus commits. It is probably not worth it, though; we have already warned to stderr, so the user is aware that such bogosities exist, and any placeholder we came up with would either be syntactically invalid, or would potentially conflict with real data. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18clone: always set transport optionsLibravatar Jeff King1-0/+4
A clone will always create a transport struct, whether we are cloning locally or using an actual protocol. In the local case, we only use the transport to get the list of refs, and then transfer the objects out-of-band. However, there are many options that we do not bother setting up in the local case. For the most part, these are noops, because they only affect the object-fetching stage (e.g., the --depth option). However, some options do have a visible impact. For example, giving the path to upload-pack via "-u" does not currently work for a local clone, even though we need upload-pack to get the ref list. We can just drop the conditional entirely and set these options for both local and non-local clones. Rather than keep track of which options impact the object versus the ref fetching stage, we can simply let the noops be noops (and the cost of setting the options in the first place is not high). The one exception is that we also check that the transport provides both a "get_refs_list" and a "fetch" method. We will now be checking the former for both cases (which is good, since a transport that cannot fetch refs would not work for a local clone), and we tweak the conditional to check for a "fetch" only when we are non-local. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18clone: treat "checking connectivity" like other progressLibravatar Jeff King1-1/+2
When stderr does not point to a tty, we typically suppress "we are now in this phase" progress reporting (e.g., we ask the server not to send us "counting objects" and the like). The new "checking connectivity" message is in the same vein, and should be suppressed. Since clone relies on the transport code to make the decision, we can simply sneak a peek at the "progress" field of the transport struct. That properly takes into account both the verbosity and progress options we were given, as well as the result of isatty(). Note that we do not set up that progress flag for a local clone, as we do not fetch using the transport at all. That's acceptable here, though, because we also do not perform a connectivity check in that case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18clone: send diagnostic messages to stderrLibravatar Jeff King2-5/+6
Putting messages like "Cloning into.." and "done" on stdout is un-Unix and uselessly clutters the stdout channel. Send them to stderr. We have to tweak two tests to accommodate this: 1. t5601 checks for doubled output due to forking, and doesn't actually care where the output goes; adjust it to check stderr. 2. t5702 is trying to test whether progress output was sent to stderr, but naively does so by checking whether stderr produced any output. Instead, have it look for "%", a token found in progress output but not elsewhere (and which lets us avoid hard-coding the progress text in the test). This should not regress any scripts that try to parse the current output, as the output is already internationalized and therefore unstable. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18Merge branch 'bc/completion-for-bash-3.0' into maintLibravatar Junio C Hamano1-1/+1
Some people still use rather old versions of bash, which cannot grok some constructs like 'printf -v varname' the prompt and completion code started to use recently. * bc/completion-for-bash-3.0: contrib/git-prompt.sh: handle missing 'printf -v' more gracefully t9902-completion.sh: old Bash still does not support array+=('') notation git-completion.bash: use correct Bash/Zsh array length syntax
2013-09-18Merge branch 'mm/no-shell-escape-in-die-message' into maintLibravatar Junio C Hamano1-0/+13
Fixes a minor bug in "git rebase -i" (there could be others, as the root cause is pretty generic) where the code feeds a random, data dependeant string to 'echo' and expects it to come out literally. * mm/no-shell-escape-in-die-message: die_with_status: use "printf '%s\n'", not "echo"