summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-18cache-tree.c: fix i-t-a entry skipping directory updates sometimesNguyễn Thái Ngọc Duy
Commit 3cf773e (cache-tree: fix writing cache-tree when CE_REMOVE is present - 2012-12-16) skips i-t-a entries when building trees objects from the index. Unfortunately it may skip too much. The code in question checks if an entry is an i-t-a one, then no tree entry will be written. But it does not take into account that directories can also be written with the same code. Suppose we have this in the index. a-file subdir/file1 subdir/file2 subdir/file3 the-last-file We write an entry for a-file as normal and move on to subdir/file1, where we realize the entry name for this level is simply just "subdir", write down an entry for "subdir" then jump three items ahead to the-last-file. That is what happens normally when the first file in subdir is not an i-t-a entry. If subdir/file1 is an i-t-a, because of the broken condition in this code, we still think "subdir" is an i-t-a file and not writing "subdir" down and jump to the-last-file. The result tree now only has two items: a-file and the-last-file. subdir should be there too (even though it only records two sub-entries, file2 and file3). If the i-t-a entry is subdir/file2 or subdir/file3, this is not a problem because we jump over them anyway. Which may explain why the bug is hidden for nearly four years. Fix it by making sure we only skip i-t-a entries when the entry in question is actual an index entry, not a directory. Reported-by: Yuri Kanivetsky <yuri.kanivetsky@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-18test-lib.sh: introduce and use $EMPTY_BLOBNguyễn Thái Ngọc Duy
Similar to $EMPTY_TREE this makes it easier to recognize this special SHA-1 and change hash later. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-18test-lib.sh: introduce and use $EMPTY_TREENguyễn Thái Ngọc Duy
This is a special SHA1. Let's keep it at one place, easier to replace later when the hash change comes, easier to recognize. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13Git 2.9v2.9.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13Merge tag 'l10n-2.9.0-rc0' of git://github.com/git-l10n/git-poJunio C Hamano
l10n-2.9.0-rc0 * tag 'l10n-2.9.0-rc0' of git://github.com/git-l10n/git-po: l10n: ko.po: Update Korean translation l10n: ru.po: update Russian translation l10n: de.po: translate 104 new messages l10n: zh_CN: review for git v2.9.0 l10n round 1 l10n: zh_CN: for git v2.9.0 l10n round 1 l10n: pt_PT: update Portuguese translation l10n: pt_PT: update according to git-gui glossary l10n: pt_PT: merge git.pot file l10n: Updated Bulgarian translation of git (2597t,0f,0u) l10n: sv.po: Update Swedish translation (2597t0f0u) l10n: fr.po v2.9.0rnd1 l10n: Updated Vietnamese translation (2597t) l10n: git.pot: v2.9.0 round 1 (104 new, 37 removed) l10n: fr.po Fixed grammar mistake
2016-06-11l10n: ko.po: Update Korean translationChangwoo Ryu
2016-06-11Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ruJiang Xin
* 'russian-l10n' of https://github.com/DJm00n/git-po-ru: l10n: ru.po: update Russian translation
2016-06-11l10n: ru.po: update Russian translationDimitriy Ryazantcev
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2016-06-10Hopefully the final last-minute update before 2.9 finalJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10Merge branch 'jk/diff-compact-heuristic'Junio C Hamano
It turns out that the earlier effort to update the heuristics may want to use a bit more time to mature. Turn it off by default. * jk/diff-compact-heuristic: diff: disable compaction heuristic for now
2016-06-10Merge branch 'jk/shell-portability'Junio C Hamano
test fixes. * jk/shell-portability: t5500 & t7403: lose bash-ism "local" test-lib: add in-shell "env" replacement
2016-06-10Merge branch 'jc/t2300-setup'Junio C Hamano
A test fix. * jc/t2300-setup: t2300: run git-sh-setup in an environment that better mimics the real life
2016-06-10diff: disable compaction heuristic for nowJunio C Hamano
http://lkml.kernel.org/g/20160610075043.GA13411@sigill.intra.peff.net reports that a change to add a new "function" with common ending with the existing one at the end of the file is shown like this: def foo do_foo_stuff() + common_ending() +end + +def bar + do_bar_stuff() + common_ending() end when the new heuristic is in use. In reality, the change is to add the blank line before "def bar" and everything below, which is what the code without the new heuristic shows. Disable the heuristics by default, and resurrect the documentation for the option and the configuration variables, while clearly marking the feature as still experimental. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10l10n: de.po: translate 104 new messagesRalf Thielow
Translate 104 new messages came from git.pot update in f517e50 (l10n: git.pot: v2.9.0 round 1 (104 new, 37 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2016-06-09l10n: zh_CN: review for git v2.9.0 l10n round 1Ray Chen
Signed-off-by: Ray Chen <oldsharp@gmail.com> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-06-06Git 2.9-rc2v2.9.0-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06Sync with 2.8.4Junio C Hamano
* maint: Git 2.8.4
2016-06-06Git 2.8.4v2.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06Merge branch 'kb/msys2-tty' into maintJunio C Hamano
The "are we talking with TTY, doing an interactive session?" detection has been updated to work better for "Git for Windows". * kb/msys2-tty: mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)
2016-06-06Merge branch 'da/difftool' into maintJunio C Hamano
"git difftool" learned to handle unmerged paths correctly in dir-diff mode. * da/difftool: difftool: handle unmerged files in dir-diff mode difftool: initialize variables for readability
2016-06-06Merge branch 'tb/core-eol-fix' into maintJunio C Hamano
A couple of bugs around core.autocrlf have been fixed. * tb/core-eol-fix: convert.c: ident + core.autocrlf didn't work t0027: test cases for combined attributes convert: allow core.autocrlf=input and core.eol=crlf t0027: make commit_chk_wrnNNO() reliable
2016-06-06Merge branch 'ar/diff-args-osx-precompose' into maintJunio C Hamano
Many commands normalize command line arguments from NFD to NFC variant of UTF-8 on OSX, but commands in the "diff" family did not, causing "git diff $path" to complain that no such path is known to Git. They have been taught to do the normalization. * ar/diff-args-osx-precompose: diff: run arguments through precompose_argv
2016-06-06Merge branch 'sb/submodule-helper-relative-path'Junio C Hamano
A bash-ism "local" has been removed from "git submodule" scripted Porcelain. * sb/submodule-helper-relative-path: submodule: remove bashism from shell script
2016-06-06Merge branch 'sb/submodule-helper-list-signal-unmatch-via-exit-status'Junio C Hamano
The way how "submodule--helper list" signals unmatch error to its callers has been updated. * sb/submodule-helper-list-signal-unmatch-via-exit-status: submodule--helper: offer a consistent API
2016-06-06l10n: zh_CN: for git v2.9.0 l10n round 1Jiang Xin
Update 104 new translations (2596t1f0u) for git v2.9.0-rc0. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-06-03Almost ready for 2.9-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-03Merge branch 'rs/apply-name-terminate'Junio C Hamano
Code clean-up. * rs/apply-name-terminate: apply: remove unused parameters from name_terminate()
2016-06-03Merge branch 'rs/patch-id-use-skip-prefix'Junio C Hamano
Code clean-up. * rs/patch-id-use-skip-prefix: patch-id: use starts_with() and skip_prefix()
2016-06-03Merge branch 'bd/readme.markdown-more'Junio C Hamano
The mark-up in the top-level README.md file has been updated to typeset CLI command names differently from the body text. * bd/readme.markdown-more: README.md: format CLI commands with code syntax
2016-06-03Merge branch 'mm/makefile-developer-can-be-in-config-mak'Junio C Hamano
"make DEVELOPER=1" worked as expected; setting DEVELOPER=1 in config.mak didn't. * mm/makefile-developer-can-be-in-config-mak: Makefile: add $(DEVELOPER_CFLAGS) variable Makefile: move 'ifdef DEVELOPER' after config.mak* inclusion
2016-06-03Merge branch 'em/man-bold-literal'Junio C Hamano
The manpage output of our documentation did not render well in terminal; typeset literals in bold by default to make them stand out more. * em/man-bold-literal: Documentation: bold literals in man
2016-06-03Merge branch 'pa/cherry-pick-doc-typo'Junio C Hamano
"git cherry-pick --help" had three instances of word "behavior", one of which was spelled "behaviour", which is updated to match the other two. * pa/cherry-pick-doc-typo: git-cherry-pick.txt: correct a small typo
2016-06-03Merge branch 'mr/send-email-doc-gmail-2fa'Junio C Hamano
Typofix. * mr/send-email-doc-gmail-2fa: Documentation/git-send-email: fix typo in gmail 2FA section
2016-06-03Merge branch 'js/rebase-i-dedup-call-to-rerere'Junio C Hamano
"git rebase -i", after it fails to auto-resolve the conflict, had an unnecessary call to "git rerere" from its very early days, which was spotted recently; the call has been removed. * js/rebase-i-dedup-call-to-rerere: rebase -i: remove an unnecessary 'rerere' invocation
2016-06-03Merge branch 'js/perf-rebase-i'Junio C Hamano
The one in 'master' has a brown-paper-bag bug that breaks the perf test when used inside a usual Git repository with a working tree. * js/perf-rebase-i: perf: make the tests work without a worktree
2016-06-02Documentation/git-send-email: fix typo in gmail 2FA sectionSZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01t2300: run git-sh-setup in an environment that better mimics the real lifeJunio C Hamano
When we run scripted Porcelains, "git" potty has set up the $PATH by prepending $GIT_EXEC_PATH, the path given by "git --exec-path=$there $cmd", etc. already. Because of this, scripted Porcelains can dot-source shell script library like git-sh-setup with simple dot without specifying any path. t2300 however dot-sources git-sh-setup without adjusting $PATH like the real "git" potty does. This has not been a problem so far, but once git-sh-setup wants to rely on the $PATH adjustment, just like any scripted Porcelains already do, it would become one. It cannot for example dot-source another shell library without specifying the full path to it by prefixing $(git --exec-path). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01t5500 & t7403: lose bash-ism "local"Junio C Hamano
In t5500::check_prot_host_port_path(), diagport is not a variable used elsewhere and the function is not recursively called so this can simply lose the "local", which may not be supported by shell (besides, the function liberally clobbers other variables without making them "local"). t7403::reset_submodule_urls() overrides the "root" variable used in the test framework for no good reason; its use is not about temporarily relocating where the test repositories are created. This assignment can be made not to clobber the variable by moving them into the subshells it already uses. Its value is always $TRASH_DIRECTORY, so we could use it instead there, and this function that is called only once and its two subshells may not be necessary (instead, the caller can use "git -C $there config" and set a value that is derived from $TRASH_DIRECTORY), but this is a minimum fix that is needed to lose "local". Helped-by: John Keeping <john@keeping.me.uk> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01submodule: remove bashism from shell scriptStefan Beller
Junio pointed out `relative_path` was using bashisms via the local variables. As the longer term goal is to rewrite most of the submodule code in C, do it now. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01submodule--helper: offer a consistent APIStefan Beller
In 48308681 (2016-02-29, git submodule update: have a dedicated helper for cloning), the helper communicated errors back only via exit code, and dance with printing '#unmatched' in case of error was left to git-submodule.sh as it uses the output of the helper and pipes it into shell commands. This change makes the helper consistent by never printing '#unmatched' in the helper but always handling these piping issues in the actual shell script. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01Makefile: add $(DEVELOPER_CFLAGS) variableMatthieu Moy
This does not change the behavior, but allows the user to tweak DEVELOPER_CFLAGS on the command-line or in a config.mak* file if needed. This also makes the code somewhat cleaner as it follows the pattern <initialisation of variables> <include statements> <actual build logic> by specifying which flags to activate in the first part, and actually activating them in the last one. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01test-lib: add in-shell "env" replacementJeff King
The one-shot environment variable syntax: FOO=BAR some-program is unportable when some-program is actually a shell function, like test_must_fail (on some shells FOO remains set after the function returns, and on others it does not). We sometimes get around this by using env, like: test_must_fail env FOO=BAR some-program But that only works because test_must_fail's arguments are themselves a command which can be run. You can't run: env FOO=BAR test_must_fail some-program because env does not know about our shell functions. So there is no equivalent for test_commit, for example, and one must resort to: ( FOO=BAR export FOO test_commit ) which is a bit verbose. Let's add a version of "env" that works _inside_ the shell, by creating a subshell, exporting variables from its argument list, and running the command. Its use is demonstrated on a currently-unportable case in t4014. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31Git 2.9-rc1v2.9.0-rc1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31Merge branch 'maint'Junio C Hamano
* maint: More topics for 2.8.4
2016-05-31More topics for 2.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31Merge branch 'sb/submodule-deinit-all' into maintJunio C Hamano
Correct faulty recommendation to use "git submodule deinit ." when de-initialising all submodules, which would result in a strange error message in a pathological corner case. * sb/submodule-deinit-all: submodule deinit: require '--all' instead of '.' for all submodules
2016-05-31Merge branch 'bn/http-cookiefile-config' into maintJunio C Hamano
"http.cookieFile" configuration variable clearly wants a pathname, but we forgot to treat it as such by e.g. applying tilde expansion. * bn/http-cookiefile-config: http: expand http.cookieFile as a path Documentation: config: improve word ordering for http.cookieFile
2016-05-31Merge branch 'jk/test-send-sh-x-trace-elsewhere' into maintJunio C Hamano
Running tests with '-x' option to trace the individual command executions is a useful way to debug test scripts, but some tests that capture the standard error stream and check what the command said can be broken with the trace output mixed in. When running our tests under "bash", however, we can redirect the trace output to another file descriptor to keep the standard error of programs being tested intact. * jk/test-send-sh-x-trace-elsewhere: test-lib: set BASH_XTRACEFD automatically
2016-05-31Merge branch 'js/name-rev-use-oldest-ref' into maintJunio C Hamano
"git describe --contains" often made a hard-to-justify choice of tag to give name to a given commit, because it tried to come up with a name with smallest number of hops from a tag, causing an old commit whose close descendant that is recently tagged were not described with respect to an old tag but with a newer tag. It did not help that its computation of "hop" count was further tweaked to penalize being on a side branch of a merge. The logic has been updated to favor using the tag with the oldest tagger date, which is a lot easier to explain to the end users: "We describe a commit in terms of the (chronologically) oldest tag that contains the commit." * js/name-rev-use-oldest-ref: name-rev: include taggerdate in considering the best name
2016-05-31rebase -i: remove an unnecessary 'rerere' invocationJohannes Sixt
Interactive rebase uses 'git cherry-pick' and 'git merge' to replay commits. Both invoke the 'rerere' machinery when they fail due to merge conflicts. Note that all code paths with these two commands also invoke the shell function die_with_patch when the commands fail. Since commit 629716d2 ("rerere: do use multiple variants") the second operation of the rerere machinery can be observed by a duplicated message "Recorded preimage for 'file'". This second operation records the same preimage as the first one and, hence, only wastes cycles. Remove the 'git rerere' invocation from die_with_patch. Shell function die_with_patch can be called after the failure of "git commit", too, which also calls into the rerere machinery, but it does so only after a successful commit to record the resolution. Therefore, it is wrong to call 'git rerere' from die_with_patch after "git commit" fails. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>