Junio C Hamano [Mon, 2 May 2016 21:24:13 +0000 (14:24 -0700)]
Merge branch 'ew/send-email-drop-data-dumper' into maint
Code clean-up.
* ew/send-email-drop-data-dumper:
send-email: do not load Data::Dumper
Junio C Hamano [Mon, 2 May 2016 21:24:11 +0000 (14:24 -0700)]
Merge branch 'ad/cygwin-wants-rename' into maint
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
Junio C Hamano [Mon, 2 May 2016 21:24:10 +0000 (14:24 -0700)]
Merge branch 'jk/do-not-printf-NULL' into maint
"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
Junio C Hamano [Mon, 2 May 2016 21:24:10 +0000 (14:24 -0700)]
Merge branch 'jc/http-socks5h' into maint
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://
Junio C Hamano [Mon, 2 May 2016 21:24:09 +0000 (14:24 -0700)]
Merge branch 'ky/imap-send' into maint
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
Junio C Hamano [Mon, 2 May 2016 21:24:09 +0000 (14:24 -0700)]
Merge branch 'ad/commit-have-m-option' into maint
"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
Junio C Hamano [Mon, 2 May 2016 21:24:08 +0000 (14:24 -0700)]
Merge branch 'sb/submodule-helper-clone-regression-fix' into maint
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
Junio C Hamano [Mon, 2 May 2016 21:24:07 +0000 (14:24 -0700)]
Merge branch 'jk/branch-shortening-funny-symrefs' into maint
A change back in version 2.7 to "git branch" broke display of a
symbolic ref in a non-standard place in the refs/ hierarchy (we
expect symbolic refs to appear in refs/remotes/*/HEAD to point at
the primary branch the remote has, and as .git/HEAD to point at the
branch we locally checked out).
* jk/branch-shortening-funny-symrefs:
branch: fix shortening of non-remote symrefs
Junio C Hamano [Mon, 2 May 2016 21:24:06 +0000 (14:24 -0700)]
Merge branch 'es/format-patch-doc-hide-no-patch' into maint
"git format-patch --help" showed `-s` and `--no-patch` as if these
are valid options to the command. We already hide `--patch` option
from the documentation, because format-patch is about showing the
diff, and the documentation now hides these options as well.
* es/format-patch-doc-hide-no-patch:
git-format-patch.txt: don't show -s as shorthand for multiple options
Junio C Hamano [Mon, 2 May 2016 21:24:05 +0000 (14:24 -0700)]
Merge branch 'ky/branch-m-worktree' into maint
When "git worktree" feature is in use, "git branch -m" renamed a
branch that is checked out in another worktree without adjusting
the HEAD symbolic ref for the worktree.
* ky/branch-m-worktree:
set_worktree_head_symref(): fix error message
branch -m: update all per-worktree HEADs
refs: add a new function set_worktree_head_symref
Junio C Hamano [Mon, 2 May 2016 21:24:05 +0000 (14:24 -0700)]
Merge branch 'ky/branch-d-worktree' into maint
When "git worktree" feature is in use, "git branch -d" allowed
deletion of a branch that is checked out in another worktree
* ky/branch-d-worktree:
branch -d: refuse deleting a branch which is currently checked out
Junio C Hamano [Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)]
Merge branch 'jk/check-repository-format' into maint
The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.
* jk/check-repository-format:
verify_repository_format: mark messages for translation
setup: drop repository_format_version global
setup: unify repository version callbacks
init: use setup.c's repo version verification
setup: refactor repo format reading and verification
config: drop git_config_early
check_repository_format_gently: stop using git_config_early
lazily load core.sharedrepository
wrap shared_repository global in get/set accessors
setup: document check_repository_format()
Junio C Hamano [Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)]
Merge branch 'ew/send-email-readable-message-id' into maint
"git send-email" now uses a more readable timestamps when
formulating a message ID.
* ew/send-email-readable-message-id:
send-email: more meaningful Message-ID
Junio C Hamano [Fri, 29 Apr 2016 21:18:16 +0000 (14:18 -0700)]
Git 2.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 29 Apr 2016 21:16:01 +0000 (14:16 -0700)]
Merge branch 'js/mingw-tests-2.8' into maint
Code clean-up.
* js/mingw-tests-2.8:
Windows: shorten code by re-using convert_slashes()
Junio C Hamano [Fri, 29 Apr 2016 21:16:00 +0000 (14:16 -0700)]
Merge branch 'ep/trace-doc-sample-fix' into maint
Fix a typo in an example in the trace API documentation.
* ep/trace-doc-sample-fix:
api-trace.txt: fix typo
Junio C Hamano [Fri, 29 Apr 2016 21:15:59 +0000 (14:15 -0700)]
Merge branch 'jc/makefile-redirection-stderr' into maint
A minor fix in the Makefile.
* jc/makefile-redirection-stderr:
Makefile: fix misdirected redirections
Junio C Hamano [Fri, 29 Apr 2016 21:15:58 +0000 (14:15 -0700)]
Merge branch 'ak/use-hashmap-iter-first-in-submodule-config' into maint
Minor code cleanup.
* ak/use-hashmap-iter-first-in-submodule-config:
submodule-config: use hashmap_iter_first()
Junio C Hamano [Fri, 29 Apr 2016 21:15:58 +0000 (14:15 -0700)]
Merge branch 'tb/blame-force-read-cache-to-workaround-safe-crlf' into maint
When running "git blame $path" with unnormalized data in the index
for the path, the data in the working tree was blamed, even though
"git add" would not have changed what is already in the index, due
to "safe crlf" that disables the line-end conversion. It has been
corrected.
* tb/blame-force-read-cache-to-workaround-safe-crlf:
correct blame for files commited with CRLF
Junio C Hamano [Fri, 29 Apr 2016 21:15:56 +0000 (14:15 -0700)]
Merge branch 'sk/send-pack-all-fix' into maint
"git send-pack --all <there>" was broken when its command line
option parsing was written in the 2.6 timeframe.
* sk/send-pack-all-fix:
git-send-pack: fix --all option when used with directory
Junio C Hamano [Fri, 29 Apr 2016 21:15:55 +0000 (14:15 -0700)]
Merge branch 'sg/diff-multiple-identical-renames' into maint
"git diff -M" used to work better when two originally identical
files A and B got renamed to X/A and X/B by pairing A to X/A and B
to X/B, but this was broken in the 2.0 timeframe.
* sg/diff-multiple-identical-renames:
diffcore: fix iteration order of identical files during rename detection
Junio C Hamano [Fri, 29 Apr 2016 21:15:54 +0000 (14:15 -0700)]
Merge branch 'ss/msvc' into maint
Build updates for MSVC.
* ss/msvc:
MSVC: use shipped headers instead of fallback definitions
MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more
Junio C Hamano [Mon, 25 Apr 2016 20:36:26 +0000 (13:36 -0700)]
Merge tag 'l10n-2.8.0-rnd3-fr' of git://github.com/git-l10n/git-po into maint
l10n-2.8.0-rnd3-fr
* tag 'l10n-2.8.0-rnd3-fr' of git://github.com/git-l10n/git-po:
l10n: fr: don't translate "merge" as a parameter
l10n: fr: change "id de clé" to match "id-clé"
l10n: fr: fix wrongly translated option name
l10n: fr: fix transcation of "dir"
Jiang Xin [Sun, 24 Apr 2016 12:36:34 +0000 (20:36 +0800)]
Merge branch 'fr_v2.8.0_r3' of git://github.com/jnavila/git into maint
* 'fr_v2.8.0_r3' of git://github.com/jnavila/git:
l10n: fr: don't translate "merge" as a parameter
l10n: fr: change "id de clé" to match "id-clé"
l10n: fr: fix wrongly translated option name
l10n: fr: fix transcation of "dir"
Junio C Hamano [Fri, 15 Apr 2016 01:58:11 +0000 (18:58 -0700)]
Prepare for 2.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 15 Apr 2016 01:57:49 +0000 (18:57 -0700)]
Merge branch 'jv/merge-nothing-into-void' into maint
"git merge FETCH_HEAD" dereferenced NULL pointer when merging
nothing into an unborn history (which is arguably unusual usage,
which perhaps was the reason why nobody noticed it).
* jv/merge-nothing-into-void:
merge: fix NULL pointer dereference when merging nothing into void
Junio C Hamano [Fri, 15 Apr 2016 01:57:48 +0000 (18:57 -0700)]
Merge branch 'ss/commit-squash-msg' into maint
When "git merge --squash" stopped due to conflict, the concluding
"git commit" failed to read in the SQUASH_MSG that shows the log
messages from all the squashed commits.
* ss/commit-squash-msg:
commit: do not lose SQUASH_MSG contents
Junio C Hamano [Fri, 15 Apr 2016 01:57:47 +0000 (18:57 -0700)]
Merge branch 'jk/send-email-rtrim-mailrc-alias' into maint
"git send-email" had trouble parsing alias file in mailrc format
when lines in it had trailing whitespaces on them.
* jk/send-email-rtrim-mailrc-alias:
send-email: ignore trailing whitespace in mailrc alias file
Junio C Hamano [Fri, 15 Apr 2016 01:57:47 +0000 (18:57 -0700)]
Merge branch 'da/mergetool-delete-delete-conflict' into maint
"git mergetool" did not work well with conflicts that both sides
deleted.
* da/mergetool-delete-delete-conflict:
mergetool: honor tempfile configuration when resolving delete conflicts
mergetool: support delete/delete conflicts
Junio C Hamano [Fri, 15 Apr 2016 01:57:46 +0000 (18:57 -0700)]
Merge branch 'jk/startup-info' into maint
The startup_info data, which records if we are working inside a
repository (among other things), are now uniformly available to Git
subcommand implementations, and Git avoids attempting to touch
references when we are not in a repository.
* jk/startup-info:
use setup_git_directory() in test-* programs
grep: turn off gitlink detection for --no-index
mailmap: do not resolve blobs in a non-repository
remote: don't resolve HEAD in non-repository
setup: set startup_info->have_repository more reliably
setup: make startup_info available everywhere
Junio C Hamano [Fri, 15 Apr 2016 01:57:46 +0000 (18:57 -0700)]
Merge branch 'jk/getwholeline-getdelim-empty' into maint
strbuf_getwholeline() did not NUL-terminate the buffer on certain
corner cases in its error codepath.
* jk/getwholeline-getdelim-empty:
strbuf_getwholeline: NUL-terminate getdelim buffer on error
Junio C Hamano [Fri, 15 Apr 2016 01:57:45 +0000 (18:57 -0700)]
Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath' into maint
A small memory leak in an error codepath has been plugged in xdiff
code.
* rj/xdiff-prepare-plug-leak-on-error-codepath:
xdiff/xprepare: fix a memory leak
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
Junio C Hamano [Fri, 15 Apr 2016 01:57:44 +0000 (18:57 -0700)]
Merge branch 'gf/fetch-pack-direct-object-fetch' into maint
Fetching of history by naming a commit object name directly didn't
work across remote-curl transport.
* gf/fetch-pack-direct-object-fetch:
fetch-pack: update the documentation for "<refs>..." arguments
fetch-pack: fix object_id of exact sha1
Junio C Hamano [Fri, 15 Apr 2016 01:57:44 +0000 (18:57 -0700)]
Merge branch 'jk/rev-parse-local-env-vars' into maint
The "--local-env-vars" and "--resolve-git-dir" options of "git
rev-parse" failed to work outside a repository when the command's
option parsing was rewritten in 1.8.5 era.
* jk/rev-parse-local-env-vars:
rev-parse: let some options run outside repository
t1515: add tests for rev-parse out-of-repo helpers
Junio C Hamano [Fri, 15 Apr 2016 01:57:43 +0000 (18:57 -0700)]
Merge branch 'jk/config-get-urlmatch' into maint
"git config --get-urlmatch", unlike other variants of the "git
config --get" family, did not signal error with its exit status
when there was no matching configuration.
* jk/config-get-urlmatch:
Documentation/git-config: fix --get-all description
Documentation/git-config: use bulleted list for exit codes
config: fail if --get-urlmatch finds no value
Junio C Hamano [Fri, 15 Apr 2016 01:37:18 +0000 (18:37 -0700)]
Merge branch 'pb/t7502-drop-dup' into maint
Code clean-up.
* pb/t7502-drop-dup:
t/t7502 : drop duplicate test
Junio C Hamano [Fri, 15 Apr 2016 01:37:17 +0000 (18:37 -0700)]
Merge branch 'jk/test-httpd-config-nosystem' into maint
The tests that involve running httpd leaked the system-wide
configuration in /etc/gitconfig to the tested environment.
* jk/test-httpd-config-nosystem:
t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env
Junio C Hamano [Fri, 15 Apr 2016 01:37:16 +0000 (18:37 -0700)]
Merge branch 'sb/clone-t57-t56' into maint
Rename bunch of tests on "git clone" for better organization.
* sb/clone-t57-t56:
clone tests: rename t57* => t56*
Junio C Hamano [Fri, 15 Apr 2016 01:37:16 +0000 (18:37 -0700)]
Merge branch 'jk/credential-cache-comment-exit' into maint
A code clarification.
* jk/credential-cache-comment-exit:
credential-cache--daemon: clarify "exit" action semantics
Junio C Hamano [Fri, 15 Apr 2016 01:37:15 +0000 (18:37 -0700)]
Merge branch 'jc/index-pack' into maint
Code clean-up.
* jc/index-pack:
index-pack: add a helper function to derive .idx/.keep filename
index-pack: correct --keep[=<msg>]
Junio C Hamano [Fri, 15 Apr 2016 01:37:15 +0000 (18:37 -0700)]
Merge branch 'ss/exc-flag-is-a-collection-of-bits' into maint
Code clean-up.
* ss/exc-flag-is-a-collection-of-bits:
dir: store EXC_FLAG_* values in unsigned integers
Junio C Hamano [Fri, 15 Apr 2016 01:37:14 +0000 (18:37 -0700)]
Merge branch 'mp/upload-pack-use-embedded-args' into maint
The embedded args argv-array in the child process is used to build
the command line to run pack-objects instead of using a separate
array of strings.
* mp/upload-pack-use-embedded-args:
upload-pack: use argv_array for pack_objects
Junio C Hamano [Fri, 15 Apr 2016 01:37:14 +0000 (18:37 -0700)]
Merge branch 'oa/doc-diff-check' into maint
A minor documentation update.
* oa/doc-diff-check:
Documentation: git diff --check detects conflict markers
Junio C Hamano [Fri, 15 Apr 2016 01:37:13 +0000 (18:37 -0700)]
Merge branch 'pb/opt-cmdmode-doc' into maint
Minor API documentation update.
* pb/opt-cmdmode-doc:
api-parse-options.txt: document OPT_CMDMODE()
Junio C Hamano [Fri, 15 Apr 2016 01:37:13 +0000 (18:37 -0700)]
Merge branch 'nd/apply-doc' into maint
A minor documentation update.
* nd/apply-doc:
git-apply.txt: mention the behavior inside a subdir
git-apply.txt: remove a space
Junio C Hamano [Fri, 15 Apr 2016 01:37:12 +0000 (18:37 -0700)]
Merge branch 'cc/doc-recommend-performance-trace-to-file' into maint
A minor documentation update.
* cc/doc-recommend-performance-trace-to-file:
Documentation: talk about pager in api-trace.txt
Junio C Hamano [Fri, 15 Apr 2016 01:37:12 +0000 (18:37 -0700)]
Merge branch 'mm/lockfile-error-message' into maint
* mm/lockfile-error-message:
lockfile: improve error message when lockfile exists
lockfile: mark strings for translation
Junio C Hamano [Wed, 13 Apr 2016 23:30:00 +0000 (16:30 -0700)]
Start preparing for 2.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kazuki Yamaguchi [Fri, 8 Apr 2016 14:02:30 +0000 (23:02 +0900)]
imap-send: fix CRAM-MD5 response calculation
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>
Kazuki Yamaguchi [Fri, 8 Apr 2016 14:02:24 +0000 (23:02 +0900)]
imap-send: check for NOLOGIN capability only when using LOGIN command
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>
Jeff King [Sat, 9 Apr 2016 17:43:54 +0000 (13:43 -0400)]
git_config_set_multivar_in_file: handle "unset" errors
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>
Jeff King [Sat, 9 Apr 2016 17:42:54 +0000 (13:42 -0400)]
git_config_set_multivar_in_file: all non-zero returns are errors
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>
Jeff King [Sat, 9 Apr 2016 17:42:31 +0000 (13:42 -0400)]
config: lower-case first word of error strings
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>
Junio C Hamano [Fri, 8 Apr 2016 19:16:06 +0000 (12:16 -0700)]
http: differentiate socks5:// and socks5h://
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>
Kazuki Yamaguchi [Fri, 8 Apr 2016 08:03:07 +0000 (17:03 +0900)]
set_worktree_head_symref(): fix error message
Emit an informative error when failed to hold lock of HEAD.
2233066e (refs: add a new function set_worktree_head_symref,
2016-03-27) added set_worktree_head_symref(), but this is missing a
call to unable_to_lock_message() after hold_lock_file_for_update()
fails, so it emits an empty error message:
% git branch -m oldname newname
error:
error: HEAD of working tree /path/to/wt is not updated
fatal: Branch renamed to newname, but HEAD is not updated!
Thanks to Eric Sunshine for pointing this out.
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 7 Apr 2016 19:56:26 +0000 (12:56 -0700)]
commit: do not ignore an empty message given by -m ''
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>
Adam Dinwoodie [Wed, 6 Apr 2016 17:15:03 +0000 (18:15 +0100)]
commit: --amend -m '' silently fails to wipe message
`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>
Eric Wong [Wed, 6 Apr 2016 20:25:38 +0000 (20:25 +0000)]
send-email: do not load Data::Dumper
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>
Eric Wong [Wed, 6 Apr 2016 20:07:14 +0000 (20:07 +0000)]
send-email: more meaningful Message-ID
Using a YYYYmmddHHMMSS date representation is more meaningful to
humans, especially when used for lookups on NNTP servers or linking
to archive sites via Message-ID (e.g. mid.gmane.org or
mid.mail-archive.com). This timestamp format more easily gives a
reader of the URL itself a rough date of a linked message compared
to having them calculate the seconds since the Unix epoch.
Furthermore, having the MUA name in the Message-ID seems to be a
rare oddity I haven't noticed outside of git-send-email. We
already have an optional X-Mailer header field to advertise for
us, so extending the Message-ID by 15 characters can make for
unpleasant Message-ID-based URLs to archive sites.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen [Tue, 5 Apr 2016 19:23:54 +0000 (21:23 +0200)]
correct blame for files commited with CRLF
git blame reports lines as not "Not Committed Yet" when they have
CRLF in the index, CRLF in the worktree and core.autocrlf is true.
Since commit
c4805393 (autocrlf: Make it work also for un-normalized
repositories, 2010-05-12), files that have CRLF in the index are not
normalized at commit when core.autocrl is set.
Add a call to read_cache() early in fake_working_tree_commit(),
before calling convert_to_git().
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto [Tue, 5 Apr 2016 10:05:23 +0000 (10:05 +0000)]
api-trace.txt: fix typo
The correct api is trace_printf_key(), not trace_print_key().
Also do not throw a random string at printf(3)-like function;
instead, feed it as a parameter that is fed to a "%s" conversion
specifier.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 5 Apr 2016 07:02:14 +0000 (00:02 -0700)]
Makefile: fix misdirected redirections
In general "echo 2>&1 $msg" to redirect a possible error message
that comes from 'echo' itself into the same standard output stream
$msg is getting written to does not make any sense; it is not like
we are expecting to see any errors out of 'echo' in these statements,
and even if it were the case, there is no reason to prevent the
error messages from being sent to the standard error stream.
These are clearly meant to send the argument given to echo to the
standard error stream as error messages. Correctly redirect by
saying "send what is written to the standard output to the standard
error", i.e. "1>&2" aka ">&2".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Sun, 3 Apr 2016 04:14:26 +0000 (00:14 -0400)]
branch: fix shortening of non-remote symrefs
Commit
aedcb7d (branch.c: use 'ref-filter' APIs, 2015-09-23)
adjusted the symref-printing code to look like this:
if (item->symref) {
skip_prefix(item->symref, "refs/remotes/", &desc);
strbuf_addf(&out, " -> %s", desc);
}
This has three bugs in it:
1. It always skips past "refs/remotes/", instead of
skipping past the prefix associated with the branch we
are showing (so commonly we see "refs/remotes/" for the
refs/remotes/origin/HEAD symref, but the previous code
would skip "refs/heads/" when showing a symref it found
in refs/heads/.
2. If skip_prefix() does not match, it leaves "desc"
untouched, and we show whatever happened to be in it
(which is the refname from a call to skip_prefix()
earlier in the function).
3. If we do match with skip_prefix(), we stomp on the
"desc" variable, which is later passed to
add_verbose_info(). We probably want to retain the
original refname there (though it likely doesn't matter
in practice, since after all, one points to the other).
The fix to match the original code is fairly easy: record
the prefix to strip based on item->kind, and use it here.
However, since we already have a local variable named "prefix",
let's give the two prefixes verbose names so we don't
confuse them.
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt [Sat, 2 Apr 2016 19:03:14 +0000 (21:03 +0200)]
Windows: shorten code by re-using convert_slashes()
Make a few more spots more readable by using the recently introduced,
Windows-specific helper.
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>
Eric Sunshine [Sun, 27 Mar 2016 21:26:07 +0000 (17:26 -0400)]
git-format-patch.txt: don't show -s as shorthand for multiple options
git-format-patch recognizes -s as shorthand only for --signoff, however,
its documentation shows -s as shorthand for both --signoff and
--no-patch. Resolve this confusion by suppressing the bogus -s shorthand
for --no-patch.
While here, also avoid showing the --no-patch option in git-format-patch
documentation since it doesn't make sense to ask to suppress the patch
while at the same time explicitly asking to format the patch (which,
after all, is the purpose of git-format-patch).
Reported-by: Kevin Brodsky <corax26@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kazuki Yamaguchi [Sun, 27 Mar 2016 14:37:14 +0000 (23:37 +0900)]
branch -m: update all per-worktree HEADs
When renaming a branch, currently only the HEAD of current working tree
is updated, but it must update HEADs of all working trees which point at
the old branch.
This is the current behavior, /path/to/wt's HEAD is not updated:
% git worktree list
/path/to
2c3c5f2 [master]
/path/to/wt
2c3c5f2 [oldname]
% git branch -m master master2
% git worktree list
/path/to
2c3c5f2 [master2]
/path/to/wt
2c3c5f2 [oldname]
% git branch -m oldname newname
% git worktree list
/path/to
2c3c5f2 [master2]
/path/to/wt
0000000 [oldname]
This patch fixes this issue by updating all relevant worktree HEADs
when renaming a branch.
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kazuki Yamaguchi [Sun, 27 Mar 2016 14:37:13 +0000 (23:37 +0900)]
refs: add a new function set_worktree_head_symref
Add a new function set_worktree_head_symref, to update HEAD symref for
the specified worktree.
To update HEAD of a linked working tree,
create_symref("worktrees/$work_tree/HEAD", "refs/heads/$branch", msg)
could be used. However when it comes to updating HEAD of the main
working tree, it is unusable because it uses $GIT_DIR for
worktree-specific symrefs (HEAD).
The new function takes git_dir (real directory) as an argument, and
updates HEAD of the working tree. This function will be used when
renaming a branch.
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Acked-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 3 Apr 2016 17:11:35 +0000 (10:11 -0700)]
Git 2.8.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 3 Apr 2016 17:13:09 +0000 (10:13 -0700)]
Merge branch 'mm/readme-markdown' into maint
* 'mm/readme-markdown':
git.spec.in: use README.md, not README
Matthieu Moy [Fri, 1 Apr 2016 07:10:51 +0000 (09:10 +0200)]
git.spec.in: use README.md, not README
The file was renamed in
4ad21f5 (README: use markdown syntax,
2016-02-25), but that commit forgot to update git.spec.in, which
caused the rpmbuild target in the Makefile to fail.
Reported-by: Ron Isaacson <isaacson.ljits@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Fri, 1 Apr 2016 00:17:29 +0000 (17:17 -0700)]
submodule--helper, module_clone: catch fprintf failure
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>
Junio C Hamano [Fri, 1 Apr 2016 19:23:16 +0000 (12:23 -0700)]
submodule--helper: do not borrow absolute_path() result for too long
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>
Stefan Beller [Fri, 1 Apr 2016 00:17:28 +0000 (17:17 -0700)]
submodule--helper, module_clone: always operate on absolute paths
When giving relative paths to `relative_path` to compute a relative path
from one directory to another, this may fail in `relative_path`.
Make sure both arguments to `relative_path` are always absolute.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Thu, 31 Mar 2016 21:04:38 +0000 (14:04 -0700)]
submodule--helper clone: create the submodule path just once
We make sure that the parent directory of path exists (or create it
otherwise) and then do the same for path + "/.git".
That is equivalent to just making sure that the parent directory of
path + "/.git" exists (or create it otherwise).
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Thu, 31 Mar 2016 21:04:37 +0000 (14:04 -0700)]
submodule--helper: fix potential NULL-dereference
Don't dereference NULL 'path' if it was never assigned. Also
protect against an empty --path argument.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller [Thu, 31 Mar 2016 21:04:36 +0000 (14:04 -0700)]
recursive submodules: test for relative paths
"git submodule update --init --recursive" uses full path to refer to
the true location of the repository in the "gitdir:" pointer for
nested submodules; the command used to use relative paths.
This was reported by Norio Nomura in $gmane/290280.
The root cause for that bug is in using recursive submodules as
their relative path handling was broken in
ee8838d (2015-09-08,
submodule: rewrite `module_clone` shell function in C).
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stanislav Kolotinskiy [Thu, 31 Mar 2016 13:55:09 +0000 (16:55 +0300)]
git-send-pack: fix --all option when used with directory
When using git send-pack with --all option
and a target repository specification ([<host>:]<directory>),
usage message is being displayed instead of performing
the actual transmission.
The reason for this issue is that destination and refspecs are being set
in the same conditional and are populated from argv. When a target
repository is passed, refspecs is being populated as well with its value.
This makes the check for refspecs not being NULL to always return true,
which, in conjunction with the check for --all or --mirror options,
is always true as well and returns usage message instead of proceeding.
This ensures that send-pack will stop execution only when --all
or --mirror switch is used in conjunction with any refspecs passed.
Signed-off-by: Stanislav Kolotinskiy <stanislav@assembla.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor [Wed, 30 Mar 2016 08:35:07 +0000 (10:35 +0200)]
diffcore: fix iteration order of identical files during rename detection
If the two paths 'dir/A/file' and 'dir/B/file' have identical content
and the parent directory is renamed, e.g. 'git mv dir other-dir', then
diffcore reports the following exact renames:
renamed: dir/B/file -> other-dir/A/file
renamed: dir/A/file -> other-dir/B/file
While technically not wrong, this is confusing not only for the user,
but also for git commands that make decisions based on rename
information, e.g. 'git log --follow other-dir/A/file' follows
'dir/B/file' past the rename.
This behavior is a side effect of commit v2.0.0-rc4~8^2~14
(diffcore-rename.c: simplify finding exact renames, 2013-11-14): the
hashmap storing sources returns entries from the same bucket, i.e.
sources matching the current destination, in LIFO order. Thus the
iteration first examines 'other-dir/A/file' and 'dir/B/file' and, upon
finding identical content and basename, reports an exact rename.
Other hashmap users are apparently happy with the current iteration
order over the entries of a bucket. Changing the iteration order
would risk upsetting other hashmap users and would increase the memory
footprint of each bucket by a pointer to the tail element.
Fill the hashmap with source entries in reverse order to restore the
original exact rename detection behavior.
Reported-by: Bill Okara <billokara@gmail.com>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sven Strickroth [Wed, 30 Mar 2016 11:37:36 +0000 (13:37 +0200)]
MSVC: use shipped headers instead of fallback definitions
VS2010 comes with stdint.h [1]
VS2013 comes with inttypes.h [2]
[1] https://stackoverflow.com/a/
2628014/
3906760
[2] https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/
Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sven Strickroth [Tue, 29 Mar 2016 16:25:28 +0000 (18:25 +0200)]
MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more
In MSVC2015 the behavior of vsnprintf was changed.
W/o this fix there is one character missing at the end.
Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ori Avtalion [Tue, 29 Mar 2016 18:59:45 +0000 (21:59 +0300)]
Documentation: git diff --check detects conflict markers
Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kazuki Yamaguchi [Tue, 29 Mar 2016 09:38:39 +0000 (18:38 +0900)]
branch -d: refuse deleting a branch which is currently checked out
When a branch is checked out by current working tree, deleting the
branch is forbidden. However when the branch is checked out only by
other working trees, deleting incorrectly succeeds.
Use find_shared_symref() to check if the branch is in use, not just
comparing with the current working tree's HEAD.
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 28 Mar 2016 19:19:45 +0000 (12:19 -0700)]
Git 2.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pranit Bauva [Fri, 25 Mar 2016 18:58:58 +0000 (18:58 +0000)]
api-parse-options.txt: document OPT_CMDMODE()
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila [Fri, 25 Mar 2016 16:11:20 +0000 (17:11 +0100)]
Merge pull request #9 from vascool/fr
Fix inconsistencies
Vasco Almeida [Tue, 15 Mar 2016 00:34:22 +0000 (23:34 -0100)]
l10n: fr: don't translate "merge" as a parameter
At builtin/checkout.c:1154, merge is a parameter to --conflict=<style>
(git checkout --conflict=merge).
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Vasco Almeida [Tue, 15 Mar 2016 00:34:22 +0000 (23:34 -0100)]
l10n: fr: change "id de clé" to match "id-clé"
At builtin/tag.c:23 French message translation, "<key-id>" was
translated to "<id-clé>", but at builtin/tag.c:355 "key-id" was
translated to "id de clé", hence an inconsistency in git tag -h output.
Translate "key-id" to "id-clé".
Alternatively, both places could use "id de clé" instead of "id-clé".
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Vasco Almeida [Sun, 13 Mar 2016 12:56:03 +0000 (11:56 -0100)]
l10n: fr: fix wrongly translated option name
In the original source, tags and heads refer to that options (--head and
--tags) for git show-ref.
Don't translate that terms, since they refer to actual option names.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Vasco Almeida [Sun, 13 Mar 2016 12:56:03 +0000 (11:56 -0100)]
l10n: fr: fix transcation of "dir"
"dir" was translated to the same string at builtin/log.c:1236,
but, also at that code line, "<dir>" was translate to "<répertoire>".
Before this commit, git format-patch -h would output "-o,
--output-directory <dir>" and <répertoire> in its description.
Use <répertoire> in both the parameter and description.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Junio C Hamano [Thu, 24 Mar 2016 19:28:06 +0000 (12:28 -0700)]
Merge branch 'ls/p4-doc-markup'
* ls/p4-doc-markup:
Documentation: fix git-p4 AsciiDoc formatting
Documentation: use ASCII quotation marks in git-p4
Junio C Hamano [Thu, 24 Mar 2016 19:27:58 +0000 (12:27 -0700)]
Merge branch 'js/mingw-tests-2.8'
* js/mingw-tests-2.8:
mingw: skip some tests in t9115 due to file name issues
t1300: fix the new --show-origin tests on Windows
t1300-repo-config: make it resilient to being run via 'sh -x'
config --show-origin: report paths with forward slashes
Junio C Hamano [Thu, 24 Mar 2016 19:27:12 +0000 (12:27 -0700)]
Merge branch 'sb/submodule-module-list-pathspec-fix'
A fix for a small regression in "module_list" helper that was
rewritten in C (also applies to 2.7.x).
* sb/submodule-module-list-pathspec-fix:
submodule: fix regression for deinit without submodules
Nguyễn Thái Ngọc Duy [Thu, 24 Mar 2016 11:56:17 +0000 (18:56 +0700)]
git-apply.txt: mention the behavior inside a subdir
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 24 Mar 2016 11:56:16 +0000 (18:56 +0700)]
git-apply.txt: remove a space
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexander Kuleshov [Wed, 16 Mar 2016 07:46:31 +0000 (13:46 +0600)]
submodule-config: use hashmap_iter_first()
The hashmap API provides hashmap_iter_first() helper for initialion
and getting the first entry of a hashmap. Let's use it instead of
doing initialization manually and then get the first entry.
There are no functional changes, just cleanup.
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 23 Mar 2016 19:22:42 +0000 (12:22 -0700)]
Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
l10n: pt_PT: Update and add new translations
l10n: ca.po: update translation
l10n: vi.po (2530t): Update translation
Junio C Hamano [Mon, 21 Mar 2016 19:01:43 +0000 (12:01 -0700)]
merge: fix NULL pointer dereference when merging nothing into void
When we are on an unborn branch and merging only one foreign parent,
we allow "git merge" to fast-forward to that foreign parent commit.
This codepath incorrectly attempted to dereference the list of
parents that the merge is going to record even when the list is
empty. It must refuse to operate instead when there is no parent.
All other codepaths make sure the list is not empty before they
dereference it, and are safe.
Reported-by: Jose Ivan B. Vilarouca Filho
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Wed, 23 Mar 2016 10:59:01 +0000 (11:59 +0100)]
Documentation: fix git-p4 AsciiDoc formatting
Noticed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 23 Mar 2016 10:55:20 +0000 (11:55 +0100)]
mingw: skip some tests in t9115 due to file name issues
These two tests wanted to write file names which are incompatible with
Windows' file naming rules (even if they pass using Cygwin due to
Cygwin's magic path mangling).
While at it, skip the same tests also on MacOSX/HFS, as pointed out by
Torsten Bögershausen.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 23 Mar 2016 10:55:13 +0000 (11:55 +0100)]
t1300: fix the new --show-origin tests on Windows
On Windows, we have that funny situation where the test script can refer
to POSIX paths because it runs in a shell that uses a POSIX emulation
layer ("MSYS2 runtime"). Yet, git.exe does *not* understand POSIX paths
at all but only pure Windows paths.
So let's just convert the POSIX paths to Windows paths before passing
them on to Git, using `pwd` (which is already modified on Windows to
output Windows paths).
While fixing the new tests on Windows, we also have to exclude the tests
that want to write a file with a name that is illegal on Windows
(unfortunately, there is more than one test trying to make use of that
file).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>