summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fast-import: do not truncate exported marks filefc/fast-import-broken-marks-fileFelipe Contreras2016-05-172-2/+20
| | | | | | | | | | | | Certain lines of the marks file might be corrupted (or the objects missing due to a garbage collection), but that's no reason to truncate the file and essentially destroy the rest of it. Ideally missing objects should not cause a crash, we could just skip them, but that's another patch. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Almost ready for 2.8.3Junio C Hamano2016-05-061-0/+9
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'sb/submodule-path-misc-bugs' into maintJunio C Hamano2016-05-063-11/+133
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | "git submodule" reports the paths of submodules the command recurses into, but this was incorrect when the command was not run from the root level of the superproject. * sb/submodule-path-misc-bugs: t7407: make expectation as clear as possible submodule update: test recursive path reporting from subdirectory submodule update: align reporting path for custom command execution submodule status: correct path handling in recursive submodules submodule update --init: correct path handling in recursive submodules submodule foreach: correct path display in recursive submodules
| * t7407: make expectation as clear as possiblesb/submodule-path-misc-bugsStefan Beller2016-03-301-2/+6
| | | | | | | | | | | | | | | | Not everyone (including me) grasps the sed expression in a split second as they would grasp the 4 lines printed as is. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule update: test recursive path reporting from subdirectoryStefan Beller2016-03-301-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is just a test and fixes no bug as there is currently no bug in the path handling of `submodule update`. In `submodule update` we make a call to `submodule--helper list --prefix "$wt_prefix"` which looks a bit brittle and likely to introduce a bug for the path handling. It is not a bug as the prefix is ignored inside the submodule helper for now. If this test breaks eventually, we want to make sure the `wt_prefix` is passed correctly into recursive submodules. Hint: In recursive submodules we expect `wt_prefix` to be empty. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule update: align reporting path for custom command executionStefan Beller2016-03-302-5/+28
| | | | | | | | | | | | | | | | | | In the predefined actions (merge, rebase, none, checkout), we use the display path, which is relative to the current working directory. Also use the display path when running a custom command. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule status: correct path handling in recursive submodulesStefan Beller2016-03-302-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new test which is a replica of the previous test except that it executes from a sub directory. Prior to this patch the test failed by having too many '../' prefixed: --- expect 2016-03-29 19:02:33.087336115 +0000 +++ actual 2016-03-29 19:02:33.359343311 +0000 @@ -1,7 +1,7 @@ b23f134787d96fae589a6b76da41f4db112fc8db ../nested1 (heads/master) -+25d56d1ddfb35c3e91ff7d8f12331c2e53147dcc ../nested1/nested2 (file2) - 5ec83512b76a0b8170b899f8e643913c3e9b72d9 ../nested1/nested2/nested3 (heads/master) - 509f622a4f36a3e472affcf28fa959174f3dd5b5 ../nested1/nested2/nested3/submodule (heads/master) ++25d56d1ddfb35c3e91ff7d8f12331c2e53147dcc ../../nested1/nested2 (file2) + 5ec83512b76a0b8170b899f8e643913c3e9b72d9 ../../../nested1/nested2/nested3 (heads/master) + 509f622a4f36a3e472affcf28fa959174f3dd5b5 ../../../../nested1/nested2/nested3/submodule (heads/master) 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f ../sub1 (0c90624) 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f ../sub2 (0c90624) 509f622a4f36a3e472affcf28fa959174f3dd5b5 ../sub3 (heads/master) The path code in question: displaypath=$(relative_path "$prefix$sm_path") prefix=$displaypath if recursive: eval cmd_status That way we change `prefix` each iteration to contain another '../', because of the the relative_path computation is done on an already computed relative path. We must call relative_path exactly once with `wt_prefix` non empty. Further calls in recursive instances to to calculate the displaypath already incorporate the correct prefix from before. Fix the issue by clearing `wt_prefix` in recursive calls. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule update --init: correct path handling in recursive submodulesStefan Beller2016-03-302-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling `git submodule init` from a recursive instance of `git submodule update --recursive`, the reported path is wrong as it skips the nested submodules. The new test demonstrates a failure in the code prior to this patch. Instead of getting the expected Submodule 'submodule' (${pwd}/submodule) registered for path '../super/submodule' the `super` directory is omitted and you get Submodule 'submodule' (${pwd}/submodule) registered for path '../submodule' instead. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * submodule foreach: correct path display in recursive submodulesStefan Beller2016-03-302-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `prefix` was put in front of the display path unconditionally. This is wrong as any relative path computation would need to be at the front, so include the prefix into the display path. The new test replicates the previous test with the difference of executing from a sub directory. By executing from a sub directory all we would expect all displayed paths to be prefixed by '../'. Prior to this patch the test would report Entering 'nested1/nested2/../nested3' instead of the expected Entering '../nested1/nested2/nested3' Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ky/imap-send-openssl-1.1.0' into maintJunio C Hamano2016-05-065-28/+21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upcoming OpenSSL 1.1.0 will break compilation b updating a few APIs we use in imap-send, which has been adjusted for the change. * ky/imap-send-openssl-1.1.0: configure: remove checking for HMAC_CTX_cleanup imap-send: avoid deprecated TLSv1_method() imap-send: check NULL return of SSL_CTX_new() imap-send: use HMAC() function provided by OpenSSL
| * | configure: remove checking for HMAC_CTX_cleanupky/imap-send-openssl-1.1.0Kazuki Yamaguchi2016-04-083-13/+0
| | | | | | | | | | | | | | | | | | | | | We don't need it, as we no longer use HMAC_CTX_cleanup() directly. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | imap-send: avoid deprecated TLSv1_method()Kazuki Yamaguchi2016-04-081-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use SSLv23_method always and disable SSL if needed. TLSv1_method() function is deprecated in OpenSSL 1.1.0 and the compiler emits a warning. SSLv23_method() is also deprecated, but the alternative, TLS_method(), is new in OpenSSL 1.1.0 so requires checking by configure. Stick to SSLv23_method() for now (this is aliased to TLS_method()). Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | imap-send: check NULL return of SSL_CTX_new()Kazuki Yamaguchi2016-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | SSL_CTX_new() may fail with return value NULL. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | imap-send: use HMAC() function provided by OpenSSLKazuki Yamaguchi2016-04-082-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix compile errors with OpenSSL 1.1.0. HMAC_CTX is made opaque and HMAC_CTX_cleanup is removed in OpenSSL 1.1.0. But since we just want to calculate one HMAC, we can use HMAC() here, which exists since OpenSSL 0.9.6 at least. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'js/replace-edit-use-editor-configuration' into maintJunio C Hamano2016-05-061-0/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | "git replace -e" did not honour "core.editor" configuration. * js/replace-edit-use-editor-configuration: replace --edit: respect core.editor
| * | | replace --edit: respect core.editorjs/replace-edit-use-editor-configurationJohannes Schindelin2016-04-201-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | We simply need to read the config, is all. This fixes https://github.com/git-for-windows/git/issues/733 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'cc/apply' into maintJunio C Hamano2016-05-061-15/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor code clean-up. * cc/apply: builtin/apply: free patch when parse_chunk() fails builtin/apply: handle parse_binary() failure apply: remove unused call to free() in gitdiff_{old,new}name() builtin/apply: get rid of useless 'name' variable
| * | | builtin/apply: free patch when parse_chunk() failscc/applyChristian Couder2016-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parse_chunk() fails it can return -1, for example when find_header() doesn't find a patch header. In this case it's better in apply_patch() to free the "struct patch" that we just allocated instead of leaking it. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin/apply: handle parse_binary() failureChristian Couder2016-04-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In parse_binary() there is: forward = parse_binary_hunk(&buffer, &size, &status, &used); if (!forward && !status) /* there has to be one hunk (forward hunk) */ return error(_("unrecognized binary patch at line %d"), linenr-1); so parse_binary() can return -1, because that's what error() returns. Also parse_binary_hunk() sets "status" to -1 in case of error and parse_binary() does "if (status) return status;". In this case parse_chunk() should not add -1 to the patchsize it computes. It is better for future libification efforts to make it just return -1. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | apply: remove unused call to free() in gitdiff_{old,new}name()Junio C Hamano2016-03-221-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two functions keep a copy of filename it was given, let gitdiff_verify_name() to rewrite it to a new filename and then free the original if they receive a newly minted filename. However (1) when the original name is NULL, gitdiff_verify_name() returns either NULL or a newly minted value. Either case, we do not have to worry about calling free() on the original NULL. (2) when the original name is not NULL, gitdiff_verify_name() either returns that as-is, or calls die() when it finds inconsistency in the patch. When the function returns, we know that "if ()" statement always is false. Noticed by Christian Couder. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin/apply: get rid of useless 'name' variableChristian Couder2016-03-221-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it put an 'else' on the same line as the previous '}'. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'kn/for-each-tag-branch' into maintJunio C Hamano2016-05-061-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A minor documentation update. * kn/for-each-tag-branch: for-each-ref: fix description of '--contains' in manpage
| * | | | for-each-ref: fix description of '--contains' in manpagekn/for-each-tag-branchSZEDER Gábor2016-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'git for-each-ref's manpage says that '--contains' only lists tags, but it lists all kinds of refs. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | git-multimail: update to release 1.3.0Matthieu Moy2016-05-038-143/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are described in CHANGES. Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr> Contributions-by: Stefan Tatschner <rumpelsepp@sevenbyte.org> Contributions-by: Simon P <simon.git@le-huit.fr> Contributions-by: Leander Hasty <leander@1stplayable.com> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Start preparing for 2.8.3Junio C Hamano2016-05-021-0/+61
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jk/use-write-script-more' into maintJunio C Hamano2016-05-023-18/+20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * jk/use-write-script-more: t3404: use write_script t1020: do not overuse printf and use write_script t5532: use write_script
| * | | | | t3404: use write_scriptjk/use-write-script-moreJunio C Hamano2016-04-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test uses hardcoded #!/bin/sh to create a pre-commit hook script. Because the generated script uses $(command substitution), which is not supported by /bin/sh on some platforms (e.g. Solaris), the resulting pre-commit always fails. Which is not noticeable as the test that uses the hook is about checking the behaviour of the command when the hook fails ;-), but nevertheless it is not testing what we wanted to test. Use write_script so that the resulting script is run under the same shell our scripted Porcelain commands are run, which must support the necessary $(construct). Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t1020: do not overuse printf and use write_scriptJunio C Hamano2016-04-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test prepares a sample file "dir/two" with a single incomplete line in it with "printf", and also prepares a small helper script "diff" to create a file with a single incomplete line in it, again with "printf". The output from the latter is compared with an expected output, again prepared with "printf" hence lacking the final LF. There is no reason for this test to be using files with an incomplete line at the end, and these look more like a mistake of not using printf "%s\n" "string to be written" and using printf "string to be written" Depending on what would be in $GIT_PREFIX, using the latter form could be a bug waiting to happen. Correct them. Also, the test uses hardcoded #!/bin/sh to create a small helper script. For a small task like what the generated script does, it does not matter too much in that what appears as /bin/sh would not be _so_ broken, but while we are at it, use write_script instead, which happens to make the result easier to read by reducing need of one level of quoting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t5532: use write_scriptJeff King2016-04-101-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent cleanup in b7cbbff switched t5532's use of backticks to $(). This matches our normal shell style, which is good. But it also breaks the test on Solaris, where /bin/sh does not understand $(). Our normal shell style assumes a modern-ish shell which knows about $(). However, some tests create small helper scripts and just write "#!/bin/sh" into them. These scripts either need to go back to using backticks, or they need to respect $SHELL_PATH. The easiest way to do the latter is to use write_script. While we're at it, let's also stick the script creation inside a test_expect block (our usual style), and split the perl snippet into its own script (to prevent quoting madness). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jc/xstrfmt-null-with-prec-0' into maintJunio C Hamano2016-05-021-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code cleanup. * jc/xstrfmt-null-with-prec-0: setup.c: do not feed NULL to "%.*s" even with precision 0
| * | | | | | setup.c: do not feed NULL to "%.*s" even with precision 0jc/xstrfmt-null-with-prec-0Junio C Hamano2016-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent update 75faa45a (replace trivial malloc + sprintf / strcpy calls with xstrfmt, 2015-09-24) rewrote prepare an empty buffer if (len) append the first len bytes of "prefix" to the buffer append "path" to the buffer that computed "path", optionally prefixed by "prefix", into xstrfmt("%.*s%s", len, prefix, path); However, passing a NULL pointer to the printf(3) family of functions to format it with %s conversion, even with the precision set to 0, i.e. xstrfmt("%.*s", 0, NULL) yields undefined results, at least on some platforms. Avoid this problem by substituting prefix with "" when len==0, as prefix can legally be NULL in that case. This would mimick the intent of the original code better. Reported-by: Tom G. Christensen <tgc@jupiterrise.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'ew/send-email-drop-data-dumper' into maintJunio C Hamano2016-05-021-1/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * ew/send-email-drop-data-dumper: send-email: do not load Data::Dumper
| * | | | | | | send-email: do not load Data::Dumperew/send-email-drop-data-dumperEric Wong2016-04-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We never used Data::Dumper in this script. The only reference of it was always commented out and removed over a decade ago in commit 4bc87a28be020a6bf7387161c65ea3d8e4a0228b ("send-email: Change from Mail::Sendmail to Net::SMTP") Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'ad/cygwin-wants-rename' into maintJunio C Hamano2016-05-021-0/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Cygwin, object creation uses the "create a temporary and then rename it to the final name" pattern, not "create a temporary, hardlink it to the final name and then unlink the temporary" pattern. This is necessary to use Git on Windows shared directories, and is already enabled for the MinGW and plain Windows builds. It also has been used in Cygwin packaged versions of Git for quite a while. See http://thread.gmane.org/gmane.comp.version-control.git/291853 ($gmane/275680, $gmane/291853). * ad/cygwin-wants-rename: config.mak.uname: Cygwin needs OBJECT_CREATION_USES_RENAMES
| * | | | | | | | config.mak.uname: Cygwin needs OBJECT_CREATION_USES_RENAMESad/cygwin-wants-renameAdam Dinwoodie2015-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary to use Git on Windows shared directories, and is already enabled for the MinGW and plain Windows builds. This problem was reported on the Cygwin mailing list at https://cygwin.com/ml/cygwin/2015-08/msg00102.html (amongst others) and is being applied as a manual patch to the Cygwin builds until the patch is taken here. Reported-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'jk/do-not-printf-NULL' into maintJunio C Hamano2016-05-021-7/+11
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git config" had a codepath that tried to pass a NULL to printf("%s"), which nobody seems to have noticed. * jk/do-not-printf-NULL: git_config_set_multivar_in_file: handle "unset" errors git_config_set_multivar_in_file: all non-zero returns are errors config: lower-case first word of error strings
| * | | | | | | | | git_config_set_multivar_in_file: handle "unset" errorsjk/do-not-printf-NULLJeff King2016-04-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We pass off to the "_gently" form to do the real work, and just die() if it returned an error. However, our die message de-references "value", which may be NULL if the request was to unset a variable. Nobody using glibc noticed, because it simply prints "(null)", which is good enough for the test suite (and presumably very few people run across this in practice). But other libc implementations (like Solaris) may segfault. Let's not only fix that, but let's make the message more clear about what is going on in the "unset" case. Reported-by: "Tom G. Christensen" <tgc@jupiterrise.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | git_config_set_multivar_in_file: all non-zero returns are errorsJeff King2016-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is just a thin wrapper for the "_gently" form of the function. But the gently form is designed to feed builtin/config.c, which passes our return code directly to its exit status, and thus uses positive error values for some cases. We check only negative values, meaning we would fail to die in some cases (e.g., a malformed key). This may or may not be triggerable in practice; we tend to use this non-gentle form only when setting internal variables, which would not have malformed keys. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | config: lower-case first word of error stringsJeff King2016-04-101-5/+5
| | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows our usual style (both throughout git, and throughout the rest of this file). This covers the whole file, but note that I left the capitalization in the multi-sentence: error: malformed value... error: Must be one of ... because it helps make it clear that we are starting a new sentence in the second one. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'jc/http-socks5h' into maintJunio C Hamano2016-05-021-1/+4
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The socks5:// proxy support added back in 2.6.4 days was not aware that socks5h:// proxies behave differently. * jc/http-socks5h: http: differentiate socks5:// and socks5h://
| * | | | | | | | | http: differentiate socks5:// and socks5h://jc/http-socks5hJunio C Hamano2016-04-101-1/+4
| | |_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Felix Ruess <felix.ruess@gmail.com> noticed that with configuration $ git config --global 'http.proxy=socks5h://127.0.0.1:1080' connections to remote sites time out, waiting for DNS resolution. The logic to detect various flavours of SOCKS proxy and ask the libcurl layer to use appropriate one understands the proxy string that begin with socks5, socks4a, etc., but does not know socks5h, and we end up using CURLPROXY_SOCKS5. The correct one to use is CURLPROXY_SOCKS5_HOSTNAME. https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html says ..., socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type). which is consistent with the way the breakage was reported. Tested-by: Felix Ruess <felix.ruess@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'ky/imap-send' into maintJunio C Hamano2016-05-021-6/+6
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for CRAM-MD5 authentication method in "git imap-send" did not work well. * ky/imap-send: imap-send: fix CRAM-MD5 response calculation imap-send: check for NOLOGIN capability only when using LOGIN command
| * | | | | | | | | imap-send: fix CRAM-MD5 response calculationky/imap-sendKazuki Yamaguchi2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove extra + 1 from resp_len, the length of the byte sequence to be Base64 encoded and passed to the server as the response. Or the response incorrectly contains an extra \0. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | imap-send: check for NOLOGIN capability only when using LOGIN commandKazuki Yamaguchi2016-04-131-5/+5
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't check for NOLOGIN (LOGINDISABLED) capability when imap.authMethod is specified. LOGINDISABLED capability doesn't forbid using AUTHENTICATE, so it should be allowed, or we can't connect to IMAP servers which only accepts AUTHENTICATE command. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'ad/commit-have-m-option' into maintJunio C Hamano2016-05-022-3/+23
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git commit" misbehaved in a few minor ways when an empty message is given via -m '', all of which has been corrected. * ad/commit-have-m-option: commit: do not ignore an empty message given by -m '' commit: --amend -m '' silently fails to wipe message
| * | | | | | | | | commit: do not ignore an empty message given by -m ''ad/commit-have-m-optionJeff King2016-04-072-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When f9568530 (builtin-commit: resurrect behavior for multiple -m options, 2007-11-11) converted a "char *message" to "struct strbuf message" to hold the messages given with the "-m" option, it incorrectly changed the checks "did we get a message with the -m option?" to "is message.len 0?". Later, we noticed one breakage from this change and corrected it with 25206778 (commit: don't start editor if empty message is given with -m, 2013-05-25). However, "we got a message with -m, even though an empty one, so we shouldn't be launching an editor" was not the only breakage. * "git commit --amend -m '' --allow-empty", even though it looks strange, is a valid request to amend the commit to have no message at all. Due to the misdetection of the presence of -m on the command line, we ended up keeping the log messsage from the original commit. * "git commit -m "$msg" -F file" should be rejected whether $msg is an empty string or not, but due to the same bug, was not rejected when $msg is empty. * "git -c template=file -m "$msg"" should ignore the template even when $msg is empty, but it didn't and instead used the contents from the template file. Correct these by checking have_option_m, which the earlier 25206778 introduced to fix the same bug. Reported-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | commit: --amend -m '' silently fails to wipe messageAdam Dinwoodie2016-04-071-0/+20
| | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git commit --amend -m ''` seems to be an unambiguous request to blank a commit message, but it actually leaves the commit message as-is. That's the case regardless of whether `--allow-empty-message` is specified, and doesn't so much as drop a non-zero return code. Add failing tests to show this behaviour. Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'sb/submodule-helper-clone-regression-fix' into maintJunio C Hamano2016-05-022-23/+59
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A partial rewrite of "git submodule" in the 2.7 timeframe changed the way the gitdir: pointer in the submodules point at the real repository location to use absolute paths by accident. This has been corrected. * sb/submodule-helper-clone-regression-fix: submodule--helper, module_clone: catch fprintf failure submodule--helper: do not borrow absolute_path() result for too long submodule--helper, module_clone: always operate on absolute paths submodule--helper clone: create the submodule path just once submodule--helper: fix potential NULL-dereference recursive submodules: test for relative paths
| * | | | | | | | | submodule--helper, module_clone: catch fprintf failuresb/submodule-helper-clone-regression-fixStefan Beller2016-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value of fprintf is unchecked, which may lead to unreported errors. Use fprintf_or_die to report the error to the user. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | submodule--helper: do not borrow absolute_path() result for too longJunio C Hamano2016-04-011-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | absolute_path() is designed to allow its callers to take a brief peek of the result (typically, to be fed to functions like strbuf_add() and relative_path() as a parameter) without having to worry about freeing it, but the other side of the coin of that memory model is that the caller shouldn't rely too much on the result living forever--there may be a helper function the caller subsequently calls that makes its own call to absolute_path(), invalidating the earlier result. Use xstrdup() to make our own copy, and free(3) it when we are done. While at it, remove an unnecessary sm_gitdir_rel variable that was only used to as a parameter to call absolute_path() and never used again. Signed-off-by: Junio C Hamano <gitster@pobox.com>