OSDN Git Service
Junio C Hamano [Mon, 19 Dec 2016 22:45:29 +0000 (14:45 -0800)]
Merge branch 'jt/use-trailer-api-in-commands'
Commands that operate on a log message and add lines to the trailer
blocks, such as "format-patch -s", "cherry-pick (-x|-s)", and
"commit -s", have been taught to use the logic of and share the
code with "git interpret-trailer".
* jt/use-trailer-api-in-commands:
sequencer: use trailer's trailer layout
trailer: have function to describe trailer layout
trailer: avoid unnecessary splitting on lines
commit: make ignore_non_trailer take buf/len
trailer: be stricter in parsing separators
Junio C Hamano [Fri, 16 Dec 2016 23:30:13 +0000 (15:30 -0800)]
First batch for 2.12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 16 Dec 2016 23:27:50 +0000 (15:27 -0800)]
Merge branch 'ls/p4-retry-thrice'
* ls/p4-retry-thrice:
git-p4: add config to retry p4 commands; retry 3 times by default
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)]
Merge branch 'ls/p4-empty-file-on-lfs'
"git p4" LFS support was broken when LFS stores an empty blob.
* ls/p4-empty-file-on-lfs:
git-p4: fix empty file processing for large file system backend GitLFS
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)]
Merge branch 'ld/p4-update-shelve'
* ld/p4-update-shelve:
git-p4: support updating an existing shelved changelist
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)]
Merge branch 'vk/p4-submit-shelve'
* vk/p4-submit-shelve:
git-p4: allow submit to create shelved changelists.
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)]
Merge branch 'da/mergetool-trust-exit-code'
mergetool.<tool>.trustExitCode configuration variable did not apply
to built-in tools, but now it does.
* da/mergetool-trust-exit-code:
mergetools/vimdiff: trust Vim's exit code
mergetool: honor mergetool.$tool.trustExitCode for built-in tools
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)]
Merge branch 'ak/lazy-prereq-mktemp'
Test code clean-up.
* ak/lazy-prereq-mktemp:
t7610: clean up foo.XXXXXX tmpdir
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)]
Merge branch 'nd/worktree-list-fixup'
The output from "git worktree list" was made in readdir() order,
and was unstable.
* nd/worktree-list-fixup:
worktree list: keep the list sorted
worktree.c: get_worktrees() takes a new flag argument
get_worktrees() must return main worktree as first item even on error
worktree: reorder an if statement
worktree.c: zero new 'struct worktree' on allocation
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)]
Merge branch 'nd/qsort-in-merge-recursive'
Code simplification.
* nd/qsort-in-merge-recursive:
merge-recursive.c: use string_list_sort instead of qsort
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)]
Merge branch 'bw/push-dry-run'
"git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.
* bw/push-dry-run:
push: fix --dry-run to not push submodules
push: --dry-run updates submodules when --recurse-submodules=on-demand
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)]
Merge branch 'hv/submodule-not-yet-pushed-fix'
The code in "git push" to compute if any commit being pushed in the
superproject binds a commit in a submodule that hasn't been pushed
out was overly inefficient, making it unusable even for a small
project that does not have any submodule but have a reasonable
number of refs.
* hv/submodule-not-yet-pushed-fix:
submodule_needs_pushing(): explain the behaviour when we cannot answer
batch check whether submodule needs pushing into one call
serialize collection of refs that contain submodule changes
serialize collection of changed submodules
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)]
Merge branch 'dt/empty-submodule-in-merge'
An empty directory in a working tree that can simply be nuked used
to interfere while merging or cherry-picking a change to create a
submodule directory there, which has been fixed..
* dt/empty-submodule-in-merge:
submodules: allow empty working-tree dirs in merge/cherry-pick
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)]
Merge branch 'jk/rev-parse-symbolic-parents-fix'
"git rev-parse --symbolic" failed with a more recent notation like
"HEAD^-1" and "HEAD^!".
* jk/rev-parse-symbolic-parents-fix:
rev-parse: fix parent shorthands with --symbolic
Junio C Hamano [Tue, 13 Dec 2016 22:13:17 +0000 (14:13 -0800)]
Early fixes for 2.11.x series
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 13 Dec 2016 22:09:27 +0000 (14:09 -0800)]
Merge branch 'ew/svn-fixes'
* ew/svn-fixes:
git-svn: document useLogAuthor and addAuthorFrom config keys
git-svn: allow "0" in SVN path components
Junio C Hamano [Tue, 13 Dec 2016 22:09:27 +0000 (14:09 -0800)]
Merge branch 'js/mingw-isatty'
We often decide if a session is interactive by checking if the
standard I/O streams are connected to a TTY, but isatty() emulation
on Windows incorrectly returned true if it is used on NUL (i.e. an
equivalent to /dev/null). This has been fixed.
* js/mingw-isatty:
mingw: intercept isatty() to handle /dev/null as Git expects it
Eric Wong [Sun, 11 Dec 2016 00:06:46 +0000 (00:06 +0000)]
git-svn: document useLogAuthor and addAuthorFrom config keys
We've always supported these config keys in git-svn,
so document them so users won't have to respecify them
on every invocation.
Reported-by: Juergen Kosel <juergen.kosel@gmx.de>
Signed-off-by: Eric Wong <e@80x24.org>
Eric Wong [Wed, 30 Nov 2016 00:45:41 +0000 (00:45 +0000)]
git-svn: allow "0" in SVN path components
Blindly checking a path component for falsiness is unwise, as
"0" is false to Perl, but a valid pathname component for SVN
(or any filesystem).
Found via random code reading.
Signed-off-by: Eric Wong <e@80x24.org>
Johannes Schindelin [Sun, 11 Dec 2016 11:16:57 +0000 (12:16 +0100)]
mingw: intercept isatty() to handle /dev/null as Git expects it
When Git's source code calls isatty(), it really asks whether the
respective file descriptor is connected to an interactive terminal.
Windows' _isatty() function, however, determines whether the file
descriptor is associated with a character device. And NUL, Windows'
equivalent of /dev/null, is a character device.
Which means that for years, Git mistakenly detected an associated
interactive terminal when being run through the test suite, which
almost always redirects stdin, stdout and stderr to /dev/null.
This bug only became obvious, and painfully so, when the new
bisect--helper entered the `pu` branch and made the automatic build & test
time out because t6030 was waiting for an answer.
For details, see
https://msdn.microsoft.com/en-us/library/f4s0ddew.aspx
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Sun, 4 Dec 2016 16:03:37 +0000 (17:03 +0100)]
git-p4: fix empty file processing for large file system backend GitLFS
If git-p4 tried to store an empty file in GitLFS then it crashed while
parsing the pointer file:
oid = re.search(r'^oid \w+:(\w+)', pointerFile, re.MULTILINE).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
This happens because GitLFS does not create a pointer file for an empty
file. Teach git-p4 this behavior to fix the problem and add a test case.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Sun, 4 Dec 2016 14:03:11 +0000 (15:03 +0100)]
git-p4: add config to retry p4 commands; retry 3 times by default
P4 commands can fail due to random network issues. P4 users can counter
these issues by using a retry flag supported by all p4 commands [1].
Add an integer Git config value `git-p4.retries` to define the number of
retries for all p4 invocations. If the config is not defined then set
the default retry count to 3.
[1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Diamand [Fri, 2 Dec 2016 22:43:19 +0000 (22:43 +0000)]
git-p4: support updating an existing shelved changelist
Adds new option "--update-shelve CHANGELIST" which updates
an existing shelved changelist.
The original changelist must have been created by the current user.
This allows workflow something like:
hack hack hack
git commit
git p4 submit --shelve
$mail interested parties about shelved changelist
make corrections
git commit --amend
git p4 submit --update-shelve $CHANGELIST
$mail interested parties about shelved changelist
etc
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 5 Dec 2016 19:31:47 +0000 (11:31 -0800)]
Start post 2.11 cycle
For now, let's call it 2.12 tentatively.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 5 Dec 2016 19:25:47 +0000 (11:25 -0800)]
Sync with maint-2.10
* maint-2.10:
preparing for 2.10.3
Junio C Hamano [Mon, 5 Dec 2016 19:25:02 +0000 (11:25 -0800)]
preparing for 2.10.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 5 Dec 2016 19:24:17 +0000 (11:24 -0800)]
Merge branch 'jk/common-main' into maint-2.10
* jk/common-main:
common-main: stop munging argv[0] path
git-compat-util: move content inside ifdef/endif guards
Jonathan Tan [Wed, 2 Nov 2016 17:29:20 +0000 (10:29 -0700)]
sequencer: use trailer's trailer layout
Make sequencer use trailer.c's trailer layout definition, as opposed to
parsing the footer by itself. This makes "commit -s", "cherry-pick -x",
and "format-patch --signoff" consistent with trailer, allowing
non-trailer lines and multiple-line trailers in trailer blocks under
certain conditions, and therefore suppressing the extra newline in those
cases.
Consistency with trailer extends to respecting trailer configs. Tests
have been included to show that.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Wed, 2 Nov 2016 17:29:19 +0000 (10:29 -0700)]
trailer: have function to describe trailer layout
Create a function that, taking a string, describes the position of its
trailer block (if available) and the contents thereof, and make trailer
use it. This makes it easier for other Git components, in the future, to
interpret trailer blocks in the same way as trailer.
In a subsequent patch, another component will be made to use this.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Wed, 2 Nov 2016 17:29:18 +0000 (10:29 -0700)]
trailer: avoid unnecessary splitting on lines
trailer.c currently splits lines while processing a buffer (and also
rejoins lines when needing to invoke ignore_non_trailer).
Avoid such line splitting, except when generating the strings
corresponding to trailers (for ease of use by clients - a subsequent
patch will allow other components to obtain the layout of a trailer
block in a buffer, including the trailers themselves). The main purpose
of this is to make it easy to return pointers into the original buffer
(for a subsequent patch), but this also significantly reduces the number
of memory allocations required.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Wed, 2 Nov 2016 17:29:17 +0000 (10:29 -0700)]
commit: make ignore_non_trailer take buf/len
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Wed, 2 Nov 2016 17:29:16 +0000 (10:29 -0700)]
trailer: be stricter in parsing separators
Currently, a line is interpreted to be a trailer line if it contains a
separator. Make parsing stricter by requiring the text on the left of
the separator, if not the empty string, to be of the "<token><optional
whitespace>" form.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 29 Nov 2016 21:28:03 +0000 (13:28 -0800)]
Merge branch 'tk/diffcore-delta-remove-unused' into maint
Code cleanup.
* tk/diffcore-delta-remove-unused:
diffcore-delta: remove unused parameter to diffcore_count_changes()
Junio C Hamano [Tue, 29 Nov 2016 21:28:02 +0000 (13:28 -0800)]
Merge branch 'jk/create-branch-remove-unused-param' into maint
Code clean-up.
* jk/create-branch-remove-unused-param:
create_branch: drop unused "head" parameter
Junio C Hamano [Tue, 29 Nov 2016 21:28:02 +0000 (13:28 -0800)]
Merge branch 'nd/worktree-lock' into maint
Typofix.
* nd/worktree-lock:
git-worktree.txt: fix typo "to"/"two", and add comma
Junio C Hamano [Tue, 29 Nov 2016 21:28:01 +0000 (13:28 -0800)]
Merge branch 'ps/common-info-doc' into maint
Doc fix.
* ps/common-info-doc:
doc: fix location of 'info/' with $GIT_COMMON_DIR
Junio C Hamano [Tue, 29 Nov 2016 21:28:00 +0000 (13:28 -0800)]
Merge branch 'rs/cocci' into maint
Improve the rule to convert "unsigned char [20]" into "struct
object_id *" in contrib/coccinelle/
* rs/cocci:
cocci: avoid self-references in object_id transformations
Junio C Hamano [Tue, 29 Nov 2016 21:28:00 +0000 (13:28 -0800)]
Merge branch 'nd/test-helpers' into maint
Update to the test framework made in 2.9 timeframe broke running
the tests under valgrind, which has been fixed.
* nd/test-helpers:
valgrind: support test helpers
Junio C Hamano [Tue, 29 Nov 2016 21:27:59 +0000 (13:27 -0800)]
Merge branch 'sc/fmt-merge-msg-doc-markup-fix' into maint
Documentation fix.
* sc/fmt-merge-msg-doc-markup-fix:
Documentation/fmt-merge-msg: fix markup in example
Junio C Hamano [Tue, 29 Nov 2016 21:27:59 +0000 (13:27 -0800)]
Merge branch 'rs/commit-pptr-simplify' into maint
Code simplification.
* rs/commit-pptr-simplify:
commit: simplify building parents list
Junio C Hamano [Tue, 29 Nov 2016 21:27:58 +0000 (13:27 -0800)]
Merge branch 'jk/rebase-config-insn-fmt-docfix' into maint
Documentation fix.
* jk/rebase-config-insn-fmt-docfix:
doc: fix missing "::" in config list
Junio C Hamano [Tue, 29 Nov 2016 21:27:57 +0000 (13:27 -0800)]
Merge branch 'ak/pre-receive-hook-template-modefix' into maint
A trivial clean-up to a recently graduated topic.
* ak/pre-receive-hook-template-modefix:
pre-receive.sample: mark it executable
Junio C Hamano [Tue, 29 Nov 2016 21:27:56 +0000 (13:27 -0800)]
Merge branch 'ls/macos-update' into maint
Portability update and workaround for builds on recent Mac OS X.
* ls/macos-update:
travis-ci: disable GIT_TEST_HTTPD for macOS
Makefile: set NO_OPENSSL on macOS by default
Junio C Hamano [Tue, 29 Nov 2016 21:27:56 +0000 (13:27 -0800)]
Merge branch 'as/merge-attr-sleep' into maint
Fix for a racy false-positive test failure.
* as/merge-attr-sleep:
t6026: clarify the point of "kill $(cat sleep.pid)"
t6026: ensure that long-running script really is
Revert "t6026-merge-attr: don't fail if sleep exits early"
Revert "t6026-merge-attr: ensure that the merge driver was called"
t6026-merge-attr: ensure that the merge driver was called
t6026-merge-attr: don't fail if sleep exits early
Junio C Hamano [Tue, 29 Nov 2016 21:27:56 +0000 (13:27 -0800)]
Merge branch 'ak/sh-setup-dot-source-i18n-fix' into maint
Recent update to git-sh-setup (a library of shell functions that
are used by our in-tree scripted Porcelain commands) included
another shell library git-sh-i18n without specifying where it is,
relying on the $PATH. This has been fixed to be more explicit by
prefixing $(git --exec-path) output in front.
* ak/sh-setup-dot-source-i18n-fix:
git-sh-setup: be explicit where to dot-source git-sh-i18n from.
Junio C Hamano [Tue, 29 Nov 2016 21:27:55 +0000 (13:27 -0800)]
Merge branch 'jk/daemon-path-ok-check-truncation' into maint
"git daemon" used fixed-length buffers to turn URL to the
repository the client asked for into the server side directory
path, using snprintf() to avoid overflowing these buffers, but
allowed possibly truncated paths to the directory. This has been
tightened to reject such a request that causes overlong path to be
required to serve.
* jk/daemon-path-ok-check-truncation:
daemon: detect and reject too-long paths
Junio C Hamano [Tue, 29 Nov 2016 21:27:55 +0000 (13:27 -0800)]
Merge branch 'rs/ring-buffer-wraparound' into maint
The code that we have used for the past 10+ years to cycle
4-element ring buffers turns out to be not quite portable in
theoretical world.
* rs/ring-buffer-wraparound:
hex: make wraparound of the index into ring-buffer explicit
Junio C Hamano [Tue, 29 Nov 2016 21:27:54 +0000 (13:27 -0800)]
Merge branch 'mm/send-email-cc-cruft-after-address' into maint
"git send-email" attempts to pick up valid e-mails from the
trailers, but people in real world write non-addresses there, like
"Cc: Stable <add@re.ss> # 4.8+", which broke the output depending
on the availability and vintage of Mail::Address perl module.
* mm/send-email-cc-cruft-after-address:
Git.pm: add comment pointing to t9000
t9000-addresses: update expected results after fix
parse_mailboxes: accept extra text after <...> address
Junio C Hamano [Tue, 29 Nov 2016 21:27:53 +0000 (13:27 -0800)]
Merge branch 'cp/completion-negative-refs' into maint
The command-line completion script (in contrib/) learned to
complete "git cmd ^mas<HT>" to complete the negative end of
reference to "git cmd ^master".
* cp/completion-negative-refs:
completion: support excluding refs
Junio C Hamano [Tue, 29 Nov 2016 21:27:53 +0000 (13:27 -0800)]
Merge branch 'jc/am-read-author-file' into maint
Extract a small helper out of the function that reads the authors
script file "git am" internally uses.
This by itself is not useful until a second caller appears in the
future for "rebase -i" helper.
* jc/am-read-author-file:
am: refactor read_author_script()
Junio C Hamano [Tue, 29 Nov 2016 20:23:07 +0000 (12:23 -0800)]
Git 2.11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 29 Nov 2016 20:22:13 +0000 (12:22 -0800)]
Merge branch 'jk/common-main'
Fix for a small regression in a topic already in 'master'.
* jk/common-main:
common-main: stop munging argv[0] path
Junio C Hamano [Tue, 29 Nov 2016 19:36:11 +0000 (11:36 -0800)]
Merge tag 'l10n-2.11.0-rnd3.1' of git://github.com/git-l10n/git-po
l10n-2.11.0-rnd3.1: update ru and ca translations
* tag 'l10n-2.11.0-rnd3.1' of git://github.com/git-l10n/git-po:
l10n: ru.po: update Russian translation
l10n: ca.po: update translation
Jeff King [Sun, 27 Nov 2016 04:31:13 +0000 (23:31 -0500)]
common-main: stop munging argv[0] path
Since
650c44925 (common-main: call git_extract_argv0_path(),
2016-07-01), the argv[0] that is seen in cmd_main() of
individual programs is always the basename of the
executable, as common-main strips off the full path. This
can produce confusing results for git-daemon, which wants to
re-exec itself.
For instance, if the program was originally run as
"/usr/lib/git/git-daemon", it will try just re-execing
"git-daemon", which will find the first instance in $PATH.
If git's exec-path has not been prepended to $PATH, we may
find the git-daemon from a different version (or no
git-daemon at all).
Normally this isn't a problem. Git commands are run as "git
daemon", the git wrapper puts the exec-path at the front of
$PATH, and argv[0] is already "daemon" anyway. But running
git-daemon via its full exec-path, while not really a
recommended method, did work prior to
650c44925. Let's make
it work again.
The real goal of
650c44925 was not to munge argv[0], but to
reliably set the argv0_path global. The only reason it
munges at all is that one caller, the git.c wrapper,
piggy-backed on that computation to find the command
basename. Instead, let's leave argv[0] untouched in
common-main, and have git.c do its own basename computation.
While we're at it, let's drop the return value from
git_extract_argv0_path(). It was only ever used in this one
callsite, and its dual purposes is what led to this
confusion in the first place.
Note that by changing the interface, the compiler can
confirm for us that there are no other callers storing the
return value. But the compiler can't tell us whether any of
the cmd_main() functions (besides git.c) were relying on the
basename munging. However, we can observe that prior to
650c44925, no other cmd_main() functions did that munging,
and no new cmd_main() functions have been introduced since
then. So we can't be regressing any of those cases.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Sun, 27 Nov 2016 06:34:45 +0000 (01:34 -0500)]
t7610: clean up foo.XXXXXX tmpdir
The lazy prereq for MKTEMP uses "mktemp -t" to see if
mergetool's internal mktemp call will be able to run. But
unlike the call inside mergetool, we do not ever bother to
clean up the result, and the /tmp of git developers will
slowly fill up with "foo.XXXXXX" directories as they run the
test suite over and over. Let's clean up the directory
after we've verified its creation.
Note that we don't use test_when_finished here, and instead
just make rmdir part of the &&-chain. We should only remove
something that we're confident we just created. A failure in
the middle of the chain either means there's nothing to
clean up, or we are very confused and should err on the side
of caution.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vinicius Kursancew [Mon, 28 Nov 2016 09:33:18 +0000 (09:33 +0000)]
git-p4: allow submit to create shelved changelists.
Add a --shelve command line argument which invokes p4 shelve instead
of submitting changes. After shelving the changes are reverted from the
p4 workspace.
Signed-off-by: Vinicius Kursancew <viniciusalexandre@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Tue, 29 Nov 2016 09:38:20 +0000 (01:38 -0800)]
mergetools/vimdiff: trust Vim's exit code
Allow vimdiff users to signal that they do not want to use the
result of a merge by exiting with ":cquit", which tells Vim to
exit with an error code.
This is better than the current behavior because it allows users
to directly flag that the merge is bad, using a standard Vim
feature, rather than relying on a timestamp heuristic that is
unforgiving to users that save in-progress merge files.
The original behavior can be restored by configuring
mergetool.vimdiff.trustExitCode to false.
Reported-by: Dun Peal <dunpealer@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Tue, 29 Nov 2016 09:38:07 +0000 (01:38 -0800)]
mergetool: honor mergetool.$tool.trustExitCode for built-in tools
Built-in merge tools contain a hard-coded assumption about
whether or not a tool's exit code can be trusted to determine
the success or failure of a merge. Tools whose exit codes are
not trusted contain calls to check_unchanged() in their
merge_cmd() functions.
A problem with this is that the trustExitCode configuration is
not honored for built-in tools.
Teach built-in tools to honor the trustExitCode configuration.
Extend run_merge_cmd() so that it is responsible for calling
check_unchanged() when a tool's exit code cannot be trusted.
Remove check_unchanged() calls from scriptlets since they are no
longer responsible for calling it.
When no configuration is present, exit_code_trustable() is
checked to see whether the exit code should be trusted.
The default implementation returns false.
Tools whose exit codes can be trusted override
exit_code_trustable() to true.
Reported-by: Dun Peal <dunpealer@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Tue, 29 Nov 2016 13:19:43 +0000 (21:19 +0800)]
Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru
* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
l10n: ru.po: update Russian translation
Dimitriy Ryazantcev [Tue, 29 Nov 2016 09:33:07 +0000 (11:33 +0200)]
l10n: ru.po: update Russian translation
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Alex Henrie [Tue, 29 Nov 2016 03:06:25 +0000 (20:06 -0700)]
l10n: ca.po: update translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Marc Branchaud [Thu, 24 Nov 2016 16:59:00 +0000 (11:59 -0500)]
RelNotes: spelling and phrasing fixups
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 24 Nov 2016 11:45:36 +0000 (18:45 +0700)]
merge-recursive.c: use string_list_sort instead of qsort
Merge-recursive sorts a string list using a raw qsort(), where it
feeds the "items" from one struct but the "nr" and size fields from
another struct. This isn't a bug because one list is a copy of the
other, but it's unnecessarily confusing (and also caused our recent
QSORT() cleanups via coccinelle to miss this call site).
Let's use string_list_sort() instead, which is more concise and harder
to get wrong. Note that we need to adjust our comparison function,
which gets fed only the strings now, not the string_list_items. That's
OK because we don't use the "util" field as part of our sort.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 28 Nov 2016 23:28:04 +0000 (15:28 -0800)]
Merge tag 'l10n-2.11.0-rnd3' of git://github.com/git-l10n/git-po
l10n-2.11.0-rnd3
* tag 'l10n-2.11.0-rnd3' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 210 new messages
l10n: fix unmatched single quote in error message
Nguyễn Thái Ngọc Duy [Mon, 28 Nov 2016 09:36:56 +0000 (16:36 +0700)]
worktree list: keep the list sorted
It makes it easier to write tests for. But it should also be good for
the user since locating a worktree by eye would be easier once they
notice this.
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 [Mon, 28 Nov 2016 09:36:55 +0000 (16:36 +0700)]
worktree.c: get_worktrees() takes a new flag argument
This is another no-op patch, in preparation for get_worktrees() to do
optional things, like sorting.
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 [Mon, 28 Nov 2016 09:36:54 +0000 (16:36 +0700)]
get_worktrees() must return main worktree as first item even on error
This is required by git-worktree.txt, stating that the main worktree is
the first line (especially in --porcelain mode when we can't just change
behavior at will).
There's only one case when get_worktrees() may skip main worktree, when
parse_ref() fails. Update the code so that we keep first item as main
worktree and return something sensible in this case:
- In user-friendly mode, since we're not constraint by anything,
returning "(error)" should do the job (we already show "(detached
HEAD)" which is not machine-friendly). Actually errors should be
printed on stderr by parse_ref() (*)
- In plumbing mode, we do not show neither 'bare', 'detached' or
'branch ...', which is possible by the format description if I read
it right.
Careful readers may realize that when the local variable "head_ref" in
get_main_worktree() is emptied, add_head_info() will do nothing to
wt->head_sha1. But that's ok because head_sha1 is zero-ized in the
previous patch.
(*) Well, it does not. But it's supposed to be a stop gap implementation
until we can reuse refs code to parse "ref: " stuff in HEAD, from
resolve_refs_unsafe(). Now may be the time since refs refactoring is
mostly done.
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 [Mon, 28 Nov 2016 09:36:53 +0000 (16:36 +0700)]
worktree: reorder an if statement
This is no-op. But it helps reduce diff noise in the next patch.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ralf Thielow [Wed, 2 Nov 2016 17:51:08 +0000 (18:51 +0100)]
l10n: de.po: translate 210 new messages
Translate 210 new messages came from git.pot update in
fda7b09
(l10n: git.pot: v2.11.0 round 1 (209 new, 53 removed)) and
c091ffb
(l10n: git.pot: v2.11.0 round 2 (1 new, 1 removed)).
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Jiang Xin [Sun, 20 Nov 2016 12:26:17 +0000 (20:26 +0800)]
l10n: fix unmatched single quote in error message
Translate one message introduced by commit:
*
358718064b i18n: fix unmatched single quote in error message
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Junio C Hamano [Wed, 23 Nov 2016 19:24:59 +0000 (11:24 -0800)]
Git 2.11-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 23 Nov 2016 19:23:17 +0000 (11:23 -0800)]
Merge branch 'jc/setup-cleanup-fix'
"git archive" and "git mailinfo" stopped reading from local
configuration file with a recent update.
* jc/setup-cleanup-fix:
archive: read local configuration
mailinfo: read local configuration
Junio C Hamano [Wed, 23 Nov 2016 19:23:17 +0000 (11:23 -0800)]
Merge branch 'jt/trailer-with-cruft'
Doc update.
* jt/trailer-with-cruft:
doc: mention user-configured trailers
Junio C Hamano [Wed, 23 Nov 2016 19:23:17 +0000 (11:23 -0800)]
Merge branch 'js/rebase-i-commentchar-fix'
"git rebase -i" did not work well with core.commentchar
configuration variable for two reasons, both of which have been
fixed.
* js/rebase-i-commentchar-fix:
rebase -i: handle core.commentChar=auto
stripspace: respect repository config
rebase -i: highlight problems with core.commentchar
Junio C Hamano [Wed, 23 Nov 2016 19:23:16 +0000 (11:23 -0800)]
Merge branch 'jc/for-each-ref-head-segfault-fix'
Using a %(HEAD) placeholder in "for-each-ref --format=" option
caused the command to segfault when on an unborn branch.
* jc/for-each-ref-head-segfault-fix:
for-each-ref: do not segv with %(HEAD) on an unborn branch
Nguyễn Thái Ngọc Duy [Tue, 22 Nov 2016 10:00:44 +0000 (17:00 +0700)]
worktree.c: zero new 'struct worktree' on allocation
This keeps things a bit simpler when we add more fields, knowing that
default values are always zero.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams [Thu, 17 Nov 2016 18:46:04 +0000 (10:46 -0800)]
push: fix --dry-run to not push submodules
Teach push to respect the --dry-run option when configured to
recursively push submodules 'on-demand'. This is done by passing the
--dry-run flag to the child process which performs a push for a
submodules when performing a dry-run.
In order to preserve good user experience, the additional check for
unpushed submodules is skipped during a dry-run when
--recurse-submodules=on-demand. The check is skipped because the submodule
pushes were performed as dry-runs and this check would always fail as the
submodules would still need to be pushed.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams [Thu, 17 Nov 2016 18:46:03 +0000 (10:46 -0800)]
push: --dry-run updates submodules when --recurse-submodules=on-demand
This patch adds a test to illustrate how push run with --dry-run doesn't
actually perform a dry-run when push is configured to push submodules
on-demand. Instead all submodules which need to be pushed are actually
pushed to their remotes while any updates for the superproject are
performed as a dry-run. This is a bug and not the intended behaviour of
a dry-run.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 22 Nov 2016 22:16:06 +0000 (14:16 -0800)]
Merge tag 'l10n-2.11.0-rnd2' of git://github.com/git-l10n/git-po
l10n-2.11.0-rnd2
* tag 'l10n-2.11.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: Fixed typo of git fetch-pack command
l10n: git.pot: v2.11.0 round 2 (1 new, 1 removed)
l10n: zh_CN: for git v2.11.0 l10n round 1
l10n: pt_PT: update Portuguese translation
l10n: fr.po fix grammar mistakes
l10n: fr.po v2.11.0_rnd1
l10n: sv.po: Update Swedish translation (2913t0f0u)
l10n: vi.po: Updated translation to v2.11.0 (2913t)
l10n: ko.po: Update Korean translation
l10n: git.pot: v2.11.0 round 1 (209 new, 53 removed)
l10n: ru.po: update Russian translation
Junio C Hamano [Tue, 22 Nov 2016 22:15:38 +0000 (14:15 -0800)]
Merge branch 'js/prepare-sequencer'
Fix for an error message string.
* js/prepare-sequencer:
i18n: fix unmatched single quote in error message
Junio C Hamano [Tue, 22 Nov 2016 21:37:04 +0000 (13:37 -0800)]
archive: read local configuration
Since
b9605bc4f2 ("config: only read .git/config from configured
repos", 2016-09-12), we do not read from ".git/config" unless we
know we are in a repository. "git archive" however didn't do the
repository discovery and instead relied on the old behaviour.
Teach the command to run a "gentle" version of repository discovery
so that local configuration variables are honoured.
[jc: stole tests from peff]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 22 Nov 2016 21:13:16 +0000 (13:13 -0800)]
mailinfo: read local configuration
Since
b9605bc4f2 ("config: only read .git/config from configured
repos", 2016-09-12), we do not read from ".git/config" unless we
know we are in a repository. "git mailinfo" however didn't do the
repository discovery and instead relied on the old behaviour. This
was mostly OK because it was merely run as a helper program by other
porcelain scripts that first chdir's up to the root of the working
tree.
Teach the command to run a "gentle" version of repository discovery
so that local configuration variables like mailinfo.scissors are
honoured.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Tue, 22 Nov 2016 14:24:59 +0000 (22:24 +0800)]
l10n: Fixed typo of git fetch-pack command
Git 2.11.0-rc2 introduced one small l10n update, and this commit fixed
the affected translations all in one batch.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Tue, 22 Nov 2016 14:22:59 +0000 (22:22 +0800)]
l10n: git.pot: v2.11.0 round 2 (1 new, 1 removed)
Generate po/git.pot from v2.11.0-rc2 for git v2.11.0 l10n round 2.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Tue, 22 Nov 2016 14:08:47 +0000 (22:08 +0800)]
Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
l10n: zh_CN: for git v2.11.0 l10n round 1
l10n: pt_PT: update Portuguese translation
l10n: fr.po fix grammar mistakes
l10n: fr.po v2.11.0_rnd1
l10n: sv.po: Update Swedish translation (2913t0f0u)
l10n: vi.po: Updated translation to v2.11.0 (2913t)
l10n: ko.po: Update Korean translation
l10n: git.pot: v2.11.0 round 1 (209 new, 53 removed)
l10n: ru.po: update Russian translation
Jonathan Tan [Mon, 21 Nov 2016 20:47:21 +0000 (12:47 -0800)]
doc: mention user-configured trailers
In commit
1462450 ("trailer: allow non-trailers in trailer block",
2016-10-21), functionality was added (and tested [1]) to allow
non-trailer lines in trailer blocks, as long as those blocks contain at
least one Git-generated or user-configured trailer, and consists of at
least 25% trailers. The documentation was updated to mention this new
functionality, but did not mention "user-configured trailer".
Further update the documentation to also mention "user-configured
trailer".
[1] "with non-trailer lines mixed with a configured trailer" in
t/t7513-interpret-trailers.sh
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Mon, 21 Nov 2016 14:18:29 +0000 (15:18 +0100)]
rebase -i: handle core.commentChar=auto
When
84c9dc2 (commit: allow core.commentChar=auto for character auto
selection, 2014-05-17) extended the core.commentChar functionality to
allow for the value 'auto', it forgot that rebase -i was already taught to
handle core.commentChar, and in turn forgot to let rebase -i handle that
new value gracefully.
Reported by Taufiq Hoven.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Mon, 21 Nov 2016 14:18:24 +0000 (15:18 +0100)]
stripspace: respect repository config
The way "git stripspace" reads the configuration was not quite
kosher, in that the code forgot to probe for a possibly existing
repository (note: stripspace is designed to be usable outside the
repository as well). It read .git/config only when it was run from
the top-level of the working tree by accident. A recent change
b9605bc4f2 ("config: only read .git/config from configured repos",
2016-09-12) stopped reading the repository-local configuration file
".git/config" unless the repository discovery process is done, so
that .git/config is never read even when run from the top-level,
exposing the old bug more.
When rebasing interactively with a commentChar defined in the
current repository's config, the help text at the bottom of the edit
script potentially used an incorrect comment character. This was not
only funny-looking, but also resulted in tons of warnings like this
one:
Warning: the command isn't recognized in the following line
- #
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Mon, 21 Nov 2016 14:18:05 +0000 (15:18 +0100)]
rebase -i: highlight problems with core.commentchar
The interactive rebase does not currently play well with
core.commentchar. Let's add some tests to highlight those problems
that will be fixed in the remainder of the series.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Sun, 20 Nov 2016 12:26:17 +0000 (20:26 +0800)]
i18n: fix unmatched single quote in error message
Fixed unmatched single quote introduced by commit:
*
f56fffef9a sequencer: teach write_message() to append an optional LF
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Thu, 27 Oct 2016 13:53:37 +0000 (21:53 +0800)]
l10n: zh_CN: for git v2.11.0 l10n round 1
Update 209 translations (2913t0f0u) for git v2.11.0-rc0.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Junio C Hamano [Fri, 18 Nov 2016 23:21:12 +0000 (15:21 -0800)]
for-each-ref: do not segv with %(HEAD) on an unborn branch
The code to flip between "*" and " " prefixes depending on what
branch is checked out used in --format='%(HEAD)' did not consider
that HEAD may resolve to an unborn branch and dereferenced a NULL.
This will become a lot easier to trigger as the codepath will be
used to reimplement "git branch [--list]" in the future.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Turner [Mon, 7 Nov 2016 18:31:31 +0000 (13:31 -0500)]
submodules: allow empty working-tree dirs in merge/cherry-pick
When a submodule is being merged or cherry-picked into a working
tree that already contains a corresponding empty directory, do not
record a conflict.
One situation where this bug appears is:
- Commit 1 adds a submodule
- Commit 2 removes that submodule and re-adds it into a subdirectory
(sub1 to sub1/sub1).
- Commit 3 adds an unrelated file.
Now the user checks out commit 1 (first deinitializing the submodule),
and attempts to cherry-pick commit 3. Previously, this would fail,
because the incoming submodule sub1/sub1 would falsely conflict with
the empty sub1 directory.
This patch ignores the empty sub1 directory, fixing the bug. We only
ignore the empty directory if the object being emplaced is a
submodule, which expects an empty directory.
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Nov 2016 21:47:36 +0000 (13:47 -0800)]
Git 2.11-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Nov 2016 21:45:22 +0000 (13:45 -0800)]
Merge branch 'tk/diffcore-delta-remove-unused'
Code cleanup.
* tk/diffcore-delta-remove-unused:
diffcore-delta: remove unused parameter to diffcore_count_changes()
Junio C Hamano [Thu, 17 Nov 2016 21:45:21 +0000 (13:45 -0800)]
Merge branch 'jk/create-branch-remove-unused-param'
Code clean-up.
* jk/create-branch-remove-unused-param:
create_branch: drop unused "head" parameter
Junio C Hamano [Thu, 17 Nov 2016 21:45:21 +0000 (13:45 -0800)]
Merge branch 'nd/worktree-lock'
Typofix.
* nd/worktree-lock:
git-worktree.txt: fix typo "to"/"two", and add comma
Heiko Voigt [Wed, 16 Nov 2016 15:11:07 +0000 (16:11 +0100)]
submodule_needs_pushing(): explain the behaviour when we cannot answer
When we do not have commits that are involved in the update of the
superproject in our copy of submodule, we cannot tell if the remote
end needs to acquire these commits to be able to check out the
superproject tree. Explain why we answer "no there is no need/point
in pushing from our submodule repository" in this case.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Heiko Voigt [Wed, 16 Nov 2016 15:11:06 +0000 (16:11 +0100)]
batch check whether submodule needs pushing into one call
We run a command for each sha1 change in a submodule. This is
unnecessary since we can simply batch all sha1's we want to check into
one command. Lets do it so we can speedup the check when many submodule
changes are in need of checking.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Heiko Voigt [Wed, 16 Nov 2016 15:11:05 +0000 (16:11 +0100)]
serialize collection of refs that contain submodule changes
We are iterating over each pushed ref and want to check whether it
contains changes to submodules. Instead of immediately checking each ref
lets first collect them and then do the check for all of them in one
revision walk.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>