summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-09-03cache-tree: do not try to use an invalidated subtree info to build a treeLibravatar Junio C Hamano2-1/+14
We punt from repairing the cache-tree during a branch switching if it involves having to create a new tree object that does not yet exist in the object store. "mkdir dir && >dir/file && git add dir" followed by "git checkout" is one example, when a tree that records the state of such "dir/" is not in the object store. However, after discovering that we do not have a tree object that records the state of "dir/", the caller failed to remember the fact that it noticed the cache-tree entry it received for "dir/" is invalidated, it already knows it should not be populating the level that has "dir/" as its immediate subdirectory, and it is not an error at all for the sublevel cache-tree entry gave it a bogus object name it shouldn't even look at. This led the caller to detect and report a non-existent error. The end result was the same and we avoided stuffing a non-existent tree to the cache-tree, but we shouldn't have issued an alarming error message to the user. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-14cache-tree: Write updated cache-tree after commitLibravatar David Turner2-16/+119
During the commit process, update the cache-tree. Write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Make all tests test the entire cache-tree, not just the root level. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-11cache-tree: subdirectory testsLibravatar David Turner1-3/+23
Add tests to confirm that invalidation of subdirectories neither over- nor under-invalidates. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-08test-dump-cache-tree: invalid trees are not errorsLibravatar David Turner1-2/+2
Do not treat known-invalid trees as errors even when their subtree_nr is incorrect. Because git already knows that these trees are invalid, an incorrect subtree_nr will not cause problems. Add a couple of comments. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-07cache-tree: create/update cache-tree on checkoutLibravatar David Turner4-4/+36
When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. update_main_cache_tree learned a new flag, WRITE_TREE_REPAIR. When WRITE_TREE_REPAIR is set, portions of the cache-tree which do not correspond to existing tree objects are invalidated (and portions which do are marked as valid). No new tree objects are created. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-02Merge branch 'maint-1.8.5' into maintLibravatar Junio C Hamano3-4/+4
* maint-1.8.5: t7300: repair filesystem permissions with test_when_finished enums: remove trailing ',' after last item in enum
2014-07-02t7300: repair filesystem permissions with test_when_finishedLibravatar Jeff King1-2/+2
We create a directory that cannot be removed, confirm that it cannot be removed, and then fix it like: chmod 0 foo && test_must_fail git clean -d -f && chmod 755 foo If the middle step fails but leaves the directory (e.g., the bug is that clean does not notice the failure), this pollutes the test repo with an unremovable directory. Not only does this cause further tests to fail, but it means that "rm -rf" fails on the whole trash directory, and the user has to intervene manually to even re-run the test script. We can bump the "chmod 755" recovery to a test_when_finished block to be sure that it always runs. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-02enums: remove trailing ',' after last item in enumLibravatar Ronnie Sahlberg2-2/+2
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-25Git 2.0.1Libravatar Junio C Hamano4-3/+119
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-25Merge branch 'na/no-http-test-in-the-middle' into maintLibravatar Junio C Hamano2-59/+100
The mode to run tests with HTTP server tests disabled was broken. * na/no-http-test-in-the-middle: t5538: move http push tests out to t5542
2014-06-25Merge branch 'jl/status-added-submodule-is-never-ignored' into maintLibravatar Junio C Hamano5-8/+108
"git status" (and "git commit") behaved as if changes in a modified submodule are not there if submodule.*.ignore configuration is set, which was misleading. The configuration is only to unclutter diff output during the course of development, and should not to hide changes in the "status" output to cause the users forget to commit them. * jl/status-added-submodule-is-never-ignored: commit -m: commit staged submodules regardless of ignore config status/commit: show staged submodules regardless of ignore config
2014-06-25Merge branch 'ym/fix-opportunistic-index-update-race' into maintLibravatar Junio C Hamano6-5/+90
"git status", even though it is a read-only operation, tries to update the index with refreshed lstat(2) info to optimize future accesses to the working tree opportunistically, but this could race with a "read-write" operation that modify the index while it is running. Detect such a race and avoid overwriting the index. * ym/fix-opportunistic-index-update-race: read-cache.c: verify index file before we opportunistically update it wrapper.c: add xpread() similar to xread()
2014-06-25Merge branch 'mk/show-s-no-extra-blank-line-for-merges' into maintLibravatar Junio C Hamano4-11/+15
"git show -s" (i.e. show log message only) used to incorrectly emit an extra blank line after a merge commit. * mk/show-s-no-extra-blank-line-for-merges: git-show: fix 'git show -s' to not add extra terminator after merge commit
2014-06-25Merge branch 'rr/rebase-autostash-fix' into maintLibravatar Junio C Hamano3-3/+27
The autostash mode of "git rebase -i" did not restore the dirty working tree state if the user aborted the interactive rebase by emptying the insn sheet. * rr/rebase-autostash-fix: rebase -i: test "Nothing to do" case with autostash rebase -i: handle "Nothing to do" case with autostash
2014-06-25Merge branch 'jc/shortlog-ref-exclude' into maintLibravatar Junio C Hamano2-0/+7
"git log --exclude=<glob> --all | git shortlog" worked as expected, but "git shortlog --exclude=<glob> --all", which is supposed to be identical to the above pipeline, was not accepted at the command line argument parser level. * jc/shortlog-ref-exclude: shortlog: allow --exclude=<glob> to be passed
2014-06-25Merge branch 'jl/remote-rm-prune' into maintLibravatar Junio C Hamano3-9/+52
"git remote rm" and "git remote prune" can involve removing many refs at once, which is not a very efficient thing to do when very many refs exist in the packed-refs file. * jl/remote-rm-prune: remote prune: optimize "dangling symref" check/warning remote: repack packed-refs once when deleting multiple refs remote rm: delete remote configuration as the last
2014-06-25Merge branch 'fc/rerere-conflict-style' into maintLibravatar Junio C Hamano1-0/+2
"git rerere forget" did not work well when merge.conflictstyle was set to a non-default value. * fc/rerere-conflict-style: rerere: fix for merge.conflictstyle
2014-06-25Merge branch 'rs/pack-objects-no-unnecessary-realloc' into maintLibravatar Junio C Hamano1-2/+2
"git pack-objects" unnecessarily copied the previous contents when extending the hashtable, even though it will populate the table from scratch anyway. * rs/pack-objects-no-unnecessary-realloc: pack-objects: use free()+xcalloc() instead of xrealloc()+memset()
2014-06-25Merge branch 'dt/merge-recursive-case-insensitive' into maintLibravatar Junio C Hamano3-1/+61
On a case insensitive filesystem, merge-recursive incorrectly deleted the file that is to be renamed to a name that is the same except for case differences. * dt/merge-recursive-case-insensitive: mv: allow renaming to fix case on case insensitive filesystems merge-recursive.c: fix case-changing merge bug
2014-06-25Merge branch 'rs/mailinfo-header-cmp' into maintLibravatar Junio C Hamano1-3/+3
"git mailinfo" used to read beyond the end of header string while parsing an incoming e-mail message to extract the patch. * rs/mailinfo-header-cmp: mailinfo: use strcmp() for string comparison
2014-06-25Merge branch 'jk/index-pack-report-missing' into maintLibravatar Junio C Hamano1-2/+7
The error reporting from "git index-pack" has been improved to distinguish missing objects from type errors. * jk/index-pack-report-missing: index-pack: distinguish missing objects from type errors
2014-06-25Merge branch 'nd/index-pack-one-fd-per-thread' into maintLibravatar Junio C Hamano3-18/+17
We used to disable threaded "git index-pack" on platforms without thread-safe pread(); use a different workaround for such platforms to allow threaded "git index-pack". * nd/index-pack-one-fd-per-thread: index-pack: work around thread-unsafe pread()
2014-06-25Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i' into maintLibravatar Junio C Hamano1-0/+3
"git grep -O" to show the lines that hit in the pager did not work well with case insensitive search. We now spawn "less" with its "-I" option when it is used as the pager (which is the default). * sk/spawn-less-case-insensitively-from-grep-O-i: git grep -O -i: if the pager is 'less', pass the '-I' option
2014-06-25Merge branch 'nd/daemonize-gc' into maintLibravatar Junio C Hamano1-6/+20
"git gc --auto" was recently changed to run in the background to give control back early to the end-user sitting in front of the terminal, but it forgot that housekeeping involving reflogs should be done without other processes competing for accesses to the refs. * nd/daemonize-gc: gc --auto: do not lock refs in the background
2014-06-25Merge branch 'jk/diff-follow-must-take-one-pathspec' into maintLibravatar Junio C Hamano2-6/+5
"git format-patch" did not enforce the rule that the "--follow" option from the log/diff family of commands must be used with exactly one pathspec. * jk/diff-follow-must-take-one-pathspec: move "--follow needs one pathspec" rule to diff_setup_done
2014-06-25Merge branch 'jk/diff-files-assume-unchanged' into maintLibravatar Junio C Hamano2-12/+32
"git diff --find-copies-harder" sometimes pretended as if the mode bits have changed for paths that are marked with assume-unchanged bit. * jk/diff-files-assume-unchanged: run_diff_files: do not look at uninitialized stat data
2014-06-25Merge branch 'jk/commit-C-pick-empty' into maintLibravatar Junio C Hamano2-4/+12
"git commit --allow-empty-message -C $commit" did not work when the commit did not have any log message. * jk/commit-C-pick-empty: commit: do not complain of empty messages from -C
2014-06-25Merge branch 'bc/blame-crlf-test' into maintLibravatar Junio C Hamano2-1/+9
"git blame" assigned the blame to the copy in the working-tree if the repository is set to core.autocrlf=input and the file used CRLF line endings. * bc/blame-crlf-test: blame: correctly handle files regardless of autocrlf
2014-06-25Merge branch 'jx/blame-align-relative-time' into maintLibravatar Junio C Hamano1-8/+22
"git blame" miscounted number of columns needed to show localized timestamps, resulting in jaggy left-side-edge of the source code lines in its output. * jx/blame-align-relative-time: blame: dynamic blame_date_width for different locales blame: fix broken time_buf paddings in relative timestamp
2014-06-25Merge branch 'jc/apply-ignore-whitespace' into maintLibravatar Junio C Hamano2-13/+11
"--ignore-space-change" option of "git apply" ignored the spaces at the beginning of line too aggressively, which is inconsistent with the option of the same name "diff" and "git diff" have. * jc/apply-ignore-whitespace: apply --ignore-space-change: lines with and without leading whitespaces do not match
2014-06-25Merge branch 'jk/complete-merge-pull' into maintLibravatar Junio C Hamano1-1/+5
The completion scripts (in contrib/) did not know about quite a few options that are common between "git merge" and "git pull", and a couple of options unique to "git merge". * jk/complete-merge-pull: completion: add missing options for git-merge completion: add a note that merge options are shared
2014-06-25Merge branch 'ow/config-mailmap-pathname' into maintLibravatar Junio C Hamano1-1/+1
The "mailmap.file" configuration option did not support the tilde expansion (i.e. ~user/path and ~/path). * ow/config-mailmap-pathname: config: respect '~' and '~user' in mailmap.file
2014-06-25Merge branch 'as/pretty-truncate' into maintLibravatar Junio C Hamano5-72/+282
The "%<(10,trunc)%s" pretty format specifier in the log family of commands is used to truncate the string to a given length (e.g. 10 in the example) with padding to column-align the output, but did not take into account that number of bytes and number of display columns are different. * as/pretty-truncate: pretty.c: format string with truncate respects logOutputEncoding t4205, t6006: add tests that fail with i18n.logOutputEncoding set t4205 (log-pretty-format): use `tformat` rather than `format` t4041, t4205, t6006, t7102: don't hardcode tested encoding value t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
2014-06-25Merge branch 'jc/revision-dash-count-parsing' into maintLibravatar Junio C Hamano1-2/+4
"git log -2master" is a common typo that shows two commits starting from whichever random branch that is not 'master' that happens to be checked out currently. * jc/revision-dash-count-parsing: revision: parse "git log -<count>" more carefully
2014-06-25Merge branch 'jk/report-fail-to-read-objects-better' into maintLibravatar Junio C Hamano1-1/+5
Reworded the error message given upon a failure to open an existing loose object file due to e.g. permission issues; it was reported as the object being corrupt, but that is not quite true. * jk/report-fail-to-read-objects-better: open_sha1_file: report "most interesting" errno
2014-06-25Merge branch 'mn/sideband-no-ansi' into maintLibravatar Junio C Hamano1-1/+1
Tools that read diagnostic output in our standard error stream do not want to see terminal control sequence (e.g. erase-to-eol). Detect them by checking if the standard error stream is connected to a tty. * mn/sideband-no-ansi: sideband.c: do not use ANSI control sequence on non-terminal
2014-06-25Merge branch 'je/pager-do-not-recurse' into maintLibravatar Junio C Hamano1-1/+1
We used to unconditionally disable the pager in the pager process we spawn to feed out output, but that prevented people who want to run "less" within "less" from doing so. * je/pager-do-not-recurse: pager: do allow spawning pager recursively
2014-06-12Merge branch 'jc/rev-parse-argh-dashed-multi-words' into maintLibravatar Junio C Hamano2-0/+7
* jc/rev-parse-argh-dashed-multi-words: update-index: fix segfault with missing --cacheinfo argument
2014-06-12pull: do not abuse 'break' inside a shell 'case'Libravatar Jacek Konieczny1-2/+0
It is not C. The code would break under mksh when 'pull.ff' is set: $ git pull /usr/lib/git-core/git-pull[67]: break: can't break Already up-to-date. Signed-off-by: Jacek Konieczny <jajcus@jajcus.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-09revision: parse "git log -<count>" more carefullyLibravatar Junio C Hamano1-2/+4
This mistyped command line simply ignores "master" and ends up showing two commits from the current HEAD: $ git log -2master because we feed "2master" to atoi() without making sure that the whole string is parsed as an integer. Use the strtol_i() helper function instead. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-04shortlog: allow --exclude=<glob> to be passedLibravatar Junio C Hamano2-0/+7
These two commands are supposed to be equivalent: $ git log --exclude=refs/notes/\* --all --no-merges --since=2.days | git shortlog $ git shortlog --exclude=refs/notes/\* --all --no-merges --since=2.days However, the latter does not understand the ref-exclusion command line option, even though other options understood by "log", such as "--all" and "--no-merges", are understood. This was because e7b432c5 (revision: introduce --exclude=<glob> to tame wildcards, 2013-08-30) did not wire the new option fully to the machinery. A new option understood by handle_revision_pseudo_opt() must be told to handle_revision_opt() as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-04update-index: fix segfault with missing --cacheinfo argumentLibravatar Jeff King2-0/+7
Running "git update-index --cacheinfo" without any further arguments results in a segfault rather than an error message. Commit ec160ae (update-index: teach --cacheinfo a new syntax "mode,sha1,path", 2014-03-23) added code to examine the format of the argument, but forgot to handle the NULL case. Returning an error from the parser is enough, since we then treat it as an old-style "--cacheinfo <mode> <sha1> <path>", and complain that we have less than 3 arguments to read. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-02pack-objects: use free()+xcalloc() instead of xrealloc()+memset()Libravatar René Scharfe1-2/+2
Whenever the hash table becomes too small then its size is increased, the original part (and the added space) is zerod out using memset(), and the table is rebuilt from scratch. Simplify this proceess by returning the old memory using free() and allocating the new buffer using xcalloc(), which already clears the buffer for us. That way we avoid copying the old hash table contents needlessly inside xrealloc(). While at it, use the first array member with sizeof instead of a specific type. The old code used uint32_t and int, while index is actually an array of int32_t. Their sizes are the same basically everywhere, so it's not actually a problem, but the new code is cleaner and doesn't have to be touched should the type be changed. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-02mailinfo: use strcmp() for string comparisonLibravatar René Scharfe1-3/+3
The array header is defined as: static const char *header[MAX_HDR_PARSED] = { "From","Subject","Date", }; When looking for the index of a specfic string in that array, simply use strcmp() instead of memcmp(). This avoids running over the end of the string (e.g. with memcmp("Subject", "From", 7)) and gets rid of magic string length constants. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-02sideband.c: do not use ANSI control sequence on non-terminalLibravatar Michael Naumov1-1/+1
Diagnostic messages received on the sideband #2 from the server side are sent to the standard error with ANSI terminal control sequence "\033[K" that erases to the end of line appended at the end of each line. However, some programs (e.g. GitExtensions for Windows) read and interpret and/or show the message without understanding the terminal control sequences, resulting them to be shown to their end users. To help these programs, squelch the control sequence when the standard error stream is not being sent to a tty. NOTE: I considered to cover the case that a pager has already been started. But decided that is probably not worth worrying about here, though, as we shouldn't be using a pager for commands that do network communications (and if we do, omitting the magic line-clearing signal is probably a sane thing to do). Thanks-to: Erik Faye-Lund <kusmabite@gmail.com> Thanks-to: Jeff King <peff@peff.net> Signed-off-by: Michael Naumov <mnaoumov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-30t5538: move http push tests out to t5542Libravatar Nick Alcock2-59/+100
As 0232852b, but for the push tests instead: this avoids a start_httpd in the middle of the file, which fails under GIT_TEST_HTTPD=false. Note that we have to munge the test in a few ways while moving it: 1. We drop the `test -z "$GIT_TEST_HTTPD"` check; this is too simplistic since 83d842d, and we should let lib-httpd.sh handle it. 2. We have to port over some of the old setup from t5538. 3. In the final test, we no longer expect the extra commit "1" built on top of "4". This was a side effect from an earlier test in t5538 which was not ported over. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-30Sync with 1.9.4Libravatar Junio C Hamano2-1/+18
2014-05-30Git 1.9.4Libravatar Junio C Hamano4-3/+20
This is expected to be the final maintenance release for 1.9 series, merging the remaining fixes that are relevant and are already in 2.0. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-30t5537: re-drop http testsLibravatar Jeff King1-28/+0
These were originally removed by 0232852 (t5537: move http tests out to t5539, 2014-02-13). However, they were accidentally re-added in 1ddb4d7 (Merge branch 'nd/upload-pack-shallow', 2014-03-21). This looks like an error in manual conflict resolution. Here's what happened: 1. v1.9.0 shipped with the http tests in t5537. 2. We realized that this caused problems, and built 0232852 on top to move the tests to their own file. This fix made it into v1.9.1. 3. We later had another fix in nd/upload-pack-shallow that also touched t5537. It was built directly on v1.9.0. When we merged nd/upload-pack-shallow to master, we got a conflict; it was built on a version with the http tests, but we had since removed them. The correct resolution was to drop the http tests and keep the new ones, but instead we kept everything. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-28Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maintLibravatar Junio C Hamano2-20/+42
* rh/prompt-pcmode-avoid-eval-on-refname: git-prompt.sh: don't assume the shell expands the value of PS1