summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-03Merge branch 'jk/check-corrupt-objects-carefully'Libravatar Junio C Hamano6-18/+174
Have the streaming interface and other codepaths more carefully examine for corrupt objects. * jk/check-corrupt-objects-carefully: clone: leave repo in place after checkout errors clone: run check_everything_connected clone: die on errors from unpack_trees add tests for cloning corrupted repositories streaming_write_entry: propagate streaming errors add test for streaming corrupt blobs avoid infinite loop in read_istream_loose read_istream_filtered: propagate read error from upstream check_sha1_signature: check return value from read_istream stream_blob_to_fd: detect errors reading from stream
2013-04-03Merge branch 'jc/apply-ws-fix-tab-in-indent'Libravatar Junio C Hamano4-7/+41
"git apply --whitespace=fix" was not prepared to see a line getting longer after fixing whitespaces (e.g. tab-in-indent aka Python). * jc/apply-ws-fix-tab-in-indent: test: resurrect q_to_tab apply --whitespace=fix: avoid running over the postimage buffer
2013-04-03Merge branch 'jk/difftool-no-overwrite-on-copyback'Libravatar Junio C Hamano2-51/+139
Try to be careful when difftool backend allows the user to write into the temporary files being shown *and* the user makes changes to the working tree at the same time. One of the changes has to be lost in such a case, but at least tell the user what he did. * jk/difftool-no-overwrite-on-copyback: t7800: run --dir-diff tests with and without symlinks t7800: fix tests when difftool uses --no-symlinks t7800: don't hide grep output difftool: don't overwrite modified files t7800: move '--symlinks' specific test to the end
2013-04-03Merge branch 'jc/directory-attrs-regression-fix'Libravatar Junio C Hamano3-19/+91
Fix 1.8.1.x regression that stopped matching "dir" (without trailing slash) to a directory "dir". * jc/directory-attrs-regression-fix: t: check that a pattern without trailing slash matches a directory dir.c::match_pathname(): pay attention to the length of string parameters dir.c::match_pathname(): adjust patternlen when shifting pattern dir.c::match_basename(): pay attention to the length of string parameters attr.c::path_matches(): special case paths that end with a slash attr.c::path_matches(): the basename is part of the pathname
2013-04-03Merge branch 'nd/checkout-paths-reduce-match-pathspec-calls'Libravatar Junio C Hamano5-8/+80
Consolidate repeated pathspec matches on the same paths, while fixing a bug in "git checkout dir/" code started from an unmerged index. * nd/checkout-paths-reduce-match-pathspec-calls: checkout: avoid unnecessary match_pathspec calls
2013-04-02Update draft release notes to 1.8.3Libravatar Junio C Hamano1-0/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02Merge branch 'jk/config-with-empty-section'Libravatar Junio C Hamano1-0/+35
Document that "git config --unset" does not remove an empty section head after removing the last variable in a section, and adding a new variable does not try to reuse a leftover empty section head. * jk/config-with-empty-section: t1300: document some aesthetic failures of the config editor
2013-04-02Merge branch 'js/log-gpg'Libravatar Junio C Hamano1-0/+3
Teach "show/log" honor gpg.program configuration just like other parts of the code that use GnuPG. * js/log-gpg: log: read gpg settings for signed commit verification
2013-04-02Merge branch 'tr/log-tree-optim'Libravatar Junio C Hamano1-3/+10
Optimize "log" that shows the difference between the parent and the child. * tr/log-tree-optim: Avoid loading commits twice in log with diffs
2013-04-02Merge branch 'tb/cygwin-shared-repository'Libravatar Junio C Hamano4-3/+36
Cygwin port has a faster-but-lying lstat(2) emulation whose incorrectness does not matter in practice except for a few codepaths, and setting permission bits to directories is a codepath that needs to use a more correct one. * tb/cygwin-shared-repository: Make core.sharedRepository work under cygwin 1.7
2013-04-02Merge branch 'sw/safe-create-leading-dir-race'Libravatar Junio C Hamano1-2/+7
* sw/safe-create-leading-dir-race: safe_create_leading_directories: fix race that could give a false negative
2013-04-02Merge branch 'bk/document-commit-tree-S'Libravatar Junio C Hamano2-2/+7
* bk/document-commit-tree-S: commit-tree: document -S option consistently
2013-04-02Merge branch 'jk/no-more-self-assignment'Libravatar Junio C Hamano2-47/+34
This started as a topic to reduce "type var = var" self assignment tricks that were used to squelch "variable used uninitialized perhaps?" warning from some compilers, but resulted in rewriting logic with a version that is simpler and easier to understand for humans. * jk/no-more-self-assignment: match-trees: simplify score_trees() using tree_entry() submodule: clarify logic in show_submodule_summary
2013-04-01Update draft release notes to 1.8.3Libravatar Junio C Hamano1-2/+28
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01Merge branch 'maint'Libravatar Junio C Hamano1-0/+4
* maint: Update draft release notes to 1.8.2.1
2013-04-01Update draft release notes to 1.8.2.1Libravatar Junio C Hamano1-0/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01Merge branch 'ap/maint-diff-rename-avoid-overlap' into maintLibravatar Junio C Hamano2-1/+67
* ap/maint-diff-rename-avoid-overlap: tests: make sure rename pretty print works diff: prevent pprint_rename from underrunning input diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-01Merge branch 'rr/tests-dedup-test-config' into maintLibravatar Junio C Hamano2-10/+0
* rr/tests-dedup-test-config: t4018,7810,7811: remove test_config() redefinition
2013-04-01Merge branch 'yd/doc-is-in-asciidoc' into maintLibravatar Junio C Hamano1-0/+3
* yd/doc-is-in-asciidoc: CodingGuidelines: our documents are in AsciiDoc
2013-04-01Merge branch 'yd/doc-merge-annotated-tag' into maintLibravatar Junio C Hamano2-1/+26
* yd/doc-merge-annotated-tag: Documentation: merging a tag is a special case
2013-04-01Merge branch 'tb/document-status-u-tradeoff' into maintLibravatar Junio C Hamano9-4/+46
* tb/document-status-u-tradeoff: status: advise to consider use of -u when read_directory takes too long git status: document trade-offs in choosing parameters to the -u option
2013-04-01Merge branch 'da/downcase-u-in-usage' into maintLibravatar Junio C Hamano25-82/+82
* da/downcase-u-in-usage: contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string contrib/examples/git-remote.perl: use a lowercase "usage:" string tests: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string contrib/examples: use a lowercase "usage:" string contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-sh-setup: use a lowercase "usage:" string
2013-04-01Merge branch 'nd/index-pack-threaded-fixes'Libravatar Junio C Hamano1-8/+26
"index-pack --verify-stat" used a few counters outside protection of mutex, possibly showing incorrect numbers. * nd/index-pack-threaded-fixes: index-pack: guard nr_resolved_deltas reads by lock index-pack: protect deepest_delta in multithread code
2013-04-01Merge branch 'jk/index-pack-correct-depth-fix'Libravatar Junio C Hamano1-0/+2
"index-pack --fix-thin" used uninitialize value to compute delta depths of objects it appends to the resulting pack. * jk/index-pack-correct-depth-fix: index-pack: always zero-initialize object_entry list
2013-04-01Merge branch 'jn/push-tests'Libravatar Junio C Hamano1-91/+65
Update t5516 with style fixes. * jn/push-tests: push test: rely on &&-chaining instead of 'if bad; then echo Oops; fi' push test: simplify check of push result push test: use test_config when appropriate
2013-04-01Merge branch 'nd/branch-show-rebase-bisect-state'Libravatar Junio C Hamano7-91/+216
Add a bit more information to "git status" during a rebase/bisect session. * nd/branch-show-rebase-bisect-state: status, branch: fix the misleading "bisecting" message branch: show more information when HEAD is detached status: show more info than "currently not on any branch" wt-status: move wt_status_get_state() out to wt_status_print() wt-status: split wt_status_state parsing function out wt-status: move strbuf into read_and_strip_branch()
2013-04-01Merge branch 'jc/nobody-sets-src-peer-ref'Libravatar Junio C Hamano1-3/+0
Dead code removal. * jc/nobody-sets-src-peer-ref: match_push_refs(): nobody sets src->peer_ref anymore
2013-04-01Merge branch 'jc/remove-export-from-config-mak-in'Libravatar Junio C Hamano1-6/+0
Stop exporting mandir that used to be exported only when config.mak.autogen was used. It would have broken installation of manpages (but not other documentation formats). * jc/remove-export-from-config-mak-in: Fix `make install` when configured with autoconf Makefile: do not export mandir/htmldir/infodir config.mak.in: remove unused definitions
2013-04-01Merge branch 'kb/name-hash'Libravatar Junio C Hamano4-62/+166
The code to keep track of what directory names are known to Git on platforms with case insensitive filesystems can get confused upon a hash collision between these pathnames and looped forever. * kb/name-hash: name-hash.c: fix endless loop with core.ignorecase=true
2013-04-01Merge branch 'jk/common-make-variables-export-safety'Libravatar Junio C Hamano1-15/+21
Make the three variables safer to be exported to submakes by ensuring that they are full paths so that they can be used as installation location. * jk/common-make-variables-export-safety: Makefile: make mandir, htmldir and infodir absolute
2013-04-01Merge branch 'jk/pkt-line-cleanup'Libravatar Junio C Hamano22-365/+338
Clean up pkt-line API, implementation and its callers to make them more robust. * jk/pkt-line-cleanup: do not use GIT_TRACE_PACKET=3 in tests remote-curl: always parse incoming refs remote-curl: move ref-parsing code up in file remote-curl: pass buffer straight to get_remote_heads teach get_remote_heads to read from a memory buffer pkt-line: share buffer/descriptor reading implementation pkt-line: provide a LARGE_PACKET_MAX static buffer pkt-line: move LARGE_PACKET_MAX definition from sideband pkt-line: teach packet_read_line to chomp newlines pkt-line: provide a generic reading function with options pkt-line: drop safe_write function pkt-line: move a misplaced comment write_or_die: raise SIGPIPE when we get EPIPE upload-archive: use argv_array to store client arguments upload-archive: do not copy repo name send-pack: prefer prefixcmp over memcmp in receive_status fetch-pack: fix out-of-bounds buffer offset in get_ack upload-pack: remove packet debugging harness upload-pack: do not add duplicate objects to shallow list upload-pack: use get_sha1_hex to parse "shallow" lines
2013-04-01Merge branch 'bc/append-signed-off-by'Libravatar Junio C Hamano10-156/+650
Consolidate codepaths that inspect log-message-to-be and decide to add a new Signed-off-by line in various commands. * bc/append-signed-off-by: git-commit: populate the edit buffer with 2 blank lines before s-o-b Unify appending signoff in format-patch, commit and sequencer format-patch: update append_signoff prototype t4014: more tests about appending s-o-b lines sequencer.c: teach append_signoff to avoid adding a duplicate newline sequencer.c: teach append_signoff how to detect duplicate s-o-b sequencer.c: always separate "(cherry picked from" from commit body sequencer.c: require a conforming footer to be preceded by a blank line sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer t/t3511: add some tests of 'cherry-pick -s' functionality t/test-lib-functions.sh: allow to specify the tag name to test_commit commit, cherry-pick -s: remove broken support for multiline rfc2822 fields sequencer.c: rework search for start of footer to improve clarity
2013-04-01Merge branch 'sr/am-show-final-message-in-applying-indicator'Libravatar Junio C Hamano1-7/+7
In addition to the case where the user edits the log message with the "e)dit" option of "am -i", replace the "Applying: this patch" message with the final log message contents after applymsg hook munges it. * sr/am-show-final-message-in-applying-indicator: git-am: show the final log message on "Applying:" indicator
2013-04-01Merge branch 'rr/test-3200-style'Libravatar Junio C Hamano1-253/+267
Churns. * rr/test-3200-style: t3200 (branch): modernize style
2013-03-31Merge branch 'maint'Libravatar Junio C Hamano2-1/+2
* maint: cat-file: Fix an gcc -Wuninitialized warning fast-import: Fix an gcc -Wuninitialized warning
2013-03-29cat-file: Fix an gcc -Wuninitialized warningLibravatar Ramsay Jones1-1/+1
After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks", 21-03-2013) removed a gcc specific hack, older versions of gcc now issue an "'contents' might be used uninitialized" warning. In order to suppress the warning, we simply initialize the variable to NULL in it's declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29fast-import: Fix an gcc -Wuninitialized warningLibravatar Ramsay Jones1-0/+1
Commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks", 21-03-2013) removed a gcc hack that suppressed an "might be used uninitialized" warning issued by older versions of gcc. However, commit 3aa99df8 ('fast-import: clarify "inline" logic in file_change_m', 21-03-2013) addresses an (almost) identical issue (with very similar code), but includes additional code in it's resolution. The solution used by this commit, unlike that used by commit cbfd5e1c, also suppresses the -Wuninitialized warning on older versions of gcc. In order to suppress the warning (against the 'oe' symbol) in the note_change_n() function, we adopt the same solution used by commit 3aa99df8. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29clone: leave repo in place after checkout errorsLibravatar Jeff King2-1/+28
If we manage to clone a remote repository but run into an error in the checkout, it is probably sane to leave the repo directory in place. That lets the user examine the situation without spending time to re-clone from the remote (which may be a lengthy process). Rather than try to convert each die() from the checkout code path into an error(), we simply set a flag that tells the "remove_junk" atexit function to print a helpful message and leave the repo in place. Note that the test added in this patch actually passes without the code change. The reason is that the cleanup code is buggy; we chdir into the working tree for the checkout, but still may use relative paths to remove the directories (which means if you cloned into "foo", we would accidentally remove "foo" from the working tree!). There's no point in fixing it now, since this patch means we will never try to remove anything after the chdir, anyway. [jc: replaced the message with a more succinct version from Jonathan] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29t7800: run --dir-diff tests with and without symlinksLibravatar John Keeping1-8/+19
Currently the difftool --dir-diff tests may or may not use symlinks depending on the operating system on which they are run. In one case this has caused a test failure to be noticed only on Windows when the test also fails on Linux when difftool is invoked with --no-symlinks. Rewrite these tests so that they do not depend on the environment but run explicitly with both --symlinks and --no-symlinks, protecting the --symlinks version with a SYMLINKS prerequisite. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29t7800: fix tests when difftool uses --no-symlinksLibravatar John Keeping1-1/+1
When 'git difftool --dir-diff' is using --no-symlinks (either explicitly or implicitly because it's running on Windows), any working tree files that have been copied to the temporary directory are copied back after the difftool completes. Because an earlier test uses "git add .", the "output" file used by tests is tracked by Git and the following sequence occurs during some tests: 1) the shell opens "output" to redirect the difftool output 2) difftool copies the empty "output" to the temporary directory 3) difftool runs "ls" which writes to "output" 4) difftool copies the empty "output" file back over the output of the command 5) the output file doesn't contain the expected output, causing the test to fail Instead of adding all changes, explicitly add only the files that the test is using, allowing later tests to write their result files into the working tree. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29t7800: don't hide grep outputLibravatar John Keeping1-27/+17
Remove the stdin_contains and stdin_doesnt_contain helper functions which add nothing but hide the output of grep, hurting debugging. Suggested-by: Johannes Sixt <j.sixt@viscovery.net> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29difftool: don't overwrite modified filesLibravatar John Keeping2-14/+101
After running the user's diff tool, git-difftool will copy any files that differ between the working tree and the temporary tree. This is useful when the user edits the file in their diff tool but is wrong if they edit the working tree file while examining the diff. Instead of copying unconditionally when the files differ, create and index from the working tree files and only copy the temporary file back if it was modified and the working tree file was not. If both files have been modified, print a warning and exit with an error. Note that we cannot use an existing index in git-difftool since those contain the modified files that need to be checked out but here we are looking at those files which are copied from the working tree and not checked out. These are precisely the files which are not in the existing indices. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29t1300: document some aesthetic failures of the config editorLibravatar Jeff King1-0/+35
The config-editing code used by "git config var value" is built around the regular config callback parser, whose only triggerable item is an actual key. As a result, it does not know anything about section headers, which can result in unnecessarily ugly output: 1. When we delete the last key in a section, we should be able to delete the section header. 2. When we add a key into a section, we should be able to reuse the same section header, even if that section did not have any keys in it already. Unfortunately, fixing these is not trivial with the current code. It would involve the config parser recording and passing back information on each item it finds, including headers, keys, and even comments (or even better, generating an actual in-memory parse-tree). Since these behaviors do not cause any functional problems (i.e., the resulting config parses as expected, it is just uglier than one would like), fixing them can wait until somebody feels like substantially refactoring the parsing code. In the meantime, let's document them as known issues with some tests. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29test: resurrect q_to_tabLibravatar Junio C Hamano1-0/+4
New test may want to use this helper; keep it for them that do not need to protect literal SP. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29t7800: move '--symlinks' specific test to the endLibravatar John Keeping1-15/+15
This will group the tests more logically when we introduce a helper to run most --dir-diff tests with both --symlinks and --no-symlinks. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28t: check that a pattern without trailing slash matches a directoryLibravatar Jeff King1-0/+27
Prior to v1.8.1.1, with: git init echo content >foo && mkdir subdir && echo content >subdir/bar && echo "subdir export-ignore" >.gitattributes git add . && git commit -m one && git archive HEAD | tar tf - the resulting archive would contain only "foo" and ".gitattributes", not subdir. This was broken with a recent change that intended to allow "subdir/ export-ignore" to also exclude the directory, but instead ended up _requiring_ the trailing slash by mistake. A pattern "subdir" should match any path "subdir", whether it is a directory or a non-directory. A pattern "subdir/" insists that a path "subdir" must be a directory for it to match. This patch adds test not just for this simple case, but also for deeper cross-directory cases, as well as cases with wildcards. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28dir.c::match_pathname(): pay attention to the length of string parametersLibravatar Jeff King1-1/+12
This function takes two counted strings: a <pattern, patternlen> pair and a <pathname, pathlen> pair. But we end up feeding the result to fnmatch, which expects NUL-terminated strings. We can fix this by calling the fnmatch_icase_mem function, which handles re-allocating into a NUL-terminated string if necessary. While we're at it, we can avoid even calling fnmatch in some cases. In addition to patternlen, we get "prefix", the size of the pattern that contains no wildcard characters. We do a straight match of the prefix part first, and then use fnmatch to cover the rest. But if there are no wildcards in the pattern at all, we do not even need to call fnmatch; we would simply be comparing two empty strings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28dir.c::match_pathname(): adjust patternlen when shifting patternLibravatar Jeff King1-0/+1
If we receive a pattern that starts with "/", we shift it forward to avoid looking at the "/" part. Since the prefix and patternlen parameters are counts of what is in the pattern, we must decrement them as we increment the pointer. We remembered to handle prefix, but not patternlen. This didn't cause any bugs, though, because the patternlen parameter is not actually used. Since it will be used in future patches, let's correct this oversight. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28dir.c::match_basename(): pay attention to the length of string parametersLibravatar Junio C Hamano1-4/+36
The function takes two counted strings (<basename, basenamelen> and <pattern, patternlen>) as parameters, together with prefix (the length of the prefix in pattern that is to be matched literally without globbing against the basename) and EXC_* flags that tells it how to match the pattern against the basename. However, it did not pay attention to the length of these counted strings. Update them to do the following: * When the entire pattern is to be matched literally, the pattern matches the basename only when the lengths of them are the same, and they match up to that length. * When the pattern is "*" followed by a string to be matched literally, make sure that the basenamelen is equal or longer than the "literal" part of the pattern, and the tail of the basename string matches that literal part. * Otherwise, use the new fnmatch_icase_mem helper to make sure we only lookmake sure we use only look at the counted part of the strings. Because these counted strings are full strings most of the time, we check for termination to avoid unnecessary allocation. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28attr.c::path_matches(): special case paths that end with a slashLibravatar Junio C Hamano1-4/+4
The function is given a string that ends with a slash to signal that the path is a directory to make sure that a pattern that ends with a slash (i.e. MUSTBEDIR) can tell directories and non-directories apart. However, the pattern itself (pat->pattern and pat->patternlen) that came from such a MUSTBEDIR pattern is represented as a string that ends with a slash, but patternlen does not count that trailing slash. A MUSTBEDIR pattern "element/" is represented as a counted string <"element/", 7> and this must match match pathname "element/". Because match_basename() and match_pathname() want to see pathname "element" to match against the pattern <"element/", 7>, reduce the length of the path to exclude the trailing slash when calling these functions. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>