OSDN Git Service
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 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>
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>
Johannes Schindelin [Wed, 23 Mar 2016 10:55:07 +0000 (11:55 +0100)]
t1300-repo-config: make it resilient to being run via 'sh -x'
One way to diagnose broken regression tests is to run the test
script using 'sh -x t... -i -v' to find out which call actually
demonstrates the symptom.
Hence it is pretty counterproductive if the test script behaves
differently when being run via 'sh -x', in particular when using
test_cmp or test_i18ncmp on redirected stderr. A more recent way
"sh tXXXX -i -v -x" has the same issue.
So let's use test_i18ngrep (as suggested by Jonathan Nieder) instead of
test_cmp/test_i18ncmp to verify that stderr looks as expected.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Wed, 23 Mar 2016 10:55:00 +0000 (11:55 +0100)]
config --show-origin: report paths with forward slashes
On Windows, the backslash is the native directory separator, but all
supported Windows versions also accept the forward slash in most
circumstances.
Our tests expect forward slashes.
Relative paths are generated by Git using forward slashes.
So let's try to be consistent and use forward slashes in the $HOME part
of the paths reported by `git config --show-origin`, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Wed, 23 Mar 2016 15:01:51 +0000 (23:01 +0800)]
Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
l10n: vi.po (2530t): Update translation
Jiang Xin [Wed, 23 Mar 2016 14:48:14 +0000 (22:48 +0800)]
Merge branch 'master' of git://github.com/alexhenrie/git-po
* 'master' of git://github.com/alexhenrie/git-po:
l10n: ca.po: update translation
Stefan Beller [Tue, 22 Mar 2016 23:42:14 +0000 (16:42 -0700)]
submodule: fix regression for deinit without submodules
Per Cederqvist wrote:
> It used to be possible to run
>
> git submodule deinit -f .
>
> to remove any submodules, no matter how many submodules you had. That
> is no longer possible in projects that don't have any submodules at
> all. The command will fail with:
>
> error: pathspec '.' did not match any file(s) known to git.
This regression was introduced in
74703a1e4dfc (submodule: rewrite
`module_list` shell function in C, 2015-09-02), as we changed the
order of checking in new module listing to first check whether it is
a gitlin before feeding it to match_pathspec(). It used to be that
a pathspec that does not match any path were diagnosed as an error,
but the new code complains for a pathspec that does not match any
submodule path.
Arguably the new behaviour may give us a better diagnosis, but that
is inconsistent with the suggestion "deinit" gives, and also this
was an unintended accident. The new behaviour hopefully can be
redesigned and implemented better in future releases, but for now,
switch these two checks to restore the same behavior as before. In
an empty repository, giving the pathspec '.' will still get the same
"did not match" error, but that is the same bug we had before 1.7.0.
Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida [Fri, 29 Jan 2016 20:06:29 +0000 (19:06 -0100)]
l10n: pt_PT: Update and add new translations
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Alex Henrie [Tue, 22 Mar 2016 05:04:22 +0000 (23:04 -0600)]
l10n: ca.po: update translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Sven Strickroth [Mon, 21 Mar 2016 22:29:40 +0000 (23:29 +0100)]
commit: do not lose SQUASH_MSG contents
When concluding a conflicted "git merge --squash", the command
failed to read SQUASH_MSG that was prepared by "git merge", and
showed only the "# Conflicts:" list of conflicted paths.
Place the contents from SQUASH_MSG at the beginning, just like we
show the commit log skeleton first when concluding a normal merge,
and then show the "# Conflicts:" list, to help the user write the
log message for the resulting commit.
Test by Junio C Hamano <gitster@pobox.com>.
Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 21 Mar 2016 20:41:37 +0000 (13:41 -0700)]
Git 2.8-rc4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 21 Mar 2016 20:32:42 +0000 (13:32 -0700)]
Sync with maint
* maint:
Documentation: fix broken linkgit to git-config
git-compat-util: st_add4: work around gcc 4.2.x compiler crash
Junio C Hamano [Mon, 21 Mar 2016 20:32:18 +0000 (13:32 -0700)]
Merge branch 'mm/doc-hooks-linkgit-fix' into maint
* mm/doc-hooks-linkgit-fix:
Documentation: fix broken linkgit to git-config
Matthieu Moy [Mon, 21 Mar 2016 18:38:34 +0000 (19:38 +0100)]
Documentation: fix broken linkgit to git-config
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Sun, 20 Mar 2016 18:39:21 +0000 (19:39 +0100)]
Documentation: use ASCII quotation marks in git-p4
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 21 Mar 2016 16:20:13 +0000 (09:20 -0700)]
Merge branch 'tb/avoid-gcc-on-darwin-10-6'
* tb/avoid-gcc-on-darwin-10-6:
Revert "config.mak.uname: use clang for Mac OS X 10.6"
Eric Sunshine [Mon, 21 Mar 2016 04:35:58 +0000 (00:35 -0400)]
Revert "config.mak.uname: use clang for Mac OS X 10.6"
This reverts commit
7b6daf8d2fee1a9866b1d4eddbfaa5dbc42c5dbb.
Now that st_add4() has been patched to work around the gcc 4.2.x
compiler crash, revert the sledge-hammer approach of forcing Mac OS X
10.6 to unconditionally use 'clang' rather than the default compiler
(gcc).
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>