aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* vcs-svn: handle_node: Handle deletion case earlyJonathan Nieder2010-11-24
| | | | | | | | | | | | Take care of "Node-action: delete" as soon as possible, so we can stop worrying about that case in the rest of the function. Functional change: catch deletion nodes with features that would not apply to them (text, properties, or origin data) and error out for those cases. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Use mark to indicate nodes with included textJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | Allocate a mark if needed as soon as possible so later code can use "if (mark)" to check if this node has text attached rather than explicitly checking for Text-content-length. While at it, reject directory nodes with text attached; the presence of such a node would indicate a bug in the dump generator or svn-fe's understanding. In the long term, it would be nice to be able to continue parsing and save the error for later, but for now it is simpler to error out right away. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Unclutter handle_node by introducing have_props varJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | It is possible for a path node in an SVN-format dump file to leave out the properties section. svn-fe handles this by carrying over the properties (in particular, file type) from the old version of that node. To support this, handle_node tests several times whether a Prop-content-length field is present. Ancient Subversion actually leaves out the Prop-content-length field even for nodes with properties, so that's not quite the right check. Besides, this detail of mechanism is distracting when the question at hand is instead what content the new node should have. So introduce a local have_props variable. The semantics are the same as before; the adaptations to support ancient streams that leave out the prop-content-length can wait until someone needs them. Signed-off-by: Jonathan Nieder <jrnieer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Eliminate node_ctx.mark globalJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | The mark variable is only used in handle_node(). Its life is very short and simple: first, a new mark number is allocated if this node has text attached, then that mark is recorded in the in-core tree being built up, and lastly the mark is communicated to fast-import in the stream along with the associated text. A new reader may worry about interaction with other code, especially since mark is not initialized to zero in handle_node() itself. Disperse such worries by making it local. No functional change intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Eliminate node_ctx.srcRev globalJonathan Nieder2010-11-24
| | | | | | | | | | | | | The srcRev variable is only used in handle_node(); its purpose is to hold the old mode for a path, to only be used if properties are not being changed. Narrow its scope to make its meaningful lifetime more obvious. No functional change intended. Add some tests as a sanity-check for the simplest case (no renames). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Check for errors from open()Jonathan Nieder2010-11-24
| | | | | | | | test-svn-fe segfaults when passed a bogus path. Simplify debugging by exiting with a meaningful error message instead. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Allow simple v3 dumps (no deltas yet)David Barr2010-11-24
| | | | | | | | | | | | | | | | | | | | | | Since the dumpfile version 1 days, the Subversion dump format gained some new fields: - a unique identifier for the repository (version 2 format) - whether the text and properties for a node should be interpreted as deltas - checksums for a delta's preimage - SHA-1 sums as alternatives to the existing MD5 checksums for copy source and the payload (delta). For now what is relevant to us is the Text-delta and Prop-delta fields, since not noticing these causes a dump file to be misinterpreted (see the previous commit). [jn: with tests] Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* vcs-svn: Error out for v3 dumpsJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | By ignoring the Text-Delta and Prop-Delta node fields, current svn-fe happily mistakes deltas for full text and instead of cleanly erroring out, it produces a valid but semantically bogus fast-import stream when fed a dump file in the modern "svnadmin dump --deltas" format. Dump file parsers are supposed to ignore header fields they don't understand (to allow for backward-compatible extensions), but they are also supposed to check the SVN-fs-dump-format-version header to prevent misinterpretation of non backward-compatible extensions. Do so. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jl/maint-pull-tags-doc'Junio C Hamano2010-11-17
|\ | | | | | | | | * jl/maint-pull-tags-doc: pull: Remove --tags option from manpage
| * pull: Remove --tags option from manpageJens Lehmann2010-11-03
| | | | | | | | | | | | | | | | "Fetch all tags and merge them" does not make any sense as a request at the logical level, even though it might be more convenient to type. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'kb/maint-submodule-savearg'Junio C Hamano2010-11-17
|\ \ | | | | | | | | | | | | | | | * kb/maint-submodule-savearg: submodule: only preserve flags across recursive status/update invocations submodule: preserve all arguments exactly when recursing
| * | submodule: only preserve flags across recursive status/update invocationsKevin Ballard2010-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recursive invocations of submodule update/status preserve all arguments, so executing git submodule update --recursive -- foo attempts to recursively update a submodule named "foo". Naturally, this fails as one cannot have an infinitely-deep stack of submodules each containing a submodule named "foo". The desired behavior is instead to update foo and then recursively update all submodules inside of foo. This commit accomplishes that by only saving the flags for use in the recursive invocation. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | submodule: preserve all arguments exactly when recursingKevin Ballard2010-11-03
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell variables only hold strings, not lists of parameters, so $orig_args after orig_args="$@" fails to remember where each parameter starts and ends, if some include whitespace. So git submodule update \ --reference='/var/lib/common objects.git' \ --recursive --init becomes git submodule update --reference=/var/lib/common \ objects.git --recursive --init in the inner repositories. Use "git rev-parse --sq-quote" to save parameters in quoted form ready for evaluation by the shell, avoiding this problem. Helped-By: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/missing-config'Junio C Hamano2010-11-17
|\ \ | | | | | | | | | | | | * jk/missing-config: config: treat non-existent config files as empty
| * | config: treat non-existent config files as emptyJeff King2010-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git_config() function signals error by returning -1 in two instances: 1. An actual error occurs in opening a config file (parse errors cause an immediate die). 2. Of the three possible config files, none was found. However, this second case is often not an error at all; it simply means that the user has no configuration (they are outside a repo, and they have no ~/.gitconfig file). This can lead to confusing errors, such as when the bash completion calls "git config --list" outside of a repo. If the user has a ~/.gitconfig, the command completes succesfully; if they do not, it complains to stderr. This patch allows callers of git_config to distinguish between the two cases. Error is signaled by -1, and otherwise the return value is the number of files parsed. This means that the traditional "git_config(...) < 0" check for error should work, but callers who want to know whether we parsed any files or not can still do so. [jc: with tests from Jonathan] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'kb/maint-diff-ws-check'Junio C Hamano2010-11-17
|\ \ \ | | | | | | | | | | | | | | | | | | | | * kb/maint-diff-ws-check: diff: handle lines containing only whitespace and tabs better test-lib: extend test_decode_color to handle more color codes
| * | | diff: handle lines containing only whitespace and tabs betterKevin Ballard2010-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a line contains nothing but whitespace with at least one tab and the core.whitespace config option contains blank-at-eol, the whitespace on the line is being printed twice, once unhighlighted (unless otherwise matched by one of the other core.whitespace values), and a second time highlighted for blank-at-eol. Update the leading indentation check to stop checking when it reaches the trailing whitespace. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | test-lib: extend test_decode_color to handle more color codesKevin Ballard2010-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance the test_decode_color function to handle all common color codes, including background colors and escapes that contain multiple codes. This change necessitates changing <WHITE> to <BOLD>, so update t4034 as well. This change is necessary for the next commit in order to test background colors properly. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'bg/maint-gitweb-test-lib'Junio C Hamano2010-11-17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bg/maint-gitweb-test-lib: t/gitweb-lib: Don't pass constant to decode_utf8 Conflicts: t/gitweb-lib.sh
| * | | | t/gitweb-lib: Don't pass constant to decode_utf8Brian Gernhardt2010-10-20
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encode.pm started updating the string to decode in-place when a second argument is passed in version 2.40. This causes 'decode_utf8("", Encode::FB_CROAK)' to die with a message like: Modification of a read-only value attempted at .../Encode.pm line 216. Work around this by passing an empty variable instead of a constant string. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jm/mailmap'Junio C Hamano2010-11-17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jm/mailmap: t4203: do not let "git shortlog" DWIM based on tty t4203 (mailmap): stop hardcoding commit ids and dates mailmap: fix use of freed memory
| * | | | t4203: do not let "git shortlog" DWIM based on ttyJunio C Hamano2010-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "shortlog" command defaults to HEAD only when its standard input is connected to a terminal; otherwise it acts in the traditional "filter" mode to read and summarize the "git log" output. Two new tests added to t4203 assumed that the command always default to HEAD, but when the standard input is closed (or connected to /dev/null), it output empty, which is a summary of its empty input, causing the test to break. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | t4203 (mailmap): stop hardcoding commit ids and datesJonathan Nieder2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A seemingly innocuous change like adding test_tick somewhere can completely upset the final mailmap test, since it checks commit hashes and dates. Make the test less fragile by fuzzing away the unpredictable parts and leaving in the authors (which is what the test is about, anyway). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | mailmap: fix use of freed memoryJim Meyering2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On an x86_64 system (F13-based), I ran these commands in an empty directory: git init printf '%s\n' \ '<jdoe@example.com> <jdoe@example.COM>' \ 'John <jdoe@example.com>' > .mailmap git shortlog < /dev/null Here's the result: (reading log message from standard input) *** glibc detected *** git: free(): invalid pointer: 0x0000000000f53730 *** ======= Backtrace: ========= /lib64/libc.so.6[0x31ba875676] git[0x48c2a5] git[0x4b9858] ... zsh: abort (core dumped) git shortlog What happened? Some .mailmap entry is of the <email1> <email2> form, while a subsequent one looks like "User Name <Email2>, and the two email addresses on the right are not identical but are "equal" when using a case-insensitive comparator. Then, when add_mapping is processing the latter line, new_email is NULL and we free me->email, yet do not replace it with a new strdup'd string. Thus, when later we attempt to use the buffer behind that ->email pointer, we reference freed memory. The solution is to free ->email and ->name only if we're about to replace them. [jc: squashed in the tests from Jonathan] Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'tr/maint-git-repack-tmpfile'Junio C Hamano2010-11-17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * tr/maint-git-repack-tmpfile: repack: place temporary packs under .git/objects/pack/
| * | | | | repack: place temporary packs under .git/objects/pack/Thomas Rast2010-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-pack-objects is already careful to start out its temporary packs under .git/objects/pack/ (cf. 8b4eb6b, Do not perform cross-directory renames when creating packs, 2008-09-22), but git-repack did not respond in kind so the effort was lost when the filesystem boundary is exactly at that directory. Let git-repack pass a path under .git/objects/pack/ as the base for its temporary packs. This means we might need the $PACKDIR sooner (before the pack-objects invocation), so move the mkdir up just to be safe. Also note that the only use of *.pack is in the find invocation way before the pack-objects call, so the temporary packs will not suddenly show up in any wildcards because of the directory change. Reported-by: Marat Radchenko <marat@slonopotamus.org> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jk/maint-apply-no-binary'Junio C Hamano2010-11-17
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/maint-apply-no-binary: apply: don't segfault on binary files with missing data
| * | | | | | apply: don't segfault on binary files with missing dataJeff King2010-10-29
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually when applying a binary diff generated without --binary, it will be rejected early, as we don't even have the full sha1 of the pre- and post-images. However, if the diff is generated with --full-index (but not --binary), then we will actually try to apply it. If we have the postimage blob, then we can take a shortcut and never even look at the binary diff at all (e.g., this can happen when rebasing changes within a repository). If we don't have the postimage blob, though, we try to look at the actual fragments, of which there are none, and get a segfault. This patch checks explicitly for that case and complains to the user instead of segfaulting. We need to keep the check at a low level so that the "shortcut" case above continues to work. We also add a test that demonstrates the segfault. While we're at it, let's also explicitly test the shortcut case. Reported-by: Rafaël Carré <rafael.carre@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jk/push-progress'Junio C Hamano2010-11-17
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/push-progress: push: pass --progress down to git-pack-objects t5523-push-upstream: test progress messages t5523-push-upstream: add function to ensure fresh upstream repo test_terminal: ensure redirections work reliably test_terminal: catch use without TTY prerequisite test-lib: allow test code to check the list of declared prerequisites tests: test terminal output to both stdout and stderr tests: factor out terminal handling from t7006
| * | | | | | push: pass --progress down to git-pack-objectsJeff King2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pushing via builtin transports (like file://, git://), the underlying transport helper (in this case, git-pack-objects) did not get the --progress option, even if it was passed to git push. Fix this, and update the tests to reflect this. Note that according to the git-pack-objects documentation, we can safely apply the usual --progress semantics for the transport commands like clone and fetch (and for pushing over other smart transports). Reported-by: Chase Brammer <cbrammer@gmail.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | t5523-push-upstream: test progress messagesTay Ray Chuan2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported-by: Chase Brammer <cbrammer@gmail.com> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | t5523-push-upstream: add function to ensure fresh upstream repoTay Ray Chuan2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | test_terminal: ensure redirections work reliablyJonathan Nieder2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For terminal tests that capture output/stderr, the TTY prerequisite warning does not quite work for commands like test_terminal foo >out 2>err because the warning gets "swallowed" up by the redirection that's supposed only to be done by the subcommand. Even worse, the outcome depends on whether stdout was already a terminal (in which case test_terminal is a noop) or not (in which case test_terminal introduces a pseudo-tty in the middle of the pipeline). $ test_terminal.perl sh -c 'test -t 1 && echo >&2 YES' >out YES $ sh -c 'test -t 1 && echo >&2 YES' >out $ So: - use the test_terminal script even when running with "-v". - skip tests that require a terminal when the test_terminal script is unusable because IO::Pty is not installed. - write the "need to declare TTY prerequisite" message to fd 4, where it will be printed when running tests with -v, rather than being swallowed up by an unrelated redireciton. Noticed-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | test_terminal: catch use without TTY prerequisiteJonathan Nieder2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is easy to forget to declare the TTY prerequisite when writing tests on a system where it would always be satisfied (because IO::Pty is installed; see v1.7.3-rc0~33^2, 2010-08-16 for example). Automatically detect this problem so there is no need to remember. test_terminal: need to declare TTY prerequisite test_must_fail: command not found: test_terminal echo hi test_terminal returns status 127 in this case to simulate not being available. Also replace the SIMPLEPAGERTTY prerequisite on one test with "SIMPLEPAGER,TTY", since (1) the latter is supported now and (2) the prerequisite detection relies on the TTY prereq being explicitly declared. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | test-lib: allow test code to check the list of declared prerequisitesJonathan Nieder2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is plumbing to prepare helpers like test_terminal to notice buggy test scripts that do not declare all of the necessary prerequisites. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | tests: test terminal output to both stdout and stderrJeff King2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some outputs (like the pager) care whether stdout is a terminal. Others (like progress meters) care about stderr. This patch sets up both. Technically speaking, we could go further and set up just one (because either the other goes to a terminal, or because our tests are only interested in one). This patch does both to keep the interface to lib-terminal simple. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | tests: factor out terminal handling from t7006Jeff King2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other tests besides the pager ones may want to check how we handle output to a terminal. This patch makes the code reusable. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'tr/maint-merge-file-subdir'Junio C Hamano2010-11-17
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/maint-merge-file-subdir: merge-file: correctly find files when called in subdir prefix_filename(): safely handle the case where pfx_len=0
| * | | | | | | merge-file: correctly find files when called in subdirThomas Rast2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since b541248 (merge.conflictstyle: choose between "merge" and "diff3 -m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(), thus cd'ing around to find any possible config files to use. This broke merge-file when it is called from within a subdirectory of a repository, and the arguments are all relative paths. Fix by prepending the prefix, as passed down from the main git setup code, if there is any. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | prefix_filename(): safely handle the case where pfx_len=0Thomas Rast2010-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current prefix_filename() is proofed against the case where the prefix 'pfx' is NULL or a 0-length string, _except on Windows_. Change the behaviour to work the same on both platforms, and only check pfx_len so that callers passing a NULL prefix with a nonzero pfx_len segfault early on both. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jn/send-pack-error'Junio C Hamano2010-11-17
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jn/send-pack-error: send-pack: avoid redundant "pack-objects died with strange error"
| * | | | | | | | send-pack: avoid redundant "pack-objects died with strange error"Jonathan Nieder2010-10-18
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saying "pack-objects died with strange error" after "pack-objects died of signal 13" seems kind of redundant. The latter message was introduced when the run-command API changed to report abnormal exits on behalf of the caller (v1.6.5-rc0~86^2~5, 2009-07-04). Similarly, after a controlled pack-objects failure (detectable as a normal exit with nonzero status), a "died with strange error" message would be redundant next to the message from pack-objects itself. So leave off the "strange error" messages. The result should look something like this: $ git push sf master Counting objects: 21542, done. Compressing objects: 100% (4179/4179), done. fatal: Unable to create temporary file: Permission denied error: pack-objects died of signal 13 error: failed to push some refs to 'ssh://sf.net/gitroot/project/project' $ Or in the "controlled exit" case (contrived example): [...] fatal: delta size changed error: failed to push some refs to 'ssh://example.com/foo/bar' $ Improved-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'mg/make-prove'Junio C Hamano2010-11-17
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mg/make-prove: test: allow running the tests under "prove"
| * | | | | | | | test: allow running the tests under "prove"Michael J Gruber2010-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can run "make DEFAULT_TEST_TARGET=prove test" to run the test under "prove" (or $(PROVE) if set). The output is a bit easier to read when running many tests in parallel. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Liked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Liked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'kb/completion-checkout'Junio C Hamano2010-11-17
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kb/completion-checkout: completion: Support the DWIM mode for git checkout
| * | | | | | | | | completion: Support the DWIM mode for git checkoutKevin Ballard2010-10-13
| | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever since commit 70c9ac2 (DWIM: "git checkout frotz" to "git checkout -b frotz origin/frotz"), git checkout has supported a DWIM mode where it creates a local tracking branch for a remote branch if just the name of the remote branch is specified on the command-line and only one remote has a branch with that name. Teach the bash completion script to understand this DWIM mode and provide such remote-tracking branch names as possible completions. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'sg/completion'Junio C Hamano2010-11-17
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sg/completion: bash: support pretty format aliases bash: support more 'git notes' subcommands and their options bash: not all 'git bisect' subcommands make sense when not bisecting bash: offer refs for 'git bisect start'
| * | | | | | | | | bash: support pretty format aliasesSZEDER Gábor2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users can have their own pretty format aliases since 8028184 (pretty: add aliases for pretty formats, 2010-05-02), so let's offer those after '--pretty=' and '--format=' for 'log' and 'show', too. Similar to the completion of aliases, this will invoke 'git config' each time pretty aliases needs to be completed, so changes in pretty.* configuration will be reflected immediately. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | bash: support more 'git notes' subcommands and their optionsSZEDER Gábor2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current completion function for 'git notes' only supported the 'edit' and 'show' subcommands and none of their options. This patch adds support for all missing subcommands, options, and their arguments (files or refs), if any. The code responsible for completing subcommand looks different compared to the completion functions of other git commands with subcommands. This is because of the '--ref <notes-ref>' option which comes before the subcommand (i.e. git notes --ref <notes-ref> add). Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | bash: not all 'git bisect' subcommands make sense when not bisectingSZEDER Gábor2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... but only 'start' and 'replay'. The other commands will either error out or offer to start bisecting for the user. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>