summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2012-09-11blame: allow "blame file" in the middle of a conflicted mergeLibravatar Junio C Hamano1-1/+1
"git blame file" has always meant "find the origin of each line of the file in the history leading to HEAD, oh by the way, blame the lines that are modified locally to the working tree". This teaches "git blame" that during a conflicted merge, some uncommitted changes may have come from the other history that is being merged. The verify_working_tree_path() function introduced in the previous patch to notice a typo in the filename (primarily on case insensitive filesystems) has been updated to allow a filename that does not exist in HEAD (i.e. the tip of our history) as long as it exists one of the commits being merged, so that a "we deleted, the other side modified" case tracks the history of the file in the history of the other side. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-10blame $path: avoid getting fooled by case insensitive filesystemsLibravatar Junio C Hamano1-2/+2
"git blame MAKEFILE" run in a history that has "Makefile" but not MAKEFILE can get confused on a case insensitive filesystem, because the check we run to see if there is a corresponding file in the working tree with lstat("MAKEFILE") succeeds. In addition to that check, we have to make sure that the given path also exists in the commit we start digging history from (i.e. "HEAD"). Note that this reveals the breakage in a test added in cd8ae20 (git-blame shouldn't crash if run in an unmerged tree, 2007-10-18), which expects the entire merge-in-progress path to be blamed to the working tree when it did not exist in our tree. As it is clear in the log message of that commit, the old breakage was that it was causing an internal error and the fix was about avoiding it. Just check that the command does not die an uncontrolled death. For this particular case, the blame should fail, as the history for the file in that contents has not been committed yet at the point in the test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-03Merge branch 'ef/maint-rebase-error-message' into maintLibravatar Junio C Hamano1-0/+5
When "git rebase" was given a bad commit to replay the history on, its error message did not correctly give the command line argument it had trouble parsing. By Erik Faye-Lund * ef/maint-rebase-error-message: rebase: report invalid commit correctly
2012-06-01Merge branch 'rs/maint-grep-F' into maintLibravatar Junio C Hamano1-0/+5
"git grep -e '$pattern'", unlike the case where the patterns are read from a file, did not treat individual lines in the given pattern argument as separate regular expressions as it should. By René Scharfe * rs/maint-grep-F: grep: stop leaking line strings with -f grep: support newline separated pattern list grep: factor out do_append_grep_pat() grep: factor out create_grep_pat()
2012-06-01Merge branch 'jk/ident-split-fix' into maintLibravatar Junio C Hamano1-0/+7
An author/committer name that is a single character was mishandled as an invalid name by mistake. By Jeff King * jk/ident-split-fix: fix off-by-one error in split_ident_line
2012-05-30rebase: report invalid commit correctlyLibravatar Erik Faye-Lund1-0/+5
In 9765b6a (rebase: align variable content, 2011-02-06), the code to error out was moved up one level. Unfortunately, one reference to a function parameter wasn't rewritten as it should, leading to the wrong parameter being errored on. This error was propagated by 71786f5 (rebase: factor out reference parsing, 2011-02-06) and merged in 78c6e0f (Merge branch 'mz/rebase', 2011-04-28). Correct this by reporting $onto_name istead. Reported-By: Manuela Hutter <manuelah@opera.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-25Merge branch 'hv/submodule-alt-odb' into maintLibravatar Junio C Hamano1-0/+34
When a submodule repository uses alternate object store mechanism, some commands that were started from the superproject did not notice it and failed with "No such object" errors. The subcommands of "git submodule" command that recursed into the submodule in a separate process were OK; only the ones that cheated and peeked directly into the submodule's repository from the primary process were affected. By Heiko Voigt * hv/submodule-alt-odb: teach add_submodule_odb() to look for alternates
2012-05-25Merge branch 'bp/diff-no-index-strbuf-fix' into maintLibravatar Junio C Hamano1-0/+19
The directory path used in "git diff --no-index", when it recurses down, was broken with a recent update after v1.7.10.1 release. By Bobby Powers * bp/diff-no-index-strbuf-fix: diff --no-index: don't leak buffers in queue_diff diff --no-index: reset temporary buffer lengths on directory iteration
2012-05-24Merge branch 'jk/maint-status-porcelain-z-b' into maintLibravatar Junio C Hamano1-1/+15
"git status --porcelain" ignored "--branch" option by mistake. The output for "git status --branch -z" was also incorrect and did not terminate the record for the current branch name with NUL as asked. By Jeff King * jk/maint-status-porcelain-z-b: status: respect "-b" for porcelain format status: fix null termination with "-b" status: refactor null_termination option commit: refactor option parsing
2012-05-22fix off-by-one error in split_ident_lineLibravatar Jeff King1-0/+7
Commit 4b340cf split the logic to parse an ident line out of pretty.c's format_person_part. But in doing so, it accidentally introduced an off-by-one error that caused it to think that single-character names were invalid. This manifested itself as the "%an" format failing to show anything at all for a single-character name. Reported-by: Brian Turner <bturner@atlassian.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-20grep: support newline separated pattern listLibravatar René Scharfe1-0/+5
Currently, patterns that contain newline characters don't match anything when given to git grep. Regular grep(1) interprets patterns as lists of newline separated search strings instead. Implement this functionality by creating and inserting extra grep_pat structures for patterns consisting of multiple lines when appending to the pattern lists. For simplicity, all pattern strings are duplicated. The original pattern is truncated in place to make it contain only the first line. Requested-by: Torne (Richard Coles) <torne@google.com> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-20Consistently use "superproject" instead of "supermodule"Libravatar Jens Lehmann2-3/+3
We fairly consistently say "superproject" and never "supermodule" these days. But there are seven occurrences of "supermodule" left in the current work tree. Three appear in Release Notes for 1.5.3 and 1.7.7, three in test names and one in a C-code comment. Replace all occurrences of "supermodule" outside of the Release Notes (which shouldn't be changed after the fact) with "superproject" for consistency. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-20t3404: begin "exchange commits with -p" test with correct preconditionsLibravatar Johannes Sixt1-0/+1
The test case shows a bug in 'rebase -p', but even if the bug were fixed the test would fail because it did not ensure that the preconditions match the postconditions that were checked. Insert the suitable 'git checkout'. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-16diff --no-index: reset temporary buffer lengths on directory iterationLibravatar Bobby Powers1-0/+19
Commit 875b91b (diff --no-index: use strbuf for temporary pathnames, 2012-04-25) introduced a regression when using diff --no-index with directories. When iterating through a directory, the switch to strbuf from heap-allocated char arrays caused paths to form like 'dir/file1', 'dir/file1file2', rather than 'dir/file1', 'dir/file2' as expected. Avoid this by resetting the paths variables to their original length before each iteration. Signed-off-by: Bobby Powers <bobbypowers@gmail.com> Reviewed-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-14teach add_submodule_odb() to look for alternatesLibravatar Heiko Voigt1-0/+34
Since we allow to link other object databases when loading a submodules database we should also load possible alternates. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-14Merge branch 'jk/maint-reflog-walk-count-vs-time' into maintLibravatar Junio C Hamano1-4/+57
Gives a better DWIM behaviour for --pretty=format:%gd, "stash list", and "log -g", depending on how the starting point ("master" vs "master@{0}" vs "master@{now}") and date formatting options (e.g. "--date=iso") are given on the command line. By Jeff King (4) and Junio C Hamano (1) * jk/maint-reflog-walk-count-vs-time: reflog-walk: tell explicit --date=default from not having --date at all reflog-walk: always make HEAD@{0} show indexed selectors reflog-walk: clean up "flag" field of commit_reflog struct log: respect date_mode_explicit with --format:%gd t1411: add more selector index/date tests
2012-05-14Merge branch 'ef/checkout-empty' into maintLibravatar Junio C Hamano1-0/+11
Running "git checkout" on an unborn branch used to corrupt HEAD (regression in 1.7.10); this makes it error out. By Erik Faye-Lund * ef/checkout-empty: checkout: do not corrupt HEAD on empty repo
2012-05-14Merge branch 'jk/maint-tformat-with-z' into maintLibravatar Junio C Hamano1-0/+28
By Jan Krüger (1) and Junio C Hamano (1) * jk/maint-tformat-with-z: log-tree: the previous one is still not quite right log-tree: use custom line terminator in line termination mode
2012-05-14Merge branch 'js/checkout-detach-count' into maintLibravatar Junio C Hamano1-5/+16
When checking out another commit from an already detached state, we used to report all commits that are not reachable from any of the refs as lossage, but some of them might be reachable from the new HEAD, and there is no need to warn about them. By Johannes Sixt * js/checkout-detach-count: checkout (detached): truncate list of orphaned commits at the new HEAD t2020-checkout-detach: check for the number of orphaned commits
2012-05-11Merge branch 'ct/advise-push-default' into maintLibravatar Junio C Hamano2-2/+2
The cases "git push" fails due to non-ff can be broken into three categories; each case is given a separate advise message. By Christopher Tiwald (2) and Jeff King (1) * ct/advise-push-default: Fix httpd tests that broke when non-ff push advice changed clean up struct ref's nonfastforward field push: Provide situational hints for non-fast-forward errors
2012-05-11Merge branch 'js/fast-import-test-9300' into maintLibravatar Junio C Hamano1-34/+54
By Johannes Sixt * js/fast-import-test-9300: t9300-fast-import: avoid 'exit' in test_expect_success snippets
2012-05-11Merge branch 'jk/repack-no-explode-objects-from-old-pack' into maintLibravatar Junio C Hamano1-0/+14
"git repack" used to write out unreachable objects as loose objects when repacking, even if such loose objects will immediately pruned due to its age. By Jeff King * jk/repack-no-explode-objects-from-old-pack: gc: use argv-array for sub-commands argv-array: add a new "pushl" method argv-array: refactor empty_argv initialization gc: do not explode objects which will be immediately pruned
2012-05-11Merge branch 'sl/test-wc-l-line-count' into maintLibravatar Junio C Hamano19-74/+65
By Stefano Lattarini * sl/test-wc-l-line-count: tests: modernise style: more uses of test_line_count
2012-05-11Merge branch 'rl/show-empty-prefix' into maintLibravatar Junio C Hamano1-1/+1
Unlike "git rev-parse --show-cdup", "--show-prefix" did not give an empty line when run at the top of the working tree. By Ross Lagerwall * rl/show-empty-prefix: rev-parse --show-prefix: add in trailing newline
2012-05-10Merge branch 'mm/include-userpath' into maintLibravatar Junio C Hamano1-0/+8
By Jeff King * mm/include-userpath: config: expand tildes in include.path variable
2012-05-10Merge branch 'bw/test-fix-grep-gnuism' into maintLibravatar Junio C Hamano1-2/+2
* bw/test-fix-grep-gnuism: t9400: fix gnuism in grep
2012-05-10Merge branch 'jk/http-backend-keep-committer-ident-env' into maintLibravatar Junio C Hamano2-0/+28
By Jeff King * jk/http-backend-keep-committer-ident-env: http-backend: respect existing GIT_COMMITTER_* variables Conflicts: t/t5541-http-push.sh
2012-05-10Merge branch 'jk/maint-push-progress' into maintLibravatar Junio C Hamano1-2/+25
"git push" over smart-http lost progress output a few releases ago. By Jeff King * jk/maint-push-progress: t5541: test more combinations of --progress teach send-pack about --[no-]progress send-pack: show progress when isatty(2)
2012-05-10Merge branch 'lp/diffstat-with-graph' into maintLibravatar Junio C Hamano2-4/+121
"log --graph" was not very friendly with "--stat" option and its output had line breaks at wrong places. By Lucian Poston (5) and Zbigniew Jędrzejewski-Szmek (3) * lp/diffstat-with-graph: t4052: work around shells unable to set COLUMNS to 1 test-lib: skip test with COLUMNS=1 under mksh Prevent graph_width of stat width from falling below min t4052: Test diff-stat output with minimum columns t4052: Adjust --graph --stat output for prefixes Adjust stat width calculations to take --graph output into account Add output_prefix_length to diff_options t4052: test --stat output with --graph
2012-05-08checkout: do not corrupt HEAD on empty repoLibravatar Erik Faye-Lund1-0/+11
In abe1998 ("git checkout -b: allow switching out of an unborn branch"), a code-path overly-optimisticly assumed that a branch-name was specified. This is not always the case, and as a result a NULL-pointer was attempted printed to .git/HEAD. This could lead to at least two different failure modes: 1) vsnprintf formated the NULL-string as something useful (e.g "(null)") 2) vsnprintf crashed Neither were very convenient for formatting a new HEAD-reference. To fix this, reintroduce some strictness so we only take this new codepath if a banch-name was specified. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-08status: respect "-b" for porcelain formatLibravatar Jeff King1-1/+6
There is no reason not to, as the user has to explicitly ask for it, so we are not breaking compatibility by doing so. We can do this simply by moving the "show_branch" flag into the wt_status struct. As a bonus, this saves us from passing it explicitly, simplifying the code. Signed-off-by: Jeff King <peff@peff.net>
2012-05-08status: fix null termination with "-b"Libravatar Jeff King1-0/+9
When the "-z" option is given to status, we are supposed to NUL-terminate each record. However, the "-b" code to show the tracking branch did not respect this, and always ended with a newline. Signed-off-by: Jeff King <peff@peff.net>
2012-05-07reflog-walk: tell explicit --date=default from not having --date at allLibravatar Junio C Hamano1-4/+4
Introduction of opt->date_mode_explicit was a step in the right direction, but lost that crucial bit at the very end of the callchain, and the callee could not tell an explicitly specified "I want *date* but in default format" from the built-in default value passed when there was no --date specified. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-07Merge branch 'jk/maint-gitweb-test-use-sane-perl' into maintLibravatar Junio C Hamano1-1/+1
When using a Perl script on a system where "perl" found on user's $PATH could be ancient or otherwise broken, we allow builders to specify the path to a good copy of Perl with $PERL_PATH. The gitweb test forgot to use that Perl when running its test. By Jeff King (1) and Zbigniew Jędrzejewski-Szmek (1) * jk/maint-gitweb-test-use-sane-perl: Consistently use perl from /usr/bin/ for scripts t/gitweb-lib: use $PERL_PATH to run gitweb
2012-05-07Merge branch 'js/daemon-test-race-fix' into maintLibravatar Junio C Hamano1-11/+11
The test scaffolding for git-daemon was flaky. By Johannes Sixt * js/daemon-test-race-fix: t5570: fix forwarding of git-daemon messages via cat
2012-05-07Merge branch 'jk/maint-config-bogus-section' into maintLibravatar Junio C Hamano1-0/+8
"git config --rename-section" to rename an existing section into a bogus one did not check the new name. By Jeff King * jk/maint-config-bogus-section: config: reject bogus section names for --rename-section
2012-05-07Merge branch 'pw/t5800-import-race-fix' into maintLibravatar Junio C Hamano1-0/+13
The test scaffolding for fast-import was flaky. By Pete Wyckoff * pw/t5800-import-race-fix: git-remote-testgit: fix race when spawning fast-import
2012-05-04checkout (detached): truncate list of orphaned commits at the new HEADLibravatar Johannes Sixt1-1/+1
When git checkout switches from a detached HEAD to any other commit, then all orphaned commits were listed in a warning: Warning: you are leaving 2 commits behind...: a5e5396 another fixup 6aa1af6 fixup foo But if the new commit is actually one from this list (6aa1af6 in this example), then the list in the warning can be truncated at the new HEAD, because history beginning at HEAD is not "left behind". This makes it so. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-04t2020-checkout-detach: check for the number of orphaned commitsLibravatar Johannes Sixt1-5/+16
Change the test that orphans commits to leave 2 commits behind. Add a test that leaves only one of these behind. The next patch will truncate the list of orphaned commits earlier. With this preliminary update, its effect will become more obvious. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-04reflog-walk: always make HEAD@{0} show indexed selectorsLibravatar Jeff King1-0/+8
When we are showing reflog selectors during a walk, we infer from context whether the user wanted to see the index in each selector, or the reflog date. The current rules are: 1. if the user asked for an explicit date format in the output, show the date 2. if the user asked for ref@{now}, show the date 3. if neither is true, show the index However, if we see "ref@{0}", that should be a strong clue that the user wants to see the counted version. In fact, it should be much stronger than the date format in (1). The user may have been setting the date format to use in another part of the output (e.g., in --format="%gd (%ad)", they may have wanted to influence the author date). This patch flips the rules to: 1. if the user asked for ref@{0}, always show the index 2. if the user asked for ref@{now}, always show the date 3. otherwise, we have just "ref"; show them counted by default, but respect the presence of "--date" as a clue that the user wanted them date-based Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-04log: respect date_mode_explicit with --format:%gdLibravatar Jeff King1-1/+1
When we show a reflog selector (e.g., via "git log -g"), we perform some DWIM magic: while we normally show the entry's index (e.g., HEAD@{1}), if the user has given us a date with "--date", then we show a date-based select (e.g., HEAD@{yesterday}). However, we don't want to trigger this magic if the alternate date format we got was from the "log.date" configuration; that is not sufficiently strong context for us to invoke this particular magic. To fix this, commit f4ea32f (improve reflog date/number heuristic, 2009-09-24) introduced a "date_mode_explicit" flag in rev_info. This flag is set only when we see a "--date" option on the command line, and we a vanilla date to the reflog code if the date was not explicit. Later, commit 8f8f547 (Introduce new pretty formats %g[sdD] for reflog information, 2009-10-19) added another way to show selectors, and it did not respect the date_mode_explicit flag from f4ea32f. This patch propagates the date_mode_explicit flag to the pretty-print code, which can then use it to pass the appropriate date field to the reflog code. This brings the behavior of "%gd" in line with the other formats, and means that its output is independent of any user configuration. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-04t1411: add more selector index/date testsLibravatar Jeff King1-0/+45
We already check that @{now} and "--date" cause the displayed selector to use the date for both the multiline and oneline formats. However, we miss several cases: 1. The --format=%gd selector is not tested at all. 2. We do not check how the log.date config interacts with the "--date" magic (according to f4ea32f, it should not impact the output). Doing so reveals that the combination of both (log.date combined with the %gd format) does not behave as expected. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-03Merge branch 'jc/merge-reduce-parents-early' into maintLibravatar Junio C Hamano3-8/+69
Octopus merge strategy did not reduce heads that are recorded in the final commit correctly. By Junio C Hamano (4) and Michał Kiedrowicz (1) * jc/merge-reduce-parents-early: fmt-merge-msg: discard needless merge parents builtin/merge.c: reduce parents early builtin/merge.c: collect other parents early builtin/merge.c: remove "remoteheads" global variable merge tests: octopus with redundant parents
2012-05-03Merge branch 'cb/http-multi-curl-auth' into maintLibravatar Junio C Hamano1-5/+10
HTTP transport that requires authentication did not work correctly when multiple connections are used simultaneously. By Jeff King (3) and Clemens Buchacher (1) * cb/http-multi-curl-auth: http: use newer curl options for setting credentials http: clean up leak in init_curl_http_auth fix http auth with multiple curl handles http auth fails with multiple curl handles
2012-05-03Merge branch 'mb/fetch-call-a-non-branch-a-ref' into maintLibravatar Junio C Hamano1-0/+30
The report from "git fetch" said "new branch" even for a non branch ref. By Marc Branchaud * mb/fetch-call-a-non-branch-a-ref: fetch: describe new refs based on where it came from fetch: Give remote_ref to update_local_ref() as well
2012-05-01Merge branch 'pw/fast-import-dataref-parsing' into maintLibravatar Junio C Hamano1-0/+287
The parser in "fast-import" did not diagnose ":9" style references that is not followed by required SP/LF as an error. By Pete Wyckoff * pw/fast-import-dataref-parsing: fast-import: tighten parsing of datarefs
2012-05-01Merge branch 'it/fetch-pack-many-refs' into maintLibravatar Junio C Hamano2-0/+97
When "git fetch" encounters repositories with too many references, the command line of "fetch-pack" that is run by a helper e.g. remote-curl, may fail to hold all of them. Now such an internal invocation can feed the references through the standard input of "fetch-pack". By Ivan Todoroski * it/fetch-pack-many-refs: remote-curl: main test case for the OS command line overflow fetch-pack: test cases for the new --stdin option remote-curl: send the refs to fetch-pack on stdin fetch-pack: new --stdin option to read refs from stdin Conflicts: t/t5500-fetch-pack.sh
2012-05-01Merge branch 'lp/maint-diff-three-dash-with-graph' into maintLibravatar Junio C Hamano1-0/+290
"log -p --graph" used with "--stat" had a few formatting error. By Lucian Poston * lp/maint-diff-three-dash-with-graph: t4202: add test for "log --graph --stat -p" separator lines log --graph: fix break in graph lines log --graph --stat: three-dash separator should come after graph lines
2012-05-01Merge branch 'jk/rebase-i-submodule-conflict-only' into maintLibravatar Junio C Hamano1-0/+30
Giving "--continue" to a conflicted "rebase -i" session skipped a commit that only results in changes to submodules. By John Keeping * jk/rebase-i-submodule-conflict-only: rebase -i continue: don't skip commits that only change submodules
2012-05-01t/gitweb-lib: use $PERL_PATH to run gitwebLibravatar Jeff King1-1/+1
The current code runs "perl gitweb.cgi" to test gitweb. This will use whatever version of perl happens to be first in the PATH. We are better off using the specific perl that the user specified via PERL_PATH, which matches what gets put on the #!-line of the built gitweb.cgi. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>