summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-09-29Merge branch 'jk/rebase-i-drop-ident-check' into maintJunio C Hamano
Even when "git pull --rebase=preserve" (and the underlying "git rebase --preserve") can complete without creating any new commit (i.e. fast-forwards), it still insisted on having a usable ident information (read: user.email is set correctly), which was less than nice. As the underlying commands used inside "git rebase" would fail with a more meaningful error message and advice text when the bogus ident matters, this extra check was removed. * jk/rebase-i-drop-ident-check: rebase-interactive: drop early check for valid ident
2016-09-29Merge branch 'jt/format-patch-base-info-above-sig' into maintJunio C Hamano
"git format-patch --base=..." feature that was recently added showed the base commit information after "-- " e-mail signature line, which turned out to be inconvenient. The base information has been moved above the signature line. * jt/format-patch-base-info-above-sig: format-patch: show base info before email signature
2016-09-29Merge branch 'ks/perf-build-with-autoconf' into maintJunio C Hamano
Performance tests done via "t/perf" did not use the same set of build configuration if the user relied on autoconf generated configuration. * ks/perf-build-with-autoconf: t/perf/run: copy config.mak.autogen & friends to build area
2016-09-29Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maintJunio C Hamano
"git diff -W" output needs to extend the context backward to include the header line of the current function and also forward to include the body of the entire current function up to the header line of the next one. This process may have to merge to adjacent hunks, but the code forgot to do so in some cases. * rs/xdiff-merge-overlapping-hunks-for-W-context: xdiff: fix merging of hunks with -W context and -u context
2016-09-29Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' into maintJunio C Hamano
The http transport (with curl-multi option, which is the default these days) failed to remove curl-easy handle from a curlm session, which led to unnecessary API failures. * ew/http-do-not-forget-to-call-curl-multi-remove-handle: http: always remove curl easy from curlm session on release http: consolidate #ifdefs for curl_multi_remove_handle http: warn on curl_multi_add_handle failures
2016-09-29Merge branch 'jk/patch-ids-no-merges' into maintJunio C Hamano
"git log --cherry-pick" used to include merge commits as candidates to be matched up with other commits, resulting a lot of wasted time. The patch-id generation logic has been updated to ignore merges to avoid the wastage. * jk/patch-ids-no-merges: patch-ids: refuse to compute patch-id for merge commit patch-ids: turn off rename detection
2016-09-29Merge branch 'js/git-gui-commit-gpgsign' into maintJunio C Hamano
"git commit-tree" stopped reading commit.gpgsign configuration variable that was meant for Porcelain "git commit" in Git 2.9; we forgot to update "git gui" to look at the configuration to match this change. * js/git-gui-commit-gpgsign: git-gui: respect commit.gpgsign again
2016-09-29Merge branch 'jk/fix-remote-curl-url-wo-proto' into maintJunio C Hamano
"git fetch http::/site/path" did not die correctly and segfaulted instead. * jk/fix-remote-curl-url-wo-proto: remote-curl: handle URLs without protocol
2016-09-29Merge branch 'sy/git-gui-i18n-ja' into maintJunio C Hamano
Update Japanese translation for "git-gui". * sy/git-gui-i18n-ja: git-gui: update Japanese information git-gui: update Japanese translation git-gui: add Japanese language code git-gui: apply po template to Japanese translation git-gui: consistently use the same word for "blame" in Japanese git-gui: consistently use the same word for "remote" in Japanese
2016-09-29Merge branch 'mr/vcs-svn-printf-ulong' into maintJunio C Hamano
Code cleanup. * mr/vcs-svn-printf-ulong: vcs-svn/fast_export: fix timestamp fmt specifiers
2016-09-29Merge branch 'rs/unpack-trees-reduce-file-scope-global' into maintJunio C Hamano
Code cleanup. * rs/unpack-trees-reduce-file-scope-global: unpack-trees: pass checkout state explicitly to check_updates()
2016-09-29Merge branch 'rs/strbuf-remove-fix' into maintJunio C Hamano
Code cleanup. * rs/strbuf-remove-fix: strbuf: use valid pointer in strbuf_remove()
2016-09-29Merge branch 'rs/checkout-some-states-are-const' into maintJunio C Hamano
Code cleanup. * rs/checkout-some-states-are-const: checkout: constify parameters of checkout_stage() and checkout_merged()
2016-09-29Merge branch 'bw/pathspec-remove-unused-extern-decl' into maintJunio C Hamano
Code cleanup. * bw/pathspec-remove-unused-extern-decl: pathspec: remove unnecessary function prototypes
2016-09-28mailinfo: unescape quoted-pair in header fieldsKevin Daudt
rfc2822 has provisions for quoted strings in structured header fields, but also allows for escaping these with so-called quoted-pairs. The only thing git currently does is removing exterior quotes, but quotes within are left alone. Remove exterior quotes and remove escape characters so that they don't show up in the author field. Signed-off-by: Kevin Daudt <me@ikke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-28t5100-mailinfo: replace common path prefix with variableKevin Daudt
Many tests need to store data in a file, and repeat the same pattern to refer to that path: "$TEST_DIRECTORY"/t5100/ Create a variable that contains this path, and use that instead. While we're making this change, make sure the quotes are not just around the variable, but around the entire string to not give the impression we want shell splitting to affect the other variables. Signed-off-by: Kevin Daudt <me@ikke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27rev-list-options: clarify the usage of --reversePranit Bauva
Users often wonder if the oldest or the newest n commits are shown by `log -n --reverse`. Clarify that --reverse kicks in only after deciding which commits are to be shown to unconfuse them. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27fsck: handle bad trees like other errorsDavid Turner
Instead of dying when fsck hits a malformed tree object, log the error like any other and continue. Now fsck can tell the user which tree is bad, too. Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27tree-walk: be more specific about corrupt tree errorsJeff King
When the tree-walker runs into an error, it just calls die(), and the message is always "corrupt tree file". However, we are actually covering several cases here; let's give the user a hint about what happened. Let's also avoid using the word "corrupt", which makes it seem like the data bit-rotted on disk. Our sha1 check would already have found that. These errors are ones of data that is malformed in the first place. Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27worktree: honor configuration variablesJunio C Hamano
The command accesses default_abbrev (defined in environment.c and is updated via core.abbrev configuration), but never makes any call to git_config(). The output from "worktree list" ignores the abbrev setting for this reason. Make a call to git_config() to read the default set of configuration variables at the beginning of the command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27xdiff: rename "struct group" to "struct xdlgroup"Jeff King
Commit e8adf23 (xdl_change_compact(): introduce the concept of a change group, 2016-08-22) added a "struct group" type to xdiff/xdiffi.c. But the POSIX system header "grp.h" already defines "struct group" (it is part of the getgrnam interface). This happens to work because the new type is local to xdiffi.c, and the xdiff code includes a relatively small set of system headers. But it will break compilation if xdiff ever switches to using git-compat-util.h. It can also probably cause confusion with tools that look at the whole code base, like coccinelle or ctags. Let's resolve by giving the xdiff variant a scoped name, which is closer to other xdiff types anyway (e.g., xdlfile_t, though note that xdiff is fond if typedefs when Git usually is not). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-27add David Turner's Two Sigma addressDavid Turner
Signed-off-by: David Turner <novalis@novalis.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26Fifth batch for 2.11Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26Merge branch 'jk/clone-recursive-progress'Junio C Hamano
"git clone --recurse-submodules" lost the progress eye-candy in recent update, which has been corrected. * jk/clone-recursive-progress: clone: pass --progress decision to recursive submodules
2016-09-26Merge branch 'jk/doc-cvs-update'Junio C Hamano
Documentation around tools to import from CVS was fairly outdated. * jk/doc-cvs-update: docs/cvs-migration: mention cvsimport caveats docs/cvs-migration: update link to cvsps homepage docs/cvsimport: prefer cvs-fast-export to parsecvs
2016-09-26Merge branch 'rt/rebase-i-broken-insn-advise'Junio C Hamano
When "git rebase -i" is given a broken instruction, it told the user to fix it with "--edit-todo", but didn't say what the step after that was (i.e. "--continue"). * rt/rebase-i-broken-insn-advise: rebase -i: improve advice on bad instruction lines
2016-09-26Merge branch 'rs/checkout-init-macro'Junio C Hamano
Code cleanup. * rs/checkout-init-macro: introduce CHECKOUT_INIT
2016-09-26Merge branch 'ls/travis-homebrew-path-fix'Junio C Hamano
The procedure to build Git on Mac OS X for Travis CI hardcoded the internal directory structure we assumed HomeBrew uses, which was a no-no. The procedure has been updated to ask HomeBrew things we need to know to fix this. * ls/travis-homebrew-path-fix: travis-ci: ask homebrew for its path instead of hardcoding it
2016-09-26Merge branch 'tg/add-chmod+x-fix'Junio C Hamano
"git add --chmod=+x <pathspec>" added recently only toggled the executable bit for paths that are either new or modified. This has been corrected to flip the executable bit for all paths that match the given pathspec. * tg/add-chmod+x-fix: t3700-add: do not check working tree file mode without POSIXPERM t3700-add: create subdirectory gently add: modify already added files when --chmod is given read-cache: introduce chmod_index_entry update-index: add test for chmod flags
2016-09-26Merge branch 'js/regexec-buf'Junio C Hamano
Some codepaths in "git diff" used regexec(3) on a buffer that was mmap(2)ed, which may not have a terminating NUL, leading to a read beyond the end of the mapped region. This was fixed by introducing a regexec_buf() helper that takes a <ptr,len> pair with REG_STARTEND extension. * js/regexec-buf: regex: use regexec_buf() regex: add regexec_buf() that can work on a non NUL-terminated string regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails
2016-09-26Merge branch 'nd/checkout-disambiguation'Junio C Hamano
"git checkout <word>" does not follow the usual disambiguation rules when the <word> can be both a rev and a path, to allow checking out a branch 'foo' in a project that happens to have a file 'foo' in the working tree without having to disambiguate. This was poorly documented and the check was incorrect when the command was run from a subdirectory. * nd/checkout-disambiguation: checkout: fix ambiguity check in subdir checkout.txt: document a common case that ignores ambiguation rules checkout: add some spaces between code and comment
2016-09-26Merge branch 'va/i18n-more'Junio C Hamano
Even more i18n. * va/i18n-more: i18n: stash: mark messages for translation i18n: notes-merge: mark die messages for translation i18n: ident: mark hint for translation i18n: i18n: diff: mark die messages for translation i18n: connect: mark die messages for translation i18n: commit: mark message for translation
2016-09-26Merge branch 'jt/format-patch-rfc'Junio C Hamano
In some projects, it is common to use "[RFC PATCH]" as the subject prefix for a patch meant for discussion rather than application. A new option "--rfc" was a short-hand for "--subject-prefix=RFC PATCH" to help the participants of such projects. * jt/format-patch-rfc: format-patch: add "--rfc" for the common case of [RFC PATCH]
2016-09-26Merge branch 'ep/doc-check-ref-format-example'Junio C Hamano
A shell script example in check-ref-format documentation has been fixed. * ep/doc-check-ref-format-example: git-check-ref-format.txt: fixup documentation
2016-09-26Merge branch 'mh/diff-indent-heuristic'Junio C Hamano
Output from "git diff" can be made easier to read by selecting which lines are common and which lines are added/deleted intelligently when the lines before and after the changed section are the same. A command line option is added to help with the experiment to find a good heuristics. * mh/diff-indent-heuristic: blame: honor the diff heuristic options and config parse-options: add parse_opt_unknown_cb() diff: improve positioning of add/delete blocks in diffs xdl_change_compact(): introduce the concept of a change group recs_match(): take two xrecord_t pointers as arguments is_blank_line(): take a single xrecord_t as argument xdl_change_compact(): only use heuristic if group can't be matched xdl_change_compact(): fix compaction heuristic to adjust ixo
2016-09-26Merge branch 'rs/c-auto-resets-attributes'Junio C Hamano
The pretty-format specifier "%C(auto)" used by the "log" family of commands to enable coloring of the output is taught to also issue a color-reset sequence to the output. * rs/c-auto-resets-attributes: pretty: let %C(auto) reset all attributes
2016-09-26Merge branch 'mm/config-color-ui-default-to-auto'Junio C Hamano
Documentation for individual configuration variables to control use of color (like `color.grep`) said that their default value is 'false', instead of saying their default is taken from `color.ui`. When we updated the default value for color.ui from 'false' to 'auto' quite a while ago, all of them broke. This has been corrected. * mm/config-color-ui-default-to-auto: Documentation/config: default for color.* is color.ui
2016-09-26Merge branch 'rs/cocci'Junio C Hamano
Code cleanup. * rs/cocci: use strbuf_addstr() for adding constant strings to a strbuf, part 2 add coccicheck make target contrib/coccinelle: fix semantic patch for oid_to_hex_r()
2016-09-26unpack_sha1_header(): detect malformed object headerJunio C Hamano
When opening a loose object file, we often do this sequence: - prepare a short buffer for the object header (on stack) - call unpack_sha1_header() and have early part of the object data inflated, enough to fill the buffer - parse that data in the short buffer, assuming that the first part of the object is <typename> SP <length> NUL Because the parsing function parse_sha1_header_extended() is not given the number of bytes inflated into the header buffer, it you craft a file whose early part inflates a garbage sequence without SP or NUL, and replace a loose object with it, it will end up reading past the end of the inflated data. To correct this, do the following four things: - rename unpack_sha1_header() to unpack_sha1_short_header() and have unpack_sha1_header_to_strbuf() keep calling that as its helper function. This will detect and report zlib errors, but is not aware of the format of a loose object (as before). - introduce unpack_sha1_header() that calls the same helper function, and when zlib reports it inflated OK into the buffer, check if the inflated data has NUL. This would ensure that parsing function will terminate within the buffer that holds the inflated header. - update unpack_sha1_header_to_strbuf() to check if the resulting buffer has NUL for the same effect. - update parse_sha1_header_extended() to make sure that its loop to find the SP that terminates the <typename> stops at NUL. Essentially, this makes unpack_*() functions that are asked to unpack a loose object header to be a bit more strict and detect an input that cannot possibly be a valid object header, even before the parsing function kicks in. Reported-by: Gustavo Grieco <gustavo.grieco@imag.fr> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26streaming: make sure to notice corrupt objectJunio C Hamano
The streaming read interface from a loose object called parse_sha1_header() but discarded its return value, without noticing a potential error. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26Merge branch 'va/i18n' of ../git-gui into va/git-gui-i18nJunio C Hamano
* 'va/i18n' of ../git-gui: git-gui: l10n: add Portuguese translation git-gui i18n: mark strings for translation
2016-09-26git-gui: l10n: add Portuguese translationVasco Almeida
Add Portuguese glossary. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26git-gui i18n: mark strings for translationVasco Almeida
Mark strings for translation in lib/index.tcl that were seemingly left behind by 700e560 ("git-gui: Mark forgotten strings for translation.", 2008-09-04) which marks string in do_revert_selection procedure. These strings are passed to unstage_help and add_helper procedures. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26Merge branch 'rs/use-modern-git-merge-syntax' of git-gui into ↵Junio C Hamano
rs/git-gui-use-modern-git-merge-syntax * 'rs/use-modern-git-merge-syntax' of git-gui: git-gui: stop using deprecated merge syntax
2016-09-26git-gui: stop using deprecated merge syntaxRené Scharfe
Starting with v2.5.0 git merge can handle FETCH_HEAD internally and warns when it's called like 'git merge <message> HEAD <commit>' because that syntax is deprecated. Use this feature in git-gui and get rid of that warning. Signed-off-by: Rene Scharfe <l.s.r@web.de> Tested-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-25use COPY_ARRAYRené Scharfe
Add a semantic patch for converting certain calls of memcpy(3) to COPY_ARRAY() and apply that transformation to the code base. The result is shorter and safer code. For now only consider calls where source and destination have the same type, or in other words: easy cases. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-25add COPY_ARRAYRené Scharfe
Add COPY_ARRAY, a safe and convenient helper for copying arrays, complementing ALLOC_ARRAY and REALLOC_ARRAY. Users just specify source, destination and the number of elements; the size of an element is inferred automatically. It checks if the multiplication of size and element count overflows. The inferred size is passed first to st_mult, which allows the division there to be done at compilation time. As a basic type safety check it makes sure the sizes of source and destination elements are the same. That's evaluated at compilation time as well. COPY_ARRAY is safe to use with NULL as source pointer iff 0 elements are to be copied. That convention is used in some cases for initializing arrays. Raw memcpy(3) does not support it -- compilers are allowed to assume that only valid pointers are passed to it and can optimize away NULL checks after such a call. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-25gitweb: use highlight's shebang detectionIan Kelling
The "highlight" binary can, in some cases, determine the language type by the means of file contents, for example the shebang in the first line for some scripting languages. Make use of this autodetection for files which syntax is not known by gitweb. In that case, pass the blob contents to "highlight --force"; the parameter is needed to make it always generate HTML output (which includes HTML-escaping). Although we now run highlight on files which do not end up highlighted, performance is virtually unaffected because when we call highlight, it is used for escaping HTML. In the case that highlight is used, gitweb calls sanitize() instead of esc_html(), and the latter is significantly slower (it does more, being roughly a superset of sanitize()). Simple benchmark comparing performance of 'blob' view of files without syntax highlighting in gitweb before and after this change indicates ±1% difference in request time for all file types. Benchmark was performed on local instance on Debian, using Apache/2.4.23 web server and CGI. Document the feature and improve syntax highlight documentation, add test to ensure gitweb doesn't crash when language detection is used. Signed-off-by: Ian Kelling <ian@iankelling.org> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-25gitweb: remove unused guess_file_syntax() parameterIan Kelling
Signed-off-by: Ian Kelling <ian@iankelling.org> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-25init: kill git_link variableNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>